Skip to main content
Ukazu
Associate III
Feb 27, 2020 6:00 AM UTC
Solved

about HAL_I2C_Mem_Read()

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.
oleksandr.karbivsky
Senior II
Feb 27, 2020 7:36 AM UTC

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
Feb 27, 2020 7:36 AM UTC

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
Feb 27, 2020 7:41 AM UTC

Thank you for looking at my question.

I understand your explanation.

I am writing a design document now.

I can continue writing!!!