Is the "Target Kit" used during Project Creation available as a parameter in the project?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

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

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
1 Solution

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.

View solution in original post

0 Likes
9 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Leonard,

Attached is reply to the Display Name for enumeration issue

/odissey1

0 Likes

/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).

pastedImage_0.png

It's still not an optimal solution.

Len

PS:

This change to your component appears to also work if you're interested:

pastedImage_1.png

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Yes,

Inline evaluation works in Creator 4.2, but not in 4.0, which I use mostly.

/odissey1

0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

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.

0 Likes

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

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

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.

0 Likes

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

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

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.

0 Likes

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

Len
"Engineering is an Art. The Art of Compromise."
0 Likes