I am working on UART in which i want Interrupt to be invoke after 8 bytes of data is received in FIFO. How to read this FIFO after interrupt is generated.
Hi BALWANT BISHNOI.
1. Interrupt is invoked after 8 bytes of data is received in FIFO.
You can configure this register:
2. How to read this FIFO after interrupt is generated.
You can read it like this:
/* Read data through the UART peripheral (non-blocking) */
int Chip_UART_Read(LPC_USART_T *pUART, void *data, int numBytes)
{
int readBytes = 0;
uint8_t *p8 = (uint8_t *) data;
/* Send until the transmit FIFO is full or out of bytes */
while ((readBytes < numBytes) &&
((Chip_UART_ReadLineStatus(pUART) & UART_LSR_RDR) != 0)) {
*p8 = Chip_UART_ReadByte(pUART);
p8++;
readBytes++;
}
return readBytes;
}
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------