Hello,
I am using the TMS570LS1115 chip in my application and I want to interface with the TPS chip. For this I would like to use the SPI2 module and the TPS driver.
As I understood I only need to provide the send_recieve_data interface to the TPS library to make this work.
boolean (* send_recieve_data) (const uint16 * const u16TransmitData,const uint32 u32TransmitSize,volatile uint16* u16RecieveData,uint32 * u32RecieveSize);
In the above function there are four parameters. I would like to know how to implement the required behavior of the function.
Does u32TransmitSize mean the size of the data in bytes or in 16-bit wide words?Since the data buffer is given as u16TransmitData it is confusing. The same issue is there for the receive buffer as well.
I guess once the TPS API is called it will send a command to the TPS chip and get the reply to that command directly.
In the spiTransmit function,
uint32 spiTransmitData(spiBASE_t *spi, spiDAT1_t *dataconfig_t, uint32 blocksize, uint16 * srcbuff)
What should be the spiDAT1_t configuration values? I guess the block size is 'u32TransmitSize' in this case.
Also the send_recieve_data expects a pointer to u32RecieveSize. This means that it expects the transferred data amount as output through receive size. But spi.h header file has no function to accommodate this requirement.
If there is any example that would be helpful.
Thank you.