主题中讨论的其他器件:TMS570LS1227
您好!
我在 TMS570LS1227也遇到了同样的问题。 在这个问题上是否有任何进展?
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.
您好!
我在 TMS570LS1227也遇到了同样的问题。 在这个问题上是否有任何进展?
您好!
如果 TX 中断被启用、即使 长度= 1、也将生成中断。 但 HAL 生成的代码有一个错误、即如果 length=1、则不会调用 TX 通知。
您可以将 I2C ISR 修改为:
原始代码;
================================================================
案例5U:
/*用户代码开始(42)*/
/*用户代码结束*/
/*发送*/
if (g_i2cTransfer_T.length > 0U)
{
i2cREG1->DXR =*g_i2cTransfer_t.data;
/*SAFETYMCUSW 567 S MR:17.1,17.4 "需要指针增量"*/
g_i2c 传输_t.data++;
g_i2c 转移_t.length --;
if (g_i2cTransfer_t.length == 0U)
{//在传输所需的数据计数后禁用 TX 中断*/
i2cREG1->IMR &=(uint32)(~(uint32) I2C_TX_INT);
i2cNotification (i2cREG1、(uint32) I2C_TX_INT);
}
}
中断;
================================================================
修改的代码;
================================================================
案例5U:
/*用户代码开始(42)*/
/*用户代码结束*/
/*发送*/
if (g_i2cTransfer_T.length > 0U)
{
i2cREG1->DXR =*g_i2cTransfer_t.data;
/*SAFETYMCUSW 567 S MR:17.1,17.4 "需要指针增量"*/
g_i2c 传输_t.data++;
g_i2c 转移_t.length --;
}
if (g_i2cTransfer_t.length == 0U)
{//在传输所需的数据计数后禁用 TX 中断*/
i2cREG1->IMR &=(uint32)(~(uint32) I2C_TX_INT);
i2cNotification (i2cREG1、(uint32) I2C_TX_INT);
}
中断;
================================================================