Where to find documentation for system defined constants

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

cross mob
RuGl_1600761
Employee
Employee
25 replies posted 25 sign-ins 10 replies posted

using spi i like to poll for when last bit had been send out of sdo.

I found SPIM_1_ReadTxStatus() and SPIM_1_STS_SPI_DONE but how to combine I had to try and error.  Would be nice to have a explanation of the bits avaliable and how to handle in the fucntion header

/*******************************************************************************
* Function Name: SPIM_1_ReadTxStatus
********************************************************************************
*
* Summary:
* Read the Tx status register for the component.
*
* Parameters:
* None.
*
* Return:
* Contents of the Tx status register.
*
* Global variables:
* SPIM_1_swStatusTx - used to store in software status register,
* modified every function call - resets to zero.
*
* Theory:
* Allows the user and the API to read the Tx status register for error
* detection and flow control.
*
* Side Effects:
* Clear Tx status register of the component.
*
* Reentrant:
* No.
*
*******************************************************************************/

while(!(SPIM_1_ReadTxStatus()& SPIM_1_STS_SPI_DONE))
{
CyDelayUs(100);
i--;
if(i == 0)
{
return false;
}
};

rgl
0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

May be duplicated with Hari-san's answer.

I usually open the datasheet of a component either

(1) From Configure window (lower left corner)

001-Configure_dialog.JPG

(2) Component Catalog (When a component is selected,  the bottom pane has a link to datasheet)

002-Component-catalog.JPG

In the datasheet's Application Programming Interface,

we can find a description of an API

003-Datasheet-1.JPG

When I clicked the link of "Status Register Bits" I could see

004-status_registers.JPG

Or, I would directly access SPIM.h in the Generated_Source > SPIM 

005.JPG

moto

 

 

 

View solution in original post

0 Likes
2 Replies
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi @RuGl_1600761 

 

You can find all the macro definitions in the component datasheet for PSoC 4 and in the PDL documentation for PSoC 6. To access these, you can right-click the component in PSoC Creator and select Open Datasheet (For P4 devices) and Open PDL Documentation for P6 devices. 

Hari_0-1614833298290.png

Hari_1-1614833335278.png

 

 

Best regards, 
Hari

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

May be duplicated with Hari-san's answer.

I usually open the datasheet of a component either

(1) From Configure window (lower left corner)

001-Configure_dialog.JPG

(2) Component Catalog (When a component is selected,  the bottom pane has a link to datasheet)

002-Component-catalog.JPG

In the datasheet's Application Programming Interface,

we can find a description of an API

003-Datasheet-1.JPG

When I clicked the link of "Status Register Bits" I could see

004-status_registers.JPG

Or, I would directly access SPIM.h in the Generated_Source > SPIM 

005.JPG

moto

 

 

 

0 Likes