libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
usart_common_all.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define USART_PARITY_NONE   0x00
 
#define USART_PARITY_EVEN   USART_CR1_PCE
 
#define USART_PARITY_ODD   (USART_CR1_PS | USART_CR1_PCE)
 
#define USART_PARITY_MASK   (USART_CR1_PS | USART_CR1_PCE)
 
#define USART_MODE_RX   USART_CR1_RE
 
#define USART_MODE_TX   USART_CR1_TE
 
#define USART_MODE_TX_RX   (USART_CR1_RE | USART_CR1_TE)
 
#define USART_MODE_MASK   (USART_CR1_RE | USART_CR1_TE)
 
#define USART_STOPBITS_1   USART_CR2_STOPBITS_1 /* 1 stop bit */
 
#define USART_STOPBITS_0_5   USART_CR2_STOPBITS_0_5 /* .5 stop bit */
 
#define USART_STOPBITS_2   USART_CR2_STOPBITS_2 /* 2 stop bits */
 
#define USART_STOPBITS_1_5   USART_CR2_STOPBITS_1_5 /* 1.5 stop bit*/
 
#define USART_CR2_STOPBITS_1   (0x00 << 12) /* 1 stop bit */
 
#define USART_CR2_STOPBITS_0_5   (0x01 << 12) /* 0.5 stop bits */
 
#define USART_CR2_STOPBITS_2   (0x02 << 12) /* 2 stop bits */
 
#define USART_CR2_STOPBITS_1_5   (0x03 << 12) /* 1.5 stop bits */
 
#define USART_CR2_STOPBITS_MASK   (0x03 << 12)
 
#define USART_CR2_STOPBITS_SHIFT   12
 
#define USART_FLOWCONTROL_NONE   0x00
 
#define USART_FLOWCONTROL_RTS   USART_CR3_RTSE
 
#define USART_FLOWCONTROL_CTS   USART_CR3_CTSE
 
#define USART_FLOWCONTROL_RTS_CTS   (USART_CR3_RTSE | USART_CR3_CTSE)
 
#define USART_FLOWCONTROL_MASK   (USART_CR3_RTSE | USART_CR3_CTSE)
 

Functions

void usart_set_baudrate (uint32_t usart, uint32_t baud)
 USART Set Baudrate. More...
 
void usart_set_databits (uint32_t usart, uint32_t bits)
 USART Set Word Length. More...
 
void usart_set_stopbits (uint32_t usart, uint32_t stopbits)
 USART Set Stop Bit(s). More...
 
void usart_set_parity (uint32_t usart, uint32_t parity)
 USART Set Parity. More...
 
void usart_set_mode (uint32_t usart, uint32_t mode)
 USART Set Rx/Tx Mode. More...
 
void usart_set_flow_control (uint32_t usart, uint32_t flowcontrol)
 USART Set Hardware Flow Control. More...
 
void usart_enable (uint32_t usart)
 USART Enable. More...
 
void usart_disable (uint32_t usart)
 USART Disable. More...
 
void usart_send (uint32_t usart, uint16_t data)
 USART Send a Data Word. More...
 
uint16_t usart_recv (uint32_t usart)
 USART Read a Received Data Word. More...
 
void usart_wait_send_ready (uint32_t usart)
 USART Wait for Transmit Data Buffer Empty. More...
 
void usart_wait_recv_ready (uint32_t usart)
 USART Wait for Received Data Available. More...
 
void usart_send_blocking (uint32_t usart, uint16_t data)
 USART Send Data Word with Blocking. More...
 
uint16_t usart_recv_blocking (uint32_t usart)
 USART Read a Received Data Word with Blocking. More...
 
void usart_enable_rx_dma (uint32_t usart)
 USART Receiver DMA Enable. More...
 
void usart_disable_rx_dma (uint32_t usart)
 USART Receiver DMA Disable. More...
 
void usart_enable_tx_dma (uint32_t usart)
 USART Transmitter DMA Enable. More...
 
void usart_disable_tx_dma (uint32_t usart)
 USART Transmitter DMA Disable. More...
 
void usart_enable_rx_interrupt (uint32_t usart)
 USART Receiver Interrupt Enable. More...
 
void usart_disable_rx_interrupt (uint32_t usart)
 USART Receiver Interrupt Disable. More...
 
void usart_enable_tx_interrupt (uint32_t usart)
 USART Transmitter Interrupt Enable. More...
 
void usart_disable_tx_interrupt (uint32_t usart)
 USART Transmitter Interrupt Disable. More...
 
void usart_enable_tx_complete_interrupt (uint32_t usart)
 USART Transmission Complete Interrupt Enable. More...
 
void usart_disable_tx_complete_interrupt (uint32_t usart)
 USART Transmission Complete Interrupt Disable. More...
 
void usart_enable_idle_interrupt (uint32_t usart)
 USART Idle Interrupt Enable. More...
 
void usart_disable_idle_interrupt (uint32_t usart)
 USART Idle Interrupt Disable. More...
 
void usart_enable_error_interrupt (uint32_t usart)
 USART Error Interrupt Enable. More...
 
void usart_disable_error_interrupt (uint32_t usart)
 USART Error Interrupt Disable. More...
 
bool usart_get_flag (uint32_t usart, uint32_t flag)
 USART Read a Status Flag. More...