tm4c123 launchpad作为master时
i2c写操作要先输出device address,再给一个Register Address,然后才能写
i2c读操作也要给定这两个地址才能读,
可是tivaware中i2c相关api似乎没有寄存器地址这个参数,该如何正确操作呢。
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.
tm4c123 launchpad作为master时
i2c写操作要先输出device address,再给一个Register Address,然后才能写
i2c读操作也要给定这两个地址才能读,
可是tivaware中i2c相关api似乎没有寄存器地址这个参数,该如何正确操作呢。
Zhengguan
我的理解是你读写是需要先指定slave device 的寄存器地址,再读写相关的数据。
对于这个问题,是这样的:
1. I2C的master只负责发送发送和接收数据。
2. 具体的寄存器的地址需要根据slave device的datasheet进行设定。
3. Master 把寄存器地址作为普通数据发送给Slave就可以了。Slave自然会把第一个字节的数据作为寄存器地址。