Skip to main content
Super User
July 19, 2019
Solved

LIS3DH - Error in C-Driver-MEMS

  • July 19, 2019
  • 2 replies
  • 879 views

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?

    This topic has been closed for replies.
    Best answer by AZANC

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

    2 replies

    AZANCAnswer
    Visitor II
    July 22, 2019

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

    Super User
    July 22, 2019

    "the last commit" being 2 hours ago.

    :beaming_face_with_smiling_eyes: