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.

Startterware中的I2C操作困惑

Other Parts Discussed in Thread: TPS65217

I2C协议中不管是接收还是发送,第一个动作是发送一个从设备地址加上一个读写标志位(7+1)。

在starterware中,我看到从设备地址是直接写在【I2C_SA】寄存器中,
 
比如:    I2CMasterSlaveAddrSet(SOC_I2C_0_REGS, PMIC_TPS65217_I2C_SLAVE_ADDR);
 
我看到参考代码中的读操作:
先写地址,在这之前要【I2CMasterControl(SOC_I2C_0_REGS, I2C_CFG_MST_TX); 】,
要读数据时,先【I2CMasterControl(SOC_I2C_0_REGS, I2C_CFG_MST_RX); 】,
 
然后我的疑问是他是如何按照I2C协议,第一个动作中的7位从设备地址是明确的,但是第八位读写标志位软件并没有告诉他,CPU是如何确定这个读写标志位的?


谢谢