Skip to main content
FOzat
Associate II
October 11, 2022
Question

How to read reset values of lsm6dsox ?

  • October 11, 2022
  • 3 replies
  • 2073 views

Hi,

I'm trying to do reset set in my lsm6dsox sensor. (I use stm32wbx, stm32cubeide,bucemx)

İ wrote driver functions.

When i get to initialization for my single_tap api . i can not get the default value from the sensor register.

what can be the reason ?

This topic has been closed for replies.

3 replies

FOzat
FOzatAuthor
Associate II
October 11, 2022
int32_t lsm6dsox_reset_set(I2C_HandleTypeDef *i2c, uint8_t val)
{
 lsm6dsox_ctrl3_c_t ctrl3_c;
 uint8_t ret;

 ret = lsm6dsox_read_reg(i2c,LSM6DSOX_READ, LSM6DSOX_CTRL3_C, (uint8_t *)&ctrl3_c, 1); // i canot read the default register value (0x04).

 if(ret==0)
 {
 ctrl3_c.sw_reset = (uint8_t)val;
 ret = lsm6dsox_write_reg(i2c,LSM6DSOX_WRITE, LSM6DSOX_CTRL3_C, (uint8_t *)&ctrl3_c, 1);
 }
 return ret;
}
FOzat
FOzatAuthor
Associate II
October 11, 2022

what can i do to solve and correct the reading process and get the true value from the sensor ?

Remy ISSALYS
ST Technical Moderator
November 7, 2022

Hello,

You can look this post to see example using lsm6dsox sensor maybe it can help you to find the root cause of your issue.

Best Regards