IMU sensor

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

IMU sensor

125 次查看
semiconductor_user
Contributor II

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, &reg, &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 ?

 

标记 (1)
0 项奖励
1 回复

98 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @semiconductor_user,

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.

Julin_AragnM_1-1714079881500.png

Best regards,
Julián

0 项奖励