126 uint32_t div = (((clock * 8) / baud) + 1) / 2;
141 uint32_t reg32, bitint32_t;
144 bitint32_t = (databits - 5) << 5;
149 reg32 &= ~UART_LCRH_WLEN_MASK;
uint32_t rcc_get_system_clock_frequency(void)
Get the system clock frequency.
void uart_disable(uint32_t uart)
Disable the UART.
void uart_set_baudrate(uint32_t uart, uint32_t baud)
Set UART baudrate.
void uart_set_parity(uint32_t uart, enum uart_parity parity)
Set UART parity.
void uart_clock_from_sysclk(uint32_t uart)
Clock the UART module from the system clock.
void uart_clock_from_piosc(uint32_t uart)
Clock the UART module from the internal oscillator.
void uart_set_flow_control(uint32_t uart, enum uart_flowctl flow)
Set the flow control scheme.
void uart_enable(uint32_t uart)
Enable the UART.
void uart_set_databits(uint32_t uart, uint8_t databits)
Set UART databits.
void uart_set_stopbits(uint32_t uart, uint8_t stopbits)
Set UART stopbits.
#define UART_DR(uart_base)
#define UART_DMACTL_TXDMAE
Transmit DMA enable.
#define UART_CTL_CTSEN
Enable Clear To Send.
#define UART_DMACTL(uart_base)
#define UART_FR_TXFF
Tx FIFO full.
#define UART_ICR(uart_base)
#define UART_LCRH_STP2
Two stop bits select.
#define UART_CTL_UARTEN
UART enable.
#define UART_LCRH_SPS
Stick parity select.
#define UART_CTL(uart_base)
#define UART_CTL_RXE
Rx Enable.
#define UART_IBRD(uart_base)
#define UART_CC(uart_base)
#define UART_DR_DATA_MASK
Data transmitted or received.
#define UART_CTL_RTSEN
Enable Request To Send.
#define UART_FR_RXFE
Rx FIFO empty.
#define UART_IFLS(uart_base)
uart_fifo_rx_trigger_level
UART RX FIFO interrupt trigger levels.
#define UART_FBRD(uart_base)
#define UART_LCRH_FEN
Enable FIFOs.
#define UART_CTL_TXE
Tx Enable.
#define UART_DMACTL_RXDMAE
Receive DMA enable.
uart_interrupt_flag
UART interrupt masks.
#define UART_LCRH_PEN
Parity enable.
#define UART_IM(uart_base)
uart_fifo_tx_trigger_level
UART TX FIFO interrupt trigger levels.
#define UART_FR(uart_base)
#define UART_LCRH(uart_base)
#define UART_CC_CS_SYSCLK
#define UART_LCRH_EPS
Even parity select.
void uart_disable_rx_dma(uint32_t uart)
Disable the UART Receive DMA.
void uart_enable_rx_dma(uint32_t uart)
Enable the UART Receive DMA.
void uart_enable_tx_dma(uint32_t uart)
Enable the UART Transmit DMA.
void uart_disable_tx_dma(uint32_t uart)
Disable the UART Transmit DMA.
void uart_enable_fifo(uint32_t uart)
Enable FIFO for the UART.
void uart_set_fifo_trigger_levels(uint32_t uart, enum uart_fifo_rx_trigger_level rx_level, enum uart_fifo_tx_trigger_level tx_level)
Set the FIFO trigger levels.
void uart_disable_fifo(uint32_t uart)
Disable FIFO for the UART.
void uart_enable_interrupts(uint32_t uart, enum uart_interrupt_flag ints)
Enable Specific UART Interrupts.
void uart_disable_tx_interrupt(uint32_t uart)
Disable the UART Transmit Interrupt.
void uart_disable_interrupts(uint32_t uart, enum uart_interrupt_flag ints)
Enable Specific UART Interrupts.
void uart_disable_rx_interrupt(uint32_t uart)
Disable the UART Receive Interrupt.
void uart_enable_tx_interrupt(uint32_t uart)
Enable the UART Transmit Interrupt.
void uart_clear_interrupt_flag(uint32_t uart, enum uart_interrupt_flag ints)
Mark interrupt as serviced.
void uart_enable_rx_interrupt(uint32_t uart)
Enable the UART Receive Interrupt.
void uart_send(uint32_t uart, uint16_t data)
UART Send a Data Word.
void uart_send_blocking(uint32_t uart, uint16_t data)
UART Send Data Word with Blocking.
void uart_wait_recv_ready(uint32_t uart)
UART Wait for Received Data Available.
uint16_t uart_recv(uint32_t uart)
UART Read a Received Data Word.
uint16_t uart_recv_blocking(uint32_t uart)
UART Read a Received Data Word with Blocking.
void uart_wait_send_ready(uint32_t uart)
UART Wait for Transmit Data Buffer Not Full.