GPS Device
Loading...
Searching...
No Matches

Configuration enumerations and structures for the USART driver. More...

Collaboration diagram for USART Types:

Classes

struct  USART_CFG_ts
 Configuration structure for initializing a USART peripheral. More...

Macros

#define USART_NAME_LEN   6
 Length of the null-terminated USART peripheral name string (e.g. "USART1").

Enumerations

enum  USART_MODE_te { USART_MODE_ASYNC , USART_MODE_SYNC }
 USART operating mode. More...
enum  USART_BAUD_RATE_te {
  USART_BAUD_RATE_1200 = 1200 , USART_BAUD_RATE_2400 = 2400 , USART_BAUD_RATE_9600 = 9600 , USART_BAUD_RATE_19200 = 19200 ,
  USART_BAUD_RATE_38400 = 38400 , USART_BAUD_RATE_57600 = 57600 , USART_BAUD_RATE_115200 = 115200 , USART_BAUD_RATE_230400 = 230400 ,
  USART_BAUD_RATE_460800 = 460800 , USART_BAUD_RATE_921600 = 921600 , USART_BAUD_RATE_2000000 = 2000000 , USART_BAUD_RATE_3000000 = 3000000
}
 USART baud rate in bits per second. More...
enum  USART_PARITY_te { USART_PARITY_DISABLED , USART_PARITY_EVEN , USART_PARITY_ODD }
 USART parity bit configuration. More...
enum  USART_FRAME_DATA_BITS_te { USART_FRAME_DATA_BITS_8 , USART_FRAME_DATA_BITS_9 }
 USART data word length. More...
enum  USART_OVERSAMPLING_te { USART_OVERSAMPLING_16 , USART_OVERSAMPLING_8 }
 USART oversampling ratio. More...
enum  USART_FRAME_STOP_BITS_te { USART_FRAME_STOP_BITS_1 , USART_FRAME_STOP_BITS_0_5 , USART_FRAME_STOP_BITS_2 , USART_FRAME_STOP_BITS_1_5 }
 USART number of stop bits. More...
enum  USART_HW_FLOW_CONTROL_te { USART_HW_FLOW_CONTROL_DISABLED , USART_HW_FLOW_CONTROL_ENABLED }
 USART hardware flow control (RTS/CTS). More...
enum  USART_SAMPLE_BIT_te { USART_SAMPLE_BIT_3 , USART_SAMPLE_BIT_1 }
 USART receiver sample bit method. More...
enum  USART_INTERRUPT_EN_te { USART_INTERRUPT_EN_FALSE , USART_INTERRUPT_EN_TRUE }
 USART RXNE interrupt enable configuration. More...

Detailed Description

Configuration enumerations and structures for the USART driver.

Macro Definition Documentation

◆ USART_NAME_LEN

#define USART_NAME_LEN   6

Length of the null-terminated USART peripheral name string (e.g. "USART1").

Definition at line 53 of file stm32f401re_usart.h.

Enumeration Type Documentation

◆ USART_MODE_te

USART operating mode.

Note
Synchronous mode (USART_MODE_SYNC) is declared but not yet implemented.
Enumerator
USART_MODE_ASYNC 

Asynchronous mode (standard UART).

USART_MODE_SYNC 

Synchronous mode (not yet implemented).

Definition at line 60 of file stm32f401re_usart.h.

