...
Code Block |
---|
uint8_t LSM6DSL_AccReadID(void) { /* IO interface initialization */ SENSOR_IO_Init(); /* Read value at Who am I register address */ return (SENSOR_IO_Read(LSM6DSL_ACC_GYRO_I2C_ADDRESS_LOW, LSM6DSL_ACC_GYRO_WHO_AM_I_REG)); } |
However, the SENSOR_IO_Read is a generic function, and it is your responsibility to replace it with the proper STM SPI communication function.
Make sure you understand what the function is doing, and verify you are sending the correct packages to the IMU. Check out section 9. Register Mapping to verify the packages.
Want some more practice or another introduction to electrical work?
...