RP2040 和 adxl357 加速度计之间的 I2C 通信(C/C++ SDK)

I2C communication between RP2040 and adxl357 accelerometer ( C/C++ SDK )

我需要通过 I2C 与 adxl357 加速度计通信,出现了一些问题。 在看 RP2040 sdk documentation I see that there is a special method to send data to a certain address, such as i2c_write_blocking(). Its arguments include a 7-bit address and the data to be sent. My question is, since the accelerometer needs a Read/Write bit, is it still possible to use this function? Or should I go to the alternative i2c_write_raw_blocking()?

还有,我不明白Read / Write bit的表示法,报告是R/#W,是不是说1是Read,0是write?

在此先感谢您的帮助。

I2C 地址有 7 位:这些在 8 位字节的高 7 位中发送,其余位(最低有效位)设置为 1 表示读取,0 表示写入。

文档说它想要一个 7 位地址的原因是因为它告诉您写函数会将地址左移一位并加 1,而读函数函数会将地址左移地址加一个0.

如果它没有告诉您这一点,您可能会自己预先移动地址,这是错误的。