Skip to main content
Graduate
February 27, 2020
Solved

about HAL_I2C_Mem_Read()

  • February 27, 2020
  • 2 replies
  • 1307 views

I want to read the general accelerometer register of the I2C interface.

I think it can be achieved by using HAL_I2C_Mem_Read ().

I set the second argument DevAddress to the value of the accelerometer slave address shifted left by 1 bit.

This is a HAL rule.

At this time, is it unnecessary to set bit0 of DevAddress to 1?

At the time of Read operation, I think that it is necessary to set bit0 to 1 together with the slave address.

    This topic has been closed for replies.
    Best answer by oleksandr.karbivsky

    Hi. Bit0 of DevAddress set to 1 by HAL driver. You must just pass slave address shifted left by 1 to function.

    2 replies

    Visitor II
    February 27, 2020

    Hi. Bit0 of DevAddress set to 1 by HAL driver. You must just pass slave address shifted left by 1 to function.

    UkazuAuthor
    Graduate
    February 27, 2020

    Thank you for looking at my question.

    I understand your explanation.

    I am writing a design document now.

    I can continue writing!!!