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.

TMS320F28374S: 关于I2C的TI例程咨询

Part Number: TMS320F28374S
Other Parts Discussed in Thread: C2000WARE

在TI例程中,看到了如下两个语句:

for(i=I2C_Params->NumOfAddrBytes-1;i>=0;i--)
{
I2C_putData(base, (temp >> (i*8U)) & 0xFF);
}

I2C_sendStartCondition(base);

for循环里应该是把数据送入I2C_O_DXR,数据发送寄存器

这里有几个困惑:

1.这里使用for循环来给DXR寄存器赋值是什么意思呢?for循环内,下一次送入的数据岂不是会把上一次送入DXR寄存器的数据覆盖了吗?

2. 最后一个语句是发送START启动数据发送信号,这个是不是应该放在for循环的前面?因为从I2C的数据发送时序图来看,先发送了START后,才开始传输DXR中的数据的

3. 这里的移位操作为啥是先发送temp的高8位,然后逐步右移8位呢