Skip to main content
Ukazu
Associate III
February 27, 2020
Solved

about HAL_I2C_Mem_Read()

  • February 27, 2020
  • 2 replies
  • 1337 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

oleksandr.karbivsky
Senior 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.

Ukazu
UkazuAuthor
Associate III
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!!!