In the file fsl_usart.h for the SDK (2.2) for the LPC5460x device, there is a function:
USART_DisableInterrupts()
which is implemented like this in fsl_usart.h:
static inline void USART_DisableInterrupts(USART_Type *base, uint32_t mask)
{
base->FIFOINTENSET = ~(mask & 0xF);
}
I think that there is an error in that implementation. According to the UM for the LPC5460x, to disable one of the FIFO interrupts one must write a '1' to the corresponding bit in register FIFOINTENCLR. The above should not have any effect according to the UM!
In my view, the code should instead read:
static inline void USART_DisableInterrupts(USART_Type *base, uint32_t mask)
{
base->FIFOINTENCLR = mask & 0xF;
}
Isn't that correct, or am I mistaken ?
Similar error I think in line 9 below (file is fsl_usart.c):
void USART_TransferAbortReceive(USART_Type *base, usart_handle_t *handle)
{
assert(NULL != handle);
if (!handle->rxRingBuffer)
{
base->FIFOINTENSET &= ~USART_FIFOINTENSET_RXLVL_MASK;
base->FIFOCFG |= USART_FIFOCFG_EMPTYRX_MASK;
}
handle->rxDataSize = 0U;
handle->rxState = kUSART_RxIdle;
}