uart.h

来自「嵌入式系统」· C头文件 代码 · 共 849 行 · 第 1/3 页

H
849
字号
@@ [Return]     : None
@@
@@ [Desc]       : Enables the detection of any changes in the MODEM status of
@@                the specified UART channel
@@
@@ [END]
******************************************************************************/

#define apd_UARTEnableModemStatusIntr(uart_num) \
    apd_UARTClrIntrReg(uart_num, APD_UARTINTMSK_MSINT)

/******************************************************************************
@@
@@ [Name]       : apd_UARTDisableModemStatusIntr
@@
@@ [Summary]    : This function disables the detection of any changes in the MODEM status
@@
@@ [Argument]   : uart_num: Specify the UART channel number
@@                APD_UART_CH0 for channel 0
@@                APD_UART_CH1 for channel 1
@@
@@ [Return]     : None
@@
@@ [Desc]       : Disables the detection of any changes in the MODEM status of
@@                the specified UART channel
@@
@@ [END]
******************************************************************************/

#define apd_UARTDisableModemStatusIntr(uart_num)    \
    apd_UARTSetIntrReg(uart_num, APD_UARTINTMSK_MSINT)

/******************************************************************************
@@
@@ [Name]       : apd_UARTEnableRxIntr
@@
@@ [Summary]    : This function enables detection when an UART data is received
@@
@@ [Argument]   : uart_num: Specify the UART channel number
@@                APD_UART_CH0 for channel 0
@@                APD_UART_CH1 for channel 1
@@
@@ [Return]     : None
@@
@@ [Desc]       : Enables detection when an UART data is received for the specified channel
@@
@@ [END]
******************************************************************************/

#define apd_UARTEnableRxIntr(uart_num)      \
    apd_UARTClrIntrReg(uart_num, APD_UARTINTMSK_RXINT)

/******************************************************************************
@@
@@ [Name]       : apd_UARTDisableRxIntr
@@
@@ [Summary]    : This function disables detection when an UART data is received
@@
@@ [Argument]   : uart_num: Specify the UART channel number
@@                APD_UART_CH0 for channel 0
@@                APD_UART_CH1 for channel 1
@@
@@ [Return]     : None
@@
@@ [Desc]       : Disables detection when an UART data is received for the specified channel
@@
@@ [END]
******************************************************************************/

#define apd_UARTDisableRxIntr(uart_num)     \
    apd_UARTSetIntrReg(uart_num, APD_UARTINTMSK_RXINT)

/******************************************************************************
@@
@@ [Name]       : apd_UARTEnableTxIntr
@@
@@ [Summary]    : This function enables detection when an UART data has been transmitted
@@
@@ [Argument]   : uart_num: Specify the UART channel number
@@                APD_UART_CH0 for channel 0
@@                APD_UART_CH1 for channel 1
@@
@@ [Return]     : None
@@
@@ [Desc]       : Enables detection when an UART data has been transmitted
@@                for the specified channel
@@
@@ [END]
******************************************************************************/

#define apd_UARTEnableTxIntr(uart_num)      \
    apd_UARTClrIntrReg(uart_num, APD_UARTINTMSK_TXINT)

/******************************************************************************
@@
@@ [Name]       : apd_UARTDisableTxIntr
@@
@@ [Summary]    : This function disables detection when an UART data has been transmitted
@@
@@ [Argument]   : uart_num: Specify the UART channel number
@@                APD_UART_CH0 for channel 0
@@                APD_UART_CH1 for channel 1
@@                APD_UART_CH2 for channel 2 (For LH79531 only)
@@
@@ [Return]     : None
@@
@@ [Desc]       : Disables detection when an UART data has been transmitted
@@                for the specified channel
@@
@@ [END]
******************************************************************************/

#define apd_UARTDisableTxIntr(uart_num)     \
    apd_UARTSetIntrReg(uart_num, APD_UARTINTMSK_TXINT)

/******************************************************************************
@@
@@ [Name]       : apd_UARTEnableErrIntr
@@
@@ [Summary]    : This function enables detection when an UART error has occurred
@@
@@ [Argument]   :  uart_num: Specify the UART channel number
@@                APD_UART_CH0 for channel 0
@@                APD_UART_CH1 for channel 1
@@
@@ [Return]     : None
@@
@@ [Desc]       : Enables detection when an UART error has occurred for the
@@                specified channel
@@
@@ [END]
******************************************************************************/


#define apd_UARTEnableErrIntr(uart_num)     \
    apd_UARTClrIntrReg(uart_num, APD_UARTINTMSK_ERRINT)