60 {
USART_MODE_te
USART operating mode.
@ USART_MODE_ASYNC
@ USART_MODE_SYNC

◆ USART_BAUD_RATE_te

USART baud rate in bits per second.

The BRR register value is computed automatically from the peripheral clock during usart_init. USART1 and USART6 use APB2; USART2 uses APB1.

Definition at line 72 of file stm32f401re_usart.h.

72 {
73 USART_BAUD_RATE_1200 = 1200,
74 USART_BAUD_RATE_2400 = 2400,
75 USART_BAUD_RATE_9600 = 9600,
76 USART_BAUD_RATE_19200 = 19200,
77 USART_BAUD_RATE_38400 = 38400,
78 USART_BAUD_RATE_57600 = 57600,
79 USART_BAUD_RATE_115200 = 115200,
80 USART_BAUD_RATE_230400 = 230400,
81 USART_BAUD_RATE_460800 = 460800,
82 USART_BAUD_RATE_921600 = 921600,
83 USART_BAUD_RATE_2000000 = 2000000,
84 USART_BAUD_RATE_3000000 = 3000000
USART_BAUD_RATE_te
USART baud rate in bits per second.

◆ USART_PARITY_te

USART parity bit configuration.

Enumerator
USART_PARITY_DISABLED 

No parity bit.

USART_PARITY_EVEN 

Even parity.

USART_PARITY_ODD 

Odd parity.

Definition at line 90 of file stm32f401re_usart.h.

90 {
USART_PARITY_te
USART parity bit configuration.
@ USART_PARITY_ODD
@ USART_PARITY_DISABLED
@ USART_PARITY_EVEN

◆ USART_FRAME_DATA_BITS_te

USART data word length.

Enumerator
USART_FRAME_DATA_BITS_8 

8-bit data word (standard).

USART_FRAME_DATA_BITS_9 

9-bit data word.

Definition at line 99 of file stm32f401re_usart.h.

99 {
USART_FRAME_DATA_BITS_te
USART data word length.
@ USART_FRAME_DATA_BITS_8
@ USART_FRAME_DATA_BITS_9

◆ USART_OVERSAMPLING_te

USART oversampling ratio.

Oversampling by 16 provides better noise immunity; oversampling by 8 allows higher baud rates at a given peripheral clock frequency.

Enumerator
USART_OVERSAMPLING_16 

Oversample by 16 (OVER8 = 0). Better noise immunity.

USART_OVERSAMPLING_8 

Oversample by 8 (OVER8 = 1). Allows higher baud rates.

Definition at line 111 of file stm32f401re_usart.h.

111 {
USART_OVERSAMPLING_te
USART oversampling ratio.
@ USART_OVERSAMPLING_16
@ USART_OVERSAMPLING_8

◆ USART_FRAME_STOP_BITS_te

USART number of stop bits.

Enumerator
USART_FRAME_STOP_BITS_1 

1 stop bit (standard).

USART_FRAME_STOP_BITS_0_5 

0.5 stop bits (smartcard mode).

USART_FRAME_STOP_BITS_2 

2 stop bits.

USART_FRAME_STOP_BITS_1_5 

1.5 stop bits (smartcard mode).

Definition at line 119 of file stm32f401re_usart.h.

119 {
USART_FRAME_STOP_BITS_te
USART number of stop bits.
@ USART_FRAME_STOP_BITS_1_5
@ USART_FRAME_STOP_BITS_1
@ USART_FRAME_STOP_BITS_0_5
@ USART_FRAME_STOP_BITS_2

◆ USART_HW_FLOW_CONTROL_te

USART hardware flow control (RTS/CTS).

Enumerator
USART_HW_FLOW_CONTROL_DISABLED 

No hardware flow control.

USART_HW_FLOW_CONTROL_ENABLED 

RTS and CTS hardware flow control enabled.

Definition at line 129 of file stm32f401re_usart.h.

129 {
USART_HW_FLOW_CONTROL_te
USART hardware flow control (RTS/CTS).
@ USART_HW_FLOW_CONTROL_ENABLED
@ USART_HW_FLOW_CONTROL_DISABLED

◆ USART_SAMPLE_BIT_te

USART receiver sample bit method.

Enumerator
USART_SAMPLE_BIT_3 

Three-sample bit method (majority vote, better noise immunity).

USART_SAMPLE_BIT_1 

One-sample bit method (faster, less noise tolerant).

Definition at line 137 of file stm32f401re_usart.h.

137 {
USART_SAMPLE_BIT_te
USART receiver sample bit method.
@ USART_SAMPLE_BIT_3
@ USART_SAMPLE_BIT_1

◆ USART_INTERRUPT_EN_te

USART RXNE interrupt enable configuration.

Enumerator
USART_INTERRUPT_EN_FALSE 

RXNE interrupt disabled; use polling via usart_receive.

USART_INTERRUPT_EN_TRUE 

RXNE interrupt enabled; received bytes delivered via callback.

Definition at line 145 of file stm32f401re_usart.h.

145 {
USART_INTERRUPT_EN_te
USART RXNE interrupt enable configuration.
@ USART_INTERRUPT_EN_TRUE
@ USART_INTERRUPT_EN_FALSE