Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® Software > How to test for number of Ports?

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



How to test for number of Ports?
Moderator:
JFMD

Post Reply
Follow this topic



How to test for number of Ports?

tommoxon posted on 11 Sep 2011 7:33 PM PST
Top Contributor
45 Forum Posts

Hi,

I'd like to be able to test for the number of GPIO/Ports supported.

However, you can't do this :

#ifdef PRT5DR
  /* do something with Port5 */
#endif

because PRT5DR is declare as a BYTE variable and not a "#define".

Is there any way to determine dynamically (during compile time) what Pins/Ports are supported?

thanks,

Tom Moxon

 




Re: How to test for number of Ports?

Robert-CY posted on 16 Sep 2011 09:58 AM PST
Cypress Employee
129 Forum Posts

Tom,

just wanted to let you know that your question has been noted and we are looking what kind of solution we can provide for this.

What is the background of your question? Do you want to write code that should do some kind of self configuration depnding what device it runs on? Is the code supossed to find out what chip it is running on? Always curios what our customer's applications are.

Robert



Re: How to test for number of Ports?

tommoxon posted on 16 Sep 2011 11:17 AM PST
Top Contributor
45 Forum Posts

Robert,

Yes, it is desireable to be able to configure software based on what resources are available.

Many microprocessor vendors provide this capability based on the part number used.

(i.e. a "partnumber.h" include file).

Aside from the obvious, how many ports and pins are available,

another example would be the existance of a sleep timer or watchdog timer or not.

For example Cortex-M3 provides a hardware Systick Timer, where this function needs to

be created from a generic timer in M8C or i8051. 

I'm just trying to find out if this exists or not,

so I don't need to reinvent the "timewheel" - so to speak...

 

regards,

Tom Moxon

 

 



Re: How to test for number of Ports?

Mark-CY posted on 18 Sep 2011 02:49 PM PST
Cypress Employee
1 Forum Post

 Tom,

Currently there is no way to specifically test for which ports are supported. The closest to that would be defines that are created for each pin, identifying the port. You can find these in cyfitter.h. For example:

#define Test_Pin__0__PORT 0

Assigns Test_Pin to port 0. If you know what all pins you want, you could determine what all ports are being used. 

The information should be present in the report file that is generated, but this probably isn't enough for what you want to do. We'll keep this in mind for future releases.

-Mark






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20