hello,
i'm working on imu sensor for that i'm using s32k324 Microcontroller and ASM330LHH stm semiconductor sensor. and i'm using SPI communiction for tx and rx data.
i'm using this api for tx and rx data between microcontroller and imu sensor.
driver API for example
" Lpspi_Ip_StatusType Lpspi_Ip_SyncTransmit(const Lpspi_Ip_ExternalDeviceType *ExternalDevice, const uint8 *TxBuffer, uint8 *RxBuffer, uint16 Length, uint32 TimeOut )"
API CALL
/* hanlde : const Lpspi_Ip_ExternalDeviceType
reg : WHO_AM_I register address
bufp : rx buffer
len : data to be send
TIMEOUT : 1000
*/
uint8_t reg = (0x0f | 0x80);
uint8_t buf = 0;
Lpspi_Ip_SyncTransmit(handle, ®, &bufp, len, 1000);
so my question data is not receving bufp. but i want data in this 8 bit varible uint8_t bufp; not in "bufp[1]";
why i'm saying because i tried and tested code using "uint8_t bufp[2];" array for so i got 0x6b in "bufp[1];".
tell me how i will get output in this "uint8_t bufp;" 8 bit varible ?
You can try one of the examples from the RTD package (Lpspi_Flexio_Ip_Transfer_S32K344 or Spi_Transfer_S32K344). You can modify the transfer buffer and test the API functions.
Best regards,
Julián