/* Enable or disable IrDA function on UART peripheral.  */
void UART_IrDACmd(LPC_UART_TypeDef *UARTx, FunctionalState NewState)
/* Enable or disable IrDA function on UART peripheral.  */
void UART_IrDACmd(LPC_UART_TypeDef *UARTx, FunctionalState NewState)
{
    if (NewState == ENABLE)
    {
        UARTx->ICR |= UART_ICR_IRDAEN;
    }
    else
    {
        UARTx->ICR &= (~UART_ICR_IRDAEN) & UART_ICR_BITMASK;
    }
}