cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3DH - Error in C-Driver-MEMS

Andrew Neil
Evangelist

The Standard C platform-independent drivers for MEMS motion and environmental sensors

https://www.st.com/content/st_com/en/products/embedded-software/mems-and-sensors-software/drivers-for-mems/c-driver-mems.html

The LIS3DH Temperature Sensor is connected to ADC3

But lis3dh_temperature_raw_get() reads ADC1:

/**
  * @brief  Temperature output value.[get]
  *
  * @param  ctx      read / write interface definitions
  * @param  buff     buffer that stores data read
  * @retval          interface status (MANDATORY: return 0 -> no Error)
  *
  */
int32_t lis3dh_temperature_raw_get(lis3dh_ctx_t *ctx, uint8_t *buff)
{
  int32_t ret;
  ret = lis3dh_read_reg(ctx, LIS3DH_OUT_ADC1_H, buff, 1);   // <<<<< HERE !!
  return ret;
}

 And why is it only reading the High byte?

1 ACCEPTED SOLUTION

Accepted Solutions
AZANC
Associate

Of course, the issue should have been resolved with the last commit.

View solution in original post

2 REPLIES 2
AZANC
Associate

Of course, the issue should have been resolved with the last commit.

Andrew Neil
Evangelist

"the last commit" being 2 hours ago.

😁