handling the formals parameter

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

cross mob
YaIs_283501
Level 3
Level 3
First like given
        hi to all. I am trying to make custom components. I read PSoC Creator Component Author Guide(http://www.cypress.com/?docID=41594). But I don't know how to use formals parameter in API.c Author Guide says "Using parameters allows a Verilog instance to be synthesized based on the specific requirement of a component instance. " at page 125. Is there method to use formals parameter in API.c?   
0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

On page 63 in Component Author Guide" is a (short) explanation in how to refer to a component's parameters.

   

It folloows the syntax of

   

`<@ParameterName>`  (do not care for the colour, its a forum sw bug) 

   

which will be expanded to the parameter's value at the time the c-code gets generated.

   

 

   

Just to satisfy my curiosity: What kind of component are you building?

   

 

   

Happy coding

   

Bob

View solution in original post

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

On page 63 in Component Author Guide" is a (short) explanation in how to refer to a component's parameters.

   

It folloows the syntax of

   

`<@ParameterName>`  (do not care for the colour, its a forum sw bug) 

   

which will be expanded to the parameter's value at the time the c-code gets generated.

   

 

   

Just to satisfy my curiosity: What kind of component are you building?

   

 

   

Happy coding

   

Bob

0 Likes
Anonymous
Not applicable

When you enter the parameters in the Component symbol file, you can get that in your header file as a macro.

   

#define `$INSTANCE_NAME`_ParameterName `$ParameterName`

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Sorry, forget the "<" and ">" in my last post. I mis-read something.

   

To use "@" or "$" are equivalent.

   

 

   

Bob

0 Likes
YaIs_283501
Level 3
Level 3
First like given
        Thank you Bob and Ken responded. I missed the page. I was able to understand how to use the parameter. Dear Bob I'm making a calculator like Free42 using the keypad. Keypad http://wvshare.com/product/A_D-Keypad.htm Free42 http://thomasokken.com/free42/   
0 Likes