Hello we are using the RM48L952ZWT HalCoGen (4.03.00) autogenerated spi.c code. For the
uint32 spiReceiveData(spiBASE_t *spi, spiDAT1_t *dataconfig_t, uint32 blocksize, uint16 * destbuff)
1. Do you have an example of using this function?
2. is blocksize = number of bytes?
3. specifically the 2nd argument spiDAT1_t *dataconfig_t? How should this be set when we want to use this function? We are writing to a wireless slave over SPI, and we want to be able to write i.e.,
.....
//pull D3 pin low
bsp_SPI_GPIO_OFF(TERMINAL_D3_SPI2_GIO);
//delay 250usecs
_pmuSetCountEvent_(pmuCOUNTER0, PMU_CYCLE_COUNT);
BSP_OS_TimeDlyPMU(250);
//pull D3 pin high
bsp_SPI_GPIO_ON(TERMINAL_D3_SPI2_GIO);
//delay 2msecs
BSP_OS_TimeDlyMs(2);
/* do a soft reset */
spiTransmitData(spiREG3, pTest, 1, pTransmitData);
transmitData = INIT_SOFTRST;
spiTransmitData(spiREG3, pTest, 1, pTransmitData);
....
then read back a status of the processor i.e.,
do
{
transmitData = READ_SOFTRST;
spiTransmitData(spiREG3, pTest, 1, pTransmitData);
spiReceiveData (spiREG3,??,1,destbuff);
i = * destbuff;
}
while((i&0x07) != (CPU_INT08U)0x00);
datasheet for slave is here: 3757.39776C.pdf
Thank you.