嵌入式开发者社区

标题: 串口中断 [打印本页]

作者: shayingzhe    时间: 2020-12-9 21:26
标题: 串口中断
/*
** These macros are used to identify what events have generated interrupts.
** These are used in the function: 'UARTIntStatus'.
** One of the macro below is returned by 'UARTIntStatus'. Refer to
** definition of 'UARTIntStatus' function for more information.
*/

/* This is used to identify whether FIFO mode is enabled or not.*/
#define UART_FIFOEN_STAT              UART_IIR_FIFOEN

/* This can be used as a mask for the Interrupt Identification(INTID) bits in
* the Interrupt Identification Register(IIR).*/
#define UART_INTID                    UART_IIR_INTID

/* This is used to identify whether Transmitter Empty event has generated an
**  interrupt.
*/
#define UART_INTID_TX_EMPTY           UART_IIR_INTID_THRE                    

/* This is used to identify whether Receiver Data Available event has generated
* an interrupt.*/
#define UART_INTID_RX_DATA            UART_IIR_INTID_RDA                     

/* This is used to identify whether Receiver Line Status event has generated
* an interrupt.*/
#define UART_INTID_RX_LINE_STAT       UART_IIR_INTID_RLS           


/* This is used to identify whether Character Timeout event has generated an
* interrupt.*/
#define UART_INTID_CTI                UART_IIR_INTID_CTI                     

/* This is used to identify whether the servicing of any interrupt is pending
* or not. */
#define UART_INTID_IPEND              UART_IIR_IPEND


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/* This is used to identify whether Receiver Line Status event has generated
* an interrupt.*/
#define UART_INTID_RX_LINE_STAT       UART_IIR_INTID_RLS  
请问标色的这个是什么事件呢?   我在串口例程里发现说是接收错误,那它是怎么判断有错误呢?      
[attach]6657[/attach]



作者: human    时间: 2020-12-11 09:19
底层有标志位,有错误产生就会触发中断。
作者: shayingzhe    时间: 2020-12-13 22:18
谢谢您的回复




欢迎光临 嵌入式开发者社区 (https://www.51ele.net/) Powered by Discuz! X3.4