39#if defined (CHIP_LPC177X_8X) || defined (CHIP_LPC407X_8X)
53 , interrupt(interrupt)
71#if defined (CHIP_LPC177X_8X) || defined (CHIP_LPC407X_8X)
84 std::min(0xff, configKERNEL_INTERRUPT_PRIORITY + 0x20));
92 Chip_UART_SetBaud(
base, 115200);
93 Chip_UART_ConfigData(
base, (UART_LCR_WLEN8 | UART_LCR_SBS_1BIT));
94 Chip_UART_SetupFIFOS(
base, (UART_FCR_FIFO_EN | UART_FCR_RX_RS |
95 UART_FCR_TX_RS | UART_FCR_TRG_LEV0));
96 Chip_UART_TXEnable(
base);
97 Chip_UART_IntEnable(
base, (UART_IER_RBRINT | UART_IER_RLSINT));
106 Chip_UART_IntDisable(
base, (UART_IER_RBRINT | UART_IER_RLSINT));
107 Chip_UART_TXDisable(
base);
108 Chip_UART_DeInit(
base);
115 if ((Chip_UART_GetIntsEnabled(
base) & UART_IER_THREINT) == 0)
120 Chip_UART_SendByte(
base, (uint8_t)data);
121 Chip_UART_IntEnable(
base, UART_IER_THREINT);
135 while (Chip_UART_ReadLineStatus(
base) & UART_LSR_RDR)
137 uint8_t data = Chip_UART_ReadByte(
base);
146 if (Chip_UART_GetIntsEnabled(
base) & UART_IER_THREINT)
151 while (Chip_UART_ReadLineStatus(
base) & UART_LSR_THRE)
156 Chip_UART_SendByte(
base, (uint8_t)data);
162 Chip_UART_IntDisable(
base, UART_IER_THREINT);
198#if defined (CHIP_LPC177X_8X) || defined (CHIP_LPC407X_8X)
void uart2_interrupt_handler(void)
UART2 interrupt handler.
void uart0_interrupt_handler(void)
UART0 interrupt handler.
void uart3_interrupt_handler(void)
UART3 interrupt handler.
void uart1_interrupt_handler(void)
UART1 interrupt handler.
void uart4_interrupt_handler(void)
UART4 interrupt handler.
void signal_condition()
Signal the wakeup condition.
void signal_condition_from_isr()
Signal the wakeup condition from an ISR context.
size_t get(T *buf, size_t items)
remove a number of items from the buffer.
size_t put(const T *buf, size_t items)
Insert a number of items to the buffer.
Specialization of Serial driver for LPC17xx and LPC40xx UART.
LpcUart()
Default constructor.
void disable() override
function to disable device
static LpcUart * instances[4]
Instance pointers help us get context from the interrupt handler(s)
LPC_USART_T * base
base address of this device
IRQn_Type interrupt
interrupt of this device
void tx_char() override
Try and transmit a message.
void enable() override
function to enable device
void interrupt_handler()
handle an interrupt.
Private data for a serial device.
DeviceBuffer< uint8_t > * rxBuf
receive buffer
DeviceBuffer< uint8_t > * txBuf
transmit buffer
unsigned int overrunCount
overrun count
#define HASSERT(x)
Checks that the value of expression x is true, else terminates the current process.