Universal synchronous asynchronous receiver
transmitter (USART)
ï€ Specifies wether the hardware flow control mode is enabled or disabled. This
parameter can be a value of USART_Hardware_Flow_Control
23.1.3 USART_ClockInitTypeDef
USART_ClockInitTypeDef is defined in the stm32f30x_usart.h
Data Fields
ï‚· uint32_t USART_Clock
ï‚· uint32_t USART_CPOL
ï‚· uint32_t USART_CPHA
ï‚· uint32_t USART_LastBit
Field Documentation
ï‚· uint32_t USART_ClockInitTypeDef::USART_Clock
ï€ Specifies whether the USART clock is enabled or disabled. This parameter can
be a value of USART_Clock
ï‚· uint32_t USART_ClockInitTypeDef::USART_CPOL
ï€ Specifies the steady state of the serial clock. This parameter can be a value of
USART_Clock_Polarity
ï‚· uint32_t USART_ClockInitTypeDef::USART_CPHA
ï€ Specifies the clock transition on which the bit capture is made. This parameter
can be a value of USART_Clock_Phase
ï‚· uint32_t USART_ClockInitTypeDef::USART_LastBit
ï€ Specifies whether the clock pulse corresponding to the last transmitted data bit
(MSB) has to be output on the SCLK pin in synchronous mode. This parameter
can be a value of USART_Last_Bit
23.2 USART Firmware driver API description
The following section lists the various functions of the USART library.
23.2.1 How to use this driver
1. Enable peripheral clock using
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE) function for
USART1 or using RCC_APB1PeriphClockCmd(RCC_APB1Periph_USARTx,
ENABLE) function for USART2, USART3, UART4 and UART5.
2. According to the USART mode, enable the GPIO clocks using
RCC_AHBPeriphClockCmd() function. (The I/O can be TX, RX, CTS, or and SCLK).
3. Peripheral's alternate function:
ï€ Connect the pin to the desired peripherals' Alternate Function (AF) using
GPIO_PinAFConfig() function.