how to clear the serial port interrupt flag

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

how to clear the serial port interrupt flag

1,654件の閲覧回数
wyflsxy
Contributor II

hello all,

how to clear  the serial port interrupt flag?

I can clear the port interrupt flag by " PORT_HAL_ClearPortIntFlag(BOARD_SW_LLWU_BASE); "

but how can I clear the serial port interrupt flag?

0 件の賞賛
返信
1 返信

1,316件の閲覧回数
marek_neuzil
NXP Employee
NXP Employee

Hello,

The UART contains many status flags that can be cleared by different way. See a reference manual - UART device.

For example RDRF flag is cleare by the following way:

Receive Data Register Full Flag

RDRF is set when the number of datawords in the receive buffer is equal to or more than the number

indicated by RWFIFO[RXWATER]. A dataword that is in the process of being received is not included in

the count. To clear RDRF, read S1 when RDRF is set and then read D. ...

The KSDK 1.2.0 contains the following function for clearing flags (see the file KSDK_1.2.0\platform\hal\src\uart\fsl_uart_hal.c) but the function can clear several flags only (other flags are cleared by different ways):

/*FUNCTION**********************************************************************

*

* Function Name : UART_HAL_ClearStatusFlag

* Description   : Clear an individual and specific UART status flag.

* This function allows the user to clear an individual and specific UART

* status flag. Refer to structure definition uart_status_flag_t for list of

* status bits.

*

*END**************************************************************************/

uart_status_t UART_HAL_ClearStatusFlag(UART_Type * base, uart_status_flag_t statusFlag)

Best Regards,

Marek Neuzil

0 件の賞賛
返信