GPS Device
Loading...
Searching...
No Matches
USART_CFG_ts Struct Reference

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

#include <stm32f401re_usart.h>

Collaboration diagram for USART_CFG_ts:

Public Attributes

USART_REGDEF_tsinstance
USART_MODE_te mode
USART_BAUD_RATE_te baud_rate
USART_PARITY_te parity
USART_FRAME_DATA_BITS_te frame_data_bits
USART_OVERSAMPLING_te oversampling
USART_FRAME_STOP_BITS_te frame_stop_bits
USART_HW_FLOW_CONTROL_te hw_flow_control
USART_SAMPLE_BIT_te sample_bit
USART_INTERRUPT_EN_te interrupt_en

Detailed Description

Configuration structure for initializing a USART peripheral.

Passed to usart_init. It is recommended to zero-initialize this structure before use. Default values when zero-initialized:

  • Mode: asynchronous, baud rate: 1200, parity: disabled
  • Data: 8-bit, oversampling: ×16, stop bits: 1
  • HW flow control: disabled, sample: 3-bit, interrupt: disabled

Definition at line 160 of file stm32f401re_usart.h.

Member Data Documentation

◆ instance

USART_REGDEF_ts* USART_CFG_ts::instance

Pointer to the USART peripheral instance (USART1, USART2, or USART6).

Definition at line 162 of file stm32f401re_usart.h.

◆ mode

USART_MODE_te USART_CFG_ts::mode

Operating mode.

Definition at line 165 of file stm32f401re_usart.h.

◆ baud_rate

USART_BAUD_RATE_te USART_CFG_ts::baud_rate

Baud rate in bits per second.

Definition at line 168 of file stm32f401re_usart.h.

◆ parity

USART_PARITY_te USART_CFG_ts::parity

Parity bit configuration.

Definition at line 171 of file stm32f401re_usart.h.

◆ frame_data_bits

USART_FRAME_DATA_BITS_te USART_CFG_ts::frame_data_bits

Data word length.

Definition at line 174 of file stm32f401re_usart.h.

◆ oversampling

USART_OVERSAMPLING_te USART_CFG_ts::oversampling

Oversampling ratio (affects BRR computation).

Definition at line 177 of file stm32f401re_usart.h.

◆ frame_stop_bits

USART_FRAME_STOP_BITS_te USART_CFG_ts::frame_stop_bits

Number of stop bits.

Definition at line 180 of file stm32f401re_usart.h.

◆ hw_flow_control

USART_HW_FLOW_CONTROL_te USART_CFG_ts::hw_flow_control

Hardware flow control (RTS/CTS).

Definition at line 183 of file stm32f401re_usart.h.

◆ sample_bit

USART_SAMPLE_BIT_te USART_CFG_ts::sample_bit

Receiver sample bit method.

Definition at line 186 of file stm32f401re_usart.h.

◆ interrupt_en

USART_INTERRUPT_EN_te USART_CFG_ts::interrupt_en

Whether to enable the RXNE interrupt and configure the NVIC.

Definition at line 189 of file stm32f401re_usart.h.


The documentation for this struct was generated from the following file: