- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm creating a new component. I want to force an assignment of pins depending on the PSoC Kit targeted during the Project Creation phase.
Is there a parameter in a .h file or a `$___` variable that can be processed in the component?
Len
"Engineering is an Art. The Art of Compromise."
Solved! Go to Solution.
- Labels:
-
PSoC Creator Software
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, the control files does not allow for conditionals. You need to have different control files based on the family, series or part number.
Do you have different kits with the same part number? If not, simply use the part number to select the correct control file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/odissey1,
Creative way around the issue without using Customizer code.
Sadly, The "Display Name" is user created when the Enum is defined. However, you can't access it without resorting to a Customizer.
My temporary solution is to list the Enumeration in the body of the Cy Symbol then reference the Enum chosen in a attribute below the symbol. (See pic below).
It's still not an optimal solution.
Len
PS:
This change to your component appears to also work if you're interested:
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes,
Inline evaluation works in Creator 4.2, but not in 4.0, which I use mostly.
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For pin assignment, the proper way to do this is to use Control Files. You can create control files for a family, series or specific part number. If the kits you are targeting use the same part number, then you need to stick with one configuration.
Attached you find an example of component using Control Files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rodolfo,
Thanks for the example. I'm thinking of using a variation on your suggestion.
Maybe you know the answer to this question:
I'd like to create a new component. Let's call it "Kit". The "Kit" component is just a holder for a assignment of a global TopDesign variable.
The variable in "Kit" would be enumerated with an attached String that represents the Kit the TopDesign is targeting. Examples of strings for this variable would be "CY8CKIT-059" "CY8CKIT-050", "CY8CPROTO-063-BLE", etc.
The Global variable would be available to other components to use to make decisions particularly about default pin or design resource requirements.
Is this possible? Can component variables be shared among other components using the `$var_name` method?
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It depends what you plan to do. The <project.h> list all the components headers there. If one component rely on other, you can include this file in the implementation of the component APIs to access any information available in the header file from other components.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rodolfo,
I created a "Global Assigns" component where I can have the user assign the "Kit" being used. I then can assign a #define use this enum from the component to place into the component's .h file for any compile using "project.h" to access this #define.
The issue, I'm having is getting the control file to use this enum to conditionally assign specifc pins to signals. It appears that the control file format doesn't allow for conditionals.
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, the control files does not allow for conditionals. You need to have different control files based on the family, series or part number.
Do you have different kits with the same part number? If not, simply use the part number to select the correct control file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rodolfo,
Thank you for your help.
I was trying to create a component with PIN assignment based on KIT/Eval board. This would allow a more seamless integration to specific KITs and the pin assignments for attached peripherals. For example: The CY8CKIT-059 has an attached KitProg with a UART connection in Port 12 pins 6 and 7 to allow terminal mode communication. On other Kits, this may be different.
Len
"Engineering is an Art. The Art of Compromise."