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.

[参考译文] TMS570LS3137:为什么不清除 Rx 中断?

Guru**** 2473260 points
Other Parts Discussed in Thread: HALCOGEN

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/681257/tms570ls3137-why-is-the-rx-interrupt-not-cleared

器件型号:TMS570LS3137
主题中讨论的其他器件:HALCOGEN

您好!

我创建了一个项目来运行 SCI2/LIN 驱动程序、如本视频中所述。  网址:https://www.youtube.com/watch?v=PpalANwuzIo

该项目按索赔的方式运作,罚款。

但是、我对 HalCogen 生成的 ISR "linHighLevelInterrupt()"感到困惑。 在此 ISR 中、不清除 Rx 中断。

难道我们不应该将挂起的中断作为 ISR 中的第一件事来清除?  

您能否解释为什么不在此 ISR 中清除 Rx 中断? 下面是 HalcogGen 生成的 ISR。

提前感谢、

================================================================================

void linHighLevelInterrupt (void)

uint32 vec = scilinREG->INTVECT0;
uint8字节;
/*用户代码开始(35)*/
/*用户代码结束*/

开关(VEC)

案例1U:
sciNotification (scilinREG、(uint32) SCI_WAKE_INT);
中断;
案例3U:
sciNotification (scilinREG、(uint32) SCI_PE_INT);
中断;
案例6U:
sciNotification (scilinREG、(uint32) SCI_FE_INT);
中断;
案例7U:
sciNotification (scilinREG、(uint32) SCI_break_INT);
中断;
案例9U:
sciNotification (scilinREG、(uint32) SCI_OE_INT);
中断;

案例11U:
/*接收*/
字节=(uint8)(scilinREG->RD & 0x000000FFU);

如果(g_sciTransfer_t[1U].rx_length > 0U)

*g_sciTransfer_t[1U].rx_data =字节;
/*SAFETYMCUSW 567 S MR:17.1,17.4 "需要指针增量"*/
G_sciTransfer_t[1U].rx_data++;
g_sciTransfer_t[1U].rx_length--;
如果(g_sciTransfer_t[1U].rx_length == 0U)

sciNotification (scilinREG、(uint32) SCI_RX_INT);


中断;

案例12U:
/*发送*/
/*SAFETYMCUSW 30 S MR:12.2、12.3 "用于发送/接收轮询和中断模式下的数据计数"*/
-g_sciTransfer_t[1U].TX_length;
如果(g_sciTransfer_t[1U].TX_length > 0U)

uint8 txdata =* g_sciTransfer_t[1U].TX_data;
scilinREG->TD =(uint32)(txdata);
/*SAFETYMCUSW 567 S MR:17.1,17.4 "需要指针增量"*/
G_sciTransfer_t[1U].TX_DATA++;

其他

scilinREG->CLEARINT =(UINT32) SCI_TX_INT;
sciNotification (scilinREG、(uint32) SCI_TX_INT);

中断;

默认值:
/*幻象中断、清除标志并返回*/
scilinREG->FLR =~scilinREG->SETINLVL & 0x07000303U;
中断;

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好!

    读取 SCIRD (SCI 接收器数据缓冲器)寄存器将清除中断标志。 因此、我们无需再次使用 SCICLAERINT 来清除 SCI_RX_INT。