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

PSoC™ 5, 3 & 1 Forum Discussions

EmRi_4607881
Level 1
Level 1
First like received

Hello everyone,

I want to receive data from a temperature sensor (TC072) to my SPI Master, so I want to disable the Tx in order to "Receive".

Datasheets mention the function "SPIM_TxDisable()" but I obtain the warning "implicit declaration of function SPIM_TxDisable() is invalid in C99".

Does someone know the reason and how to fix it ?

Thanks a lot,

Emma.

0 Likes
1 Solution

Hi,

According to the datasheet of SPIM, SPIM_TxDisable() is valid when the component is configured as "bidirectional"

000-Datasheet.JPG

So I made a test project with following schematic.

SPIM_1 : full duplex

SPIM_2 : bidirectional

001-schematic.JPG

Then I wrote a main.c as

002-main_c.JPG

Here, as SPIM_1 is full duplex ( != bidirectional) SPIM_1_TxDisable() is "implicit declaration"

where SPIM_2_TxDisable() does not have the "Stop Mark/Warning".

So if you'd like to use SPIM_TxDisable/Enable function, you need to configure the component as bidirectional.

Or if you use full duplex SPIM, you don't need to use TxDisable/Enable.

moto

View solution in original post

0 Likes
4 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi emri_4607881​,

Could you please let us know the PSoC used , component name, component version and PSoC Creator version you are using in your application?

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

Hi,

I use the PSoC 5LP with the CY8CKIT-050 kit (Device selected Cy8C5868AXI-LP035) , and the PSoC Creator 4.2. The component name is the SPI Master version 2.50.

Thanks,

Emma.

0 Likes

Hi,

According to the datasheet of SPIM, SPIM_TxDisable() is valid when the component is configured as "bidirectional"

000-Datasheet.JPG

So I made a test project with following schematic.

SPIM_1 : full duplex

SPIM_2 : bidirectional

001-schematic.JPG

Then I wrote a main.c as

002-main_c.JPG

Here, as SPIM_1 is full duplex ( != bidirectional) SPIM_1_TxDisable() is "implicit declaration"

where SPIM_2_TxDisable() does not have the "Stop Mark/Warning".

So if you'd like to use SPIM_TxDisable/Enable function, you need to configure the component as bidirectional.

Or if you use full duplex SPIM, you don't need to use TxDisable/Enable.

moto

0 Likes

Hi,

Thanks for your answer, I will use that!

Have a nice day,

Emma.