I2C001_WriteData function in I2C001 App is it a joke?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User6412
Level 4
Level 4
This generated by Dave code writes the Data in to the Transfer Buffer FIFO for I2C communication:


while(I2CRegs->TCSR & USIC_CH_TCSR_TDV_Msk)
{
;
}
I2CRegs->IN[0] = \
(((uint32_t)Data->TDF_Type << 😎 | Data->Data);


As one can see before writing in to the FIFO the polling of the TDV bit occures. But in this case the FIFO will never be loaded more then with one entry!
0 Likes
2 Replies
Not applicable
Hi Dmitry,

Are you using the older version I2C001 App?
The "I2C001_WirteDate()" defined in I2C001[1.0.26] is checking the TxFIFO:
     if(USIC_IsTxFIFOfull(I2CRegs))
{
Result = (bool)FALSE;
}

else
{
I2CRegs->IN[0] = \
(((uint32_t)Data->Data1.TDF_Type << 😎 | Data->Data1.Data);
Result = (bool)TRUE;


Best regards,
Sophia
0 Likes
User6412
Level 4
Level 4
Thank you Sophia. I will check out the new realization of the App.
0 Likes