/******************************************************************************
@@
@@ [Name]       : apd_UARTDisableErrIntr
@@
@@ [Summary]    : This function disables detection when an UART error has occurred
@@
@@ [Argument]   : uart_num: Specify the UART channel number
@@                APD_UART_CH0 for channel 0
@@                APD_UART_CH1 for channel 1
@@
@@ [Return]     : None
@@
@@ [Desc]       : Disables detection when an UART error has occurred for the
@@                specified channel
@@
@@ [END]
******************************************************************************/

#define apd_UARTDisableErrIntr(uart_num)        \
    apd_UARTSetIntrReg(uart_num, APD_UARTINTMSK_ERRINT)


/******************************************************************************
@@
@@ [Name]       : apd_UARTIsUARTDisableIntr
@@
@@ [Summary]    : This function checks if the UART interrupt is due to data
@@                been received when the UART is disabled
@@
@@ [Argument]   : uart_num: Specify the UART channel number
@@                APD_UART_CH0 for channel 0
@@                APD_UART_CH1 for channel 1
@@
@@ [Return]     : TRUE if data is received when UART is disabled;
@@                FALSE if no data is received when UART is disabled
@@
@@ [Desc]       : Checks whether the UART interrupt occured is due to the fact
@@                that data has been received when the uart is disabled as
@@                according to the agrument(uart_num).
@@
@@ [END]
******************************************************************************/

#define apd_UARTIsUARTDisableIntr(uart_num) \
    apd_UARTIsBitSetInIntr(uart_num, APD_UARTINT_UDINT)

/******************************************************************************
@@
@@ [Name]       : apd_UARTIsModemStatusIntr
@@
@@ [Summary]    : This function checks if the UART interrupt is due to the fact
@@                that one or more of the MODEM status inputs had been changed
@@
@@ [Argument]   : uart_num: Specify the UART channel number
@@                APD_UART_CH0 for channel 0
@@                APD_UART_CH1 for channel 1
@@                APD_UART_CH2 for channel 2 (For LH79531 only)
@@
@@ [Return]     : TRUE if one or more of the MODEM status inputs have been changed;
@@                FALSE if none of the MODEM status inputs have been changed
@@
@@ [Desc]       : Checks whether the UART interrupt occured is due to the fact that
@@                one or more of the modem status inputs had been changed
@@
@@ [END]
******************************************************************************/

#define apd_UARTIsModemStatusIntr(uart_num) \
    apd_UARTIsBitSetInIntr(uart_num, APD_UARTINT_MSINT)

/******************************************************************************
@@
@@ [Name]       : apd_UARTIsRxIntr
@@
@@ [Summary]    : This function checks if the UART interrupt is due to the
@@                fact that UART data had been received
@@
@@ [Argument]   : uart_num: Specify the UART channel number
@@                APD_UART_CH0 for channel 0
@@                APD_UART_CH1 for channel 1
@@
@@ [Return]     : TRUE if UART data have been received;
@@                FALSE if no UART data have been received
@@
@@ [Desc]       : Checks whether the UART interrupt occured is due to the
@@                fact that UART data have been received
@@
@@ [END]
******************************************************************************/

#define apd_UARTIsRxIntr(uart_num)      \
    apd_UARTIsBitSetInIntr(uart_num, APD_UARTINT_RXINT)

/******************************************************************************
@@
@@ [Name]       : apd_UARTIsTxIntr
@@
@@ [Summary]    : This function checks if the UART interrupt is due to the fact
@@                that UART data have been transmitted
@@
@@ [Argument]   : uart_num: Specify the UART channel number
@@                APD_UART_CH0 for channel 0
@@                APD_UART_CH1 for channel 1
@@                APD_UART_CH2 for channel 2 (For LH79531 only)
@@
@@ [Return]     : TRUE if UART data have been transmitted;
@@                FALSE if no UART data have been transmitted
@@
@@ [Desc]       : Checks whether the UART interrupt occured is due to the fact
@@                that UART data have been transmitted
@@
@@ [END]
******************************************************************************/

#define apd_UARTIsTxIntr(uart_num)      \
    apd_UARTIsBitSetInIntr(uart_num, APD_UARTINT_TXINT)

/******************************************************************************
@@
@@ [Name]       : apd_UARTIsErrIntr
@@
@@ [Summary]    : This function checks if the UART error interrupt is due to
@@                the fact that UART error has occurred
@@
@@ [Argument]   : uart_num: Specify the UART channel number
@@                APD_UART_CH0 for channel 0
@@                APD_UART_CH1 for channel 1
@@
@@ [Return]     : TRUE if UART error has occurred
@@                FALSE if no UART error has occurred
@@
@@ [Desc]       : Checks if the UART error interrupt occured
@@
@@ [END]
******************************************************************************/

#define apd_UARTIsErrIntr(uart_num)     \
    apd_UARTIsBitSetInIntr(uart_num, APD_UARTINT_ERRINT)


/*-------------------------- Global context - END --------------------------*/

#undef VISIBLE
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?