libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
usart.c File Reference
Include dependency graph for usart.c:

Go to the source code of this file.

Functions

uint32_t usart_set_baudrate (uint32_t usart, uint32_t baud)
 USART Set Baudrate The baud rate is computed assuming a peripheral clock of 150MHz. More...
 
void usart_configure_lcr (uint32_t usart, uint8_t data_bits, uint8_t stop_bits, uint8_t parity)
 USART Configure Line Control Register This register sets the data bits, stop bits, and parity. More...
 
void usart_break_enable (uint32_t usart)
 Enable Break Control Enables break control bit that forces TX pin to logic low. More...
 
void usart_break_disable (uint32_t usart)
 Disable Break Control Disables break control bit that forces TX pin to logic low. More...
 
void usart_enhanced_enable (uint32_t usart)
 Enable Enhanced Mode Enable enhanced mode to generate interrupts when FIFO thresholds in FCR are reached. More...
 
void usart_enhanced_disable (uint32_t usart)
 Disable Enhanced Mode Disable enhanced mode to generate interrupts when FIFO thresholds in FCR are reached. More...
 
void usart_fifo_enable (uint32_t usart)
 Enable FIFOs Enable both TX and RX FIFOs. More...
 
void usart_fifo_disable (uint32_t usart)
 Disable FIFOs Disable both TX and RX FIFOs. More...
 
void usart_set_fifo_depth (uint32_t usart, uint8_t tx_depth, uint8_t rx_depth)
 Set the TX and RX FIFO depth. More...
 
void usart_send (uint32_t usart, uint8_t data)
 Write byte to TX FIFO. More...
 
uint8_t usart_recv (uint32_t usart)
 Read byte from the RX FIFO. More...
 
void usart_enable_rx_interrupt (uint32_t usart)
 Enable RX Interrupts Enable both the Receive Data Available and Character Timeout interrupts. More...
 
void usart_disable_rx_interrupt (uint32_t usart)
 Disable RX Interrupts Disable both the Receive Data Available and Character Timeout interrupts. More...
 
void usart_enable_tx_interrupt (uint32_t usart)
 Enable TX Interrupt Enable the TX Holding Register Empty interrupt. More...
 
void usart_disable_tx_interrupt (uint32_t usart)
 Disable TX Interrupt Disable the TX Holding Register Empty interrupt. More...
 
void usart_enable_rls_interrupt (uint32_t usart)
 Enable RX Line Status Interrupt Enable the RX Line Status interrupt. More...
 
void usart_disable_rls_interrupt (uint32_t usart)
 Disable RX Line Status Interrupt Disable the RX Line Status interrupt. More...
 
void usart_clear_tx_fifo (uint32_t usart)
 Clear the TX FIFO Clears the TX FIFO. More...
 
void usart_clear_rx_fifo (uint32_t usart)
 Clear the RX FIFO Clears the RX FIFO. More...