C Syntax for PSOC Creator

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

cross mob
Anonymous
Not applicable

Hi there

   

It's long time ago that I programmed some C code. So the C Syntaxes are gone out of my brain:)

   

I searched I the whole PSOC Creator and Keil help, but I couldn't find an help or lookup table for the basic C Syntaxes. ex. how to perform a logic shift of a Varliable, Array handling, Pointer initializing...

   

Does sombody know where I can find these?

   

Best regards

   

Fabian

0 Likes
12 Replies
Anonymous
Not applicable

Hi Fabian,

   

you asked about C-Syntax for PSoC Creator. There is no specific C-Synthax for Creator, just C-Syntax in general.

   

There are API calls though and they are listed in the data sheet of every component. These calls and how to pass parameters follow the same standard C-Syntax.

   

As for a good C-Book, that is highly depending on personal liking.

   

I posted this a couple weeks ago but it makes for a good reference you can use as well.

   

"The C programming language by Kernighan / Ritchie" is old but still a reference.

   

"Embedded C-programming by Michael J. Pont" comes to mind.

   

Have fun developing with PSoC and Creator!

   

Robert

0 Likes
Anonymous
Not applicable

So that means there is no specific language for PSoC ? We can use syntax of C language with with parameters given ?

0 Likes

Yes, that is quite right. The special properties of a PSoC component are introduced at design-time and can be modified at run-time using the appropriate APIs. You need to download and install the PSoC IDE Creator 3.3 from Cypress website for free.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

thanks for your information

0 Likes
Anonymous
Not applicable

   

Hello,

   

It looks like syntax that we use in general for embedded C programming has errors in PSoC Creator.

e.g.

ADC_Output = (BYTE)(F_ADC_Output>>2);

   

   

error : BYTE is unidentified identifier.

   

This was good in designer; can anyone help me out with this ?

0 Likes
AlanH_86
Employee
Employee
100 replies posted 50 replies posted 25 solutions authored

Ceena,

   

You section of code: 

   

   

ADC_Output = (BYTE)(F_ADC_Output>>2);

       

 

   

error : BYTE is unidentified identifier.

   

 

   

The (BYTE) is a C Cast operation that casts the (F_ADC...) to a type of BYTE

   

 

   

In the designer include files there is a #define which causes BYTE to be a shortcut to an 8bit c type.

   

 

   

In creator you can use the type of uint8... which is also a #define to a native C-type of an 8bit unsigned integer.

   

 

   

Your code could be

   

 

    ADC_Output = (uint8)(F_ADC_Output>>2);   

 

 

This wikipedia page is a good reference for the c-programming language

http://en.wikipedia.org/wiki/C_syntax

 

Alan

0 Likes
Anonymous
Not applicable

 Thanks Alan . . . 

0 Likes
Anonymous
Not applicable

Is there a "C Language Compiler User Guide" for PSoC Creator? Similar to the one offered for PSoC Designer

0 Likes

Another way of finding this documentation is go to the Help tab in PSoc Creator, then navigate to Help > Documentation > GCC or other document of your choice.

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

Creator uses GCC, the free Gnu compiler collection. Documentation is here.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

IGPIO   GPIO current   Min = -30mA and Max = 41mA.

   

Is it the Sink current of the GPIO pin or Source?

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

Welcome in the forum.

   

When you have a look at the thread title you might see that this is concerned with C-Language and not GPIO pin's properties.

   

Would make things easier for us would be when you specify:

   

Which PSoC are you talking about and which datasheet you picked the information from.

   

 

   

Bob

0 Likes