cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ Creator & Designer

odissey1
Honored Contributor II

Hi,

I am trying to find a way to extract the Display Name property from custom-declared component type:

myType_01a.png

myType_01a_B.png

Here is "my_type" is a custom-declared type holding enumerated elements: Name: t1 (t2); Value: 1 (2), and Display Name: "AAA" ("BBB") accordingly. Parameter "my_Label" is assigned a Type of "my_type" and default Value of 1 (Display Name = "AAA").

Now in the header file I can access the parameter my_Label Value using evaluator `$my_Label` (=1) , and extract the element Name ("t1") using API function:

GetNameForEnum("my_Label", 1).

Q. How can I extract the property Display Name ("AAA") from parameter my_Label?

/odissey1 

...

0 Likes
1 Solution
Ekta
Moderator
Moderator

odissey1

You can try using the ResolveEnumIdToDislay() API to extract the Display Name. The details about this are given in the PSoC Creator Customization API Reference Guide (In PSoC Creator goto, Help > Documentation > Customizer API Reference guide)

pastedImage_0.png

Best Regards

Ekta

View solution in original post

0 Likes
5 Replies
Ekta
Moderator
Moderator

Hello odissey1,

Can you please let me know the application for which you need to extract the display name.

You can view the type, value, value name, value display name for a parameter in the Component's Configure dialog pull down menu for that parameter as shown in the figure below:

pastedImage_2.png

Best Regards

Ekta

0 Likes
odissey1
Honored Contributor II

Ekta,

I am trying to make a custom component implementing 16-bit wide Control register following

Re: Can be expanded control register component to 16bit or 32bit? (That meaning is not to use two co...

and other similar threads:

32-bit parallel non-contiguous GPIO write technique

I am using Control file attribute for fixed location placement, which works well when explicit expression is used, like "U(0,0)". But I am having trouble parametrizing this expression, because control file is processed before *.h file, and all defines from the header files are ignored.

Using enumerated custom types allows declaring Display Name strings (like "AAA" or "U(0,0)"), which can be accessed and parsed by the Control file, but I can't figure  a way to access that  Display Name property field for custom type. ( Other fields, like Type Name is extractable by GetNameForEnum(...,...) API).

Alternative way would be adding attribute declaration to the verilog file itself. I found some examples of fixed placement from Xilinx and Altera, which (obviously) do not work in Warp Verilog.

Using Control file seems straightforward, using Verilog should work as well. Any example would be greatly appreciated.

/odissey1

0 Likes
Ekta
Moderator
Moderator

odissey1

You can try using the ResolveEnumIdToDislay() API to extract the Display Name. The details about this are given in the PSoC Creator Customization API Reference Guide (In PSoC Creator goto, Help > Documentation > Customizer API Reference guide)

pastedImage_0.png

Best Regards

Ekta

View solution in original post

0 Likes
odissey1
Honored Contributor II

Ekta,

Thank you. I am traveling, will check on weekends.

/odissey1

0 Likes
odissey1
Honored Contributor II

Ekta,

Thank you for the hint and direction. This should work, but I have to write a Customizer, which would write into the Control file - that i quite a job! I was hoping for some easy function, similar to GetNameForEnum, which works outside of C# framework.

/odissey1

0 Likes