5509a与加速度传感器adxl345进行iic通信,现在要从adxl345中的0x00寄存器中读出数据,该怎么写读函数?
int I2C_read (Uint16 *data, int length, int master, Uint16 slaveaddress,int transfermode, int timeout, int checkbus);
在数据文档中iic_read读中只有从设备的地址,怎么读出其子地址(adxl345中的寄存器)的数据?恳请大神帮忙指导!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
5509a与加速度传感器adxl345进行iic通信,现在要从adxl345中的0x00寄存器中读出数据,该怎么写读函数?
int I2C_read (Uint16 *data, int length, int master, Uint16 slaveaddress,int transfermode, int timeout, int checkbus);
在数据文档中iic_read读中只有从设备的地址,怎么读出其子地址(adxl345中的寄存器)的数据?恳请大神帮忙指导!
我看了一下AIC23的时序是只写的,所以这里没有读寄存器的例程。
你看一下adxl345的读寄存器的时序,它要求是先写寄存器的地址,再去读寄存器的值。