Functions
Collaboration diagram for USART_Exported_Functions:

Functions

void USART_ClearFlag (USART_TypeDef *USARTx, uint16_t USART_FLAG)
 Clears the USARTx's pending flags. More...
 
void USART_ClearITPendingBit (USART_TypeDef *USARTx, uint16_t USART_IT)
 Clears the USARTx's interrupt pending bits. More...
 
void USART_ClockInit (USART_TypeDef *USARTx, USART_ClockInitTypeDef *USART_ClockInitStruct)
 Initializes the USARTx peripheral Clock according to the specified parameters in the USART_ClockInitStruct . More...
 
void USART_ClockStructInit (USART_ClockInitTypeDef *USART_ClockInitStruct)
 Fills each USART_ClockInitStruct member with its default value. More...
 
void USART_Cmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the specified USART peripheral. More...
 
void USART_DeInit (USART_TypeDef *USARTx)
 Deinitializes the USARTx peripheral registers to their default reset values. More...
 
void USART_DMACmd (USART_TypeDef *USARTx, uint16_t USART_DMAReq, FunctionalState NewState)
 Enables or disables the USART's DMA interface. More...
 
FlagStatus USART_GetFlagStatus (USART_TypeDef *USARTx, uint16_t USART_FLAG)
 Checks whether the specified USART flag is set or not. More...
 
ITStatus USART_GetITStatus (USART_TypeDef *USARTx, uint16_t USART_IT)
 Checks whether the specified USART interrupt has occurred or not. More...
 
void USART_HalfDuplexCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's Half Duplex communication. More...
 
void USART_Init (USART_TypeDef *USARTx, USART_InitTypeDef *USART_InitStruct)
 Initializes the USARTx peripheral according to the specified parameters in the USART_InitStruct . More...
 
void USART_IrDACmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's IrDA interface. More...
 
void USART_IrDAConfig (USART_TypeDef *USARTx, uint16_t USART_IrDAMode)
 Configures the USART's IrDA interface. More...
 
void USART_ITConfig (USART_TypeDef *USARTx, uint16_t USART_IT, FunctionalState NewState)
 Enables or disables the specified USART interrupts. More...
 
void USART_LINBreakDetectLengthConfig (USART_TypeDef *USARTx, uint16_t USART_LINBreakDetectLength)
 Sets the USART LIN Break detection length. More...
 
void USART_LINCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's LIN mode. More...
 
void USART_OneBitMethodCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's one bit sampling method. More...
 
void USART_OverSampling8Cmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's 8x oversampling mode. More...
 
uint16_t USART_ReceiveData (USART_TypeDef *USARTx)
 Returns the most recent received data by the USARTx peripheral. More...
 
void USART_ReceiverWakeUpCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Determines if the USART is in mute mode or not. More...
 
void USART_SendBreak (USART_TypeDef *USARTx)
 Transmits break characters. More...
 
void USART_SendData (USART_TypeDef *USARTx, uint16_t Data)
 Transmits single data through the USARTx peripheral. More...
 
void USART_SetAddress (USART_TypeDef *USARTx, uint8_t USART_Address)
 Sets the address of the USART node. More...
 
void USART_SetGuardTime (USART_TypeDef *USARTx, uint8_t USART_GuardTime)
 Sets the specified USART guard time. More...
 
void USART_SetPrescaler (USART_TypeDef *USARTx, uint8_t USART_Prescaler)
 Sets the system clock prescaler. More...
 
void USART_SmartCardCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's Smart Card mode. More...
 
void USART_SmartCardNACKCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables NACK transmission. More...
 
void USART_StructInit (USART_InitTypeDef *USART_InitStruct)
 Fills each USART_InitStruct member with its default value. More...
 
void USART_WakeUpConfig (USART_TypeDef *USARTx, uint16_t USART_WakeUp)
 Selects the USART WakeUp method. More...
 

Detailed Description

Function Documentation

void USART_ClearFlag ( USART_TypeDef USARTx,
uint16_t  USART_FLAG 
)

Clears the USARTx's pending flags.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
USART_FLAGspecifies the flag to clear. This parameter can be any combination of the following values:
  • USART_FLAG_CTS: CTS Change flag (not available for UART4 and UART5).
  • USART_FLAG_LBD: LIN Break detection flag.
  • USART_FLAG_TC: Transmission Complete flag.
  • USART_FLAG_RXNE: Receive data register not empty flag.
Note
PE (Parity error), FE (Framing error), NE (Noise error), ORE (OverRun error) and IDLE (Idle line detected) flags are cleared by software sequence: a read operation to USART_SR register (USART_GetFlagStatus()) followed by a read operation to USART_DR register (USART_ReceiveData()).
RXNE flag can be also cleared by a read to the USART_DR register (USART_ReceiveData()).
TC flag can be also cleared by software sequence: a read operation to USART_SR register (USART_GetFlagStatus()) followed by a write operation to USART_DR register (USART_SendData()).
TXE flag is cleared only by a write to the USART_DR register (USART_SendData()).
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
USART_FLAGspecifies the flag to clear. This parameter can be any combination of the following values:
  • USART_FLAG_CTS: CTS Change flag (not available for UART4 and UART5).
  • USART_FLAG_LBD: LIN Break detection flag.
  • USART_FLAG_TC: Transmission Complete flag.
  • USART_FLAG_RXNE: Receive data register not empty flag.
Note
  • PE (Parity error), FE (Framing error), NE (Noise error), ORE (OverRun error) and IDLE (Idle line detected) flags are cleared by software sequence: a read operation to USART_SR register (USART_GetFlagStatus()) followed by a read operation to USART_DR register (USART_ReceiveData()).
  • RXNE flag can be also cleared by a read to the USART_DR register (USART_ReceiveData()).
  • TC flag can be also cleared by software sequence: a read operation to USART_SR register (USART_GetFlagStatus()) followed by a write operation to USART_DR register (USART_SendData()).
  • TXE flag is cleared only by a write to the USART_DR register (USART_SendData()).
Return values
None

Definition at line 1344 of file stm32f4xx_usart.c.

void USART_ClearITPendingBit ( USART_TypeDef USARTx,
uint16_t  USART_IT 
)

Clears the USARTx's interrupt pending bits.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
USART_ITspecifies the interrupt pending bit to clear. This parameter can be one of the following values:
  • USART_IT_CTS: CTS change interrupt (not available for UART4 and UART5)
  • USART_IT_LBD: LIN Break detection interrupt
  • USART_IT_TC: Transmission complete interrupt.
  • USART_IT_RXNE: Receive Data register not empty interrupt.
Note
PE (Parity error), FE (Framing error), NE (Noise error), ORE (OverRun error) and IDLE (Idle line detected) pending bits are cleared by software sequence: a read operation to USART_SR register (USART_GetITStatus()) followed by a read operation to USART_DR register (USART_ReceiveData()).
RXNE pending bit can be also cleared by a read to the USART_DR register (USART_ReceiveData()).
TC pending bit can be also cleared by software sequence: a read operation to USART_SR register (USART_GetITStatus()) followed by a write operation to USART_DR register (USART_SendData()).
TXE pending bit is cleared only by a write to the USART_DR register (USART_SendData()).
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
USART_ITspecifies the interrupt pending bit to clear. This parameter can be one of the following values:
  • USART_IT_CTS: CTS change interrupt (not available for UART4 and UART5)
  • USART_IT_LBD: LIN Break detection interrupt
  • USART_IT_TC: Transmission complete interrupt.
  • USART_IT_RXNE: Receive Data register not empty interrupt.
Note
  • PE (Parity error), FE (Framing error), NE (Noise error), ORE (OverRun error) and IDLE (Idle line detected) pending bits are cleared by software sequence: a read operation to USART_SR register (USART_GetITStatus()) followed by a read operation to USART_DR register (USART_ReceiveData()).
  • RXNE pending bit can be also cleared by a read to the USART_DR register (USART_ReceiveData()).
  • TC pending bit can be also cleared by software sequence: a read operation to USART_SR register (USART_GetITStatus()) followed by a write operation to USART_DR register (USART_SendData()).
  • TXE pending bit is cleared only by a write to the USART_DR register (USART_SendData()).
Return values
None

Definition at line 1452 of file stm32f4xx_usart.c.

void USART_ClockInit ( USART_TypeDef USARTx,
USART_ClockInitTypeDef USART_ClockInitStruct 
)

Initializes the USARTx peripheral Clock according to the specified parameters in the USART_ClockInitStruct .

Initializes the USARTx peripheral Clock according to the specified parameters in the USART_ClockInitStruct.

Parameters
USARTxwhere x can be 1, 2, 3 or 6 to select the USART peripheral.
USART_ClockInitStructpointer to a USART_ClockInitTypeDef structure that contains the configuration information for the specified USART peripheral.
Note
The Smart Card and Synchronous modes are not available for UART4 and UART5.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3.
USART_ClockInitStructpointer to a USART_ClockInitTypeDef structure that contains the configuration information for the specified USART peripheral.
Return values
NoneInitializes the USARTx peripheral Clock according to the specified parameters in the USART_ClockInitStruct.
Parameters
USARTxwhere x can be 1, 2, 3 to select the USART peripheral.
USART_ClockInitStructpointer to a USART_ClockInitTypeDef structure that contains the configuration information for the specified USART peripheral.
Note
The Smart Card and Synchronous modes are not available for UART4 and UART5.
Return values
None

Definition at line 379 of file stm32f4xx_usart.c.

void USART_ClockStructInit ( USART_ClockInitTypeDef USART_ClockInitStruct)

Fills each USART_ClockInitStruct member with its default value.

Parameters
USART_ClockInitStructpointer to a USART_ClockInitTypeDef structure which will be initialized.
Return values
None

Definition at line 410 of file stm32f4xx_usart.c.

void USART_Cmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the specified USART peripheral.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
NewStatenew state of the USARTx peripheral. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
NewStatenew state of the USARTx peripheral. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
NewStatenew state of the USARTx peripheral. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 427 of file stm32f4xx_usart.c.

void USART_DeInit ( USART_TypeDef USARTx)

Deinitializes the USARTx peripheral registers to their default reset values.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
Return values
None

Definition at line 187 of file stm32f4xx_usart.c.

void USART_DMACmd ( USART_TypeDef USARTx,
uint16_t  USART_DMAReq,
FunctionalState  NewState 
)

Enables or disables the USART's DMA interface.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
USART_DMAReqspecifies the DMA request. This parameter can be any combination of the following values:
  • USART_DMAReq_Tx: USART DMA transmit request
  • USART_DMAReq_Rx: USART DMA receive request
NewStatenew state of the DMA Request sources. This parameter can be: ENABLE or DISABLE.
Return values
NoneEnables or disables the USART's DMA interface.
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
USART_DMAReqspecifies the DMA request. This parameter can be any combination of the following values:
  • USART_DMAReq_Tx: USART DMA transmit request
  • USART_DMAReq_Rx: USART DMA receive request
NewStatenew state of the DMA Request sources. This parameter can be: ENABLE or DISABLE.
Note
The DMA mode is not available for UART5 except in the STM32 High density value line devices(STM32F10X_HD_VL).
Return values
None

Definition at line 1099 of file stm32f4xx_usart.c.

FlagStatus USART_GetFlagStatus ( USART_TypeDef USARTx,
uint16_t  USART_FLAG 
)

Checks whether the specified USART flag is set or not.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
USART_FLAGspecifies the flag to check. This parameter can be one of the following values:
  • USART_FLAG_CTS: CTS Change flag (not available for UART4 and UART5)
  • USART_FLAG_LBD: LIN Break detection flag
  • USART_FLAG_TXE: Transmit data register empty flag
  • USART_FLAG_TC: Transmission Complete flag
  • USART_FLAG_RXNE: Receive data register not empty flag
  • USART_FLAG_IDLE: Idle Line detection flag
  • USART_FLAG_ORE: OverRun Error flag
  • USART_FLAG_NE: Noise Error flag
  • USART_FLAG_FE: Framing Error flag
  • USART_FLAG_PE: Parity Error flag
Return values
Thenew state of USART_FLAG (SET or RESET).
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
USART_FLAGspecifies the flag to check. This parameter can be one of the following values:
  • USART_FLAG_CTS: CTS Change flag (not available for UART4 and UART5)
  • USART_FLAG_LBD: LIN Break detection flag
  • USART_FLAG_TXE: Transmit data register empty flag
  • USART_FLAG_TC: Transmission Complete flag
  • USART_FLAG_RXNE: Receive data register not empty flag
  • USART_FLAG_IDLE: Idle Line detection flag
  • USART_FLAG_ORE: OverRun Error flag
  • USART_FLAG_NE: Noise Error flag
  • USART_FLAG_FE: Framing Error flag
  • USART_FLAG_PE: Parity Error flag
Return values
Thenew state of USART_FLAG (SET or RESET).

Definition at line 1295 of file stm32f4xx_usart.c.

ITStatus USART_GetITStatus ( USART_TypeDef USARTx,
uint16_t  USART_IT 
)

Checks whether the specified USART interrupt has occurred or not.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
USART_ITspecifies the USART interrupt source to check. This parameter can be one of the following values:
  • USART_IT_CTS: CTS change interrupt (not available for UART4 and UART5)
  • USART_IT_LBD: LIN Break detection interrupt
  • USART_IT_TXE: Transmit Data Register empty interrupt
  • USART_IT_TC: Transmission complete interrupt
  • USART_IT_RXNE: Receive Data register not empty interrupt
  • USART_IT_IDLE: Idle line detection interrupt
  • USART_IT_ORE_RX : OverRun Error interrupt if the RXNEIE bit is set
  • USART_IT_ORE_ER : OverRun Error interrupt if the EIE bit is set
  • USART_IT_NE: Noise Error interrupt
  • USART_IT_FE: Framing Error interrupt
  • USART_IT_PE: Parity Error interrupt
Return values
Thenew state of USART_IT (SET or RESET).
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
USART_ITspecifies the USART interrupt source to check. This parameter can be one of the following values:
  • USART_IT_CTS: CTS change interrupt (not available for UART4 and UART5)
  • USART_IT_LBD: LIN Break detection interrupt
  • USART_IT_TXE: Tansmit Data Register empty interrupt
  • USART_IT_TC: Transmission complete interrupt
  • USART_IT_RXNE: Receive Data register not empty interrupt
  • USART_IT_IDLE: Idle line detection interrupt
  • USART_IT_ORE: OverRun Error interrupt
  • USART_IT_NE: Noise Error interrupt
  • USART_IT_FE: Framing Error interrupt
  • USART_IT_PE: Parity Error interrupt
Return values
Thenew state of USART_IT (SET or RESET).

Definition at line 1378 of file stm32f4xx_usart.c.

void USART_HalfDuplexCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's Half Duplex communication.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
NewStatenew state of the USART Communication. This parameter can be: ENABLE or DISABLE.
Return values
NoneEnables or disables the USART's Half Duplex communication.
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
NewStatenew state of the USART Communication. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
NewStatenew state of the USART Communication. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 836 of file stm32f4xx_usart.c.

void USART_Init ( USART_TypeDef USARTx,
USART_InitTypeDef USART_InitStruct 
)

Initializes the USARTx peripheral according to the specified parameters in the USART_InitStruct .

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
USART_InitStructpointer to a USART_InitTypeDef structure that contains the configuration information for the specified USART peripheral.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_InitStructpointer to a USART_InitTypeDef structure that contains the configuration information for the specified USART peripheral.
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
USART_InitStructpointer to a USART_InitTypeDef structure that contains the configuration information for the specified USART peripheral.
Return values
None

Definition at line 246 of file stm32f4xx_usart.c.

void USART_IrDACmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's IrDA interface.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
NewStatenew state of the IrDA mode. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
NewStatenew state of the IrDA mode. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
NewStatenew state of the IrDA mode. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 1053 of file stm32f4xx_usart.c.

void USART_IrDAConfig ( USART_TypeDef USARTx,
uint16_t  USART_IrDAMode 
)

Configures the USART's IrDA interface.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
USART_IrDAModespecifies the IrDA mode. This parameter can be one of the following values:
  • USART_IrDAMode_LowPower
  • USART_IrDAMode_Normal
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
USART_IrDAModespecifies the IrDA mode. This parameter can be one of the following values:
  • USART_IrDAMode_LowPower
  • USART_IrDAMode_Normal
Return values
None

Definition at line 1035 of file stm32f4xx_usart.c.

void USART_ITConfig ( USART_TypeDef USARTx,
uint16_t  USART_IT,
FunctionalState  NewState 
)

Enables or disables the specified USART interrupts.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
USART_ITspecifies the USART interrupt sources to be enabled or disabled. This parameter can be one of the following values:
  • USART_IT_CTS: CTS change interrupt
  • USART_IT_LBD: LIN Break detection interrupt
  • USART_IT_TXE: Transmit Data Register empty interrupt
  • USART_IT_TC: Transmission complete interrupt
  • USART_IT_RXNE: Receive Data register not empty interrupt
  • USART_IT_IDLE: Idle line detection interrupt
  • USART_IT_PE: Parity Error interrupt
  • USART_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
NewStatenew state of the specified USARTx interrupts. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
USART_ITspecifies the USART interrupt sources to be enabled or disabled. This parameter can be one of the following values:
  • USART_IT_CTS: CTS change interrupt (not available for UART4 and UART5)
  • USART_IT_LBD: LIN Break detection interrupt
  • USART_IT_TXE: Transmit Data Register empty interrupt
  • USART_IT_TC: Transmission complete interrupt
  • USART_IT_RXNE: Receive Data register not empty interrupt
  • USART_IT_IDLE: Idle line detection interrupt
  • USART_IT_PE: Parity Error interrupt
  • USART_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
NewStatenew state of the specified USARTx interrupts. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 1231 of file stm32f4xx_usart.c.

void USART_LINBreakDetectLengthConfig ( USART_TypeDef USARTx,
uint16_t  USART_LINBreakDetectLength 
)

Sets the USART LIN Break detection length.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
USART_LINBreakDetectLengthspecifies the LIN break detection length. This parameter can be one of the following values:
  • USART_LINBreakDetectLength_10b: 10-bit break detection
  • USART_LINBreakDetectLength_11b: 11-bit break detection
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
USART_LINBreakDetectLengthspecifies the LIN break detection length. This parameter can be one of the following values:
  • USART_LINBreakDetectLength_10b: 10-bit break detection
  • USART_LINBreakDetectLength_11b: 11-bit break detection
Return values
None

Definition at line 741 of file stm32f4xx_usart.c.

void USART_LINCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's LIN mode.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
NewStatenew state of the USART LIN mode. This parameter can be: ENABLE or DISABLE.
Return values
NoneEnables or disables the USART's LIN mode.
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
NewStatenew state of the USART LIN mode. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
NewStatenew state of the USART LIN mode. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 759 of file stm32f4xx_usart.c.

void USART_OneBitMethodCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's one bit sampling method.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
NewStatenew state of the USART one bit sampling method. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
NewStatenew state of the USART one bit sampling method. This parameter can be: ENABLE or DISABLE.
Note
This function has to be called before calling USART_Cmd() function.
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
NewStatenew state of the USART one bit sampling method. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 500 of file stm32f4xx_usart.c.

void USART_OverSampling8Cmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's 8x oversampling mode.

Note
This function has to be called before calling USART_Init() function in order to have correct baudrate Divider value.
Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
NewStatenew state of the USART 8x oversampling mode. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
NewStatenew state of the USART 8x oversampling mode. This parameter can be: ENABLE or DISABLE.
Note
This function has to be called before calling USART_Init() function in order to have correct baudrate Divider value.
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
NewStatenew state of the USART one bit sampling method. This parameter can be: ENABLE or DISABLE.
Note
This function has to be called before calling USART_Init() function in order to have correct baudrate Divider value.
Return values
None

Definition at line 474 of file stm32f4xx_usart.c.

uint16_t USART_ReceiveData ( USART_TypeDef USARTx)

Returns the most recent received data by the USARTx peripheral.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
Return values
Thereceived data.
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
Return values
Thereceived data.
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
Return values
Thereceived data.

Definition at line 573 of file stm32f4xx_usart.c.

void USART_ReceiverWakeUpCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Determines if the USART is in mute mode or not.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
NewStatenew state of the USART mute mode. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
NewStatenew state of the USART mute mode. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 645 of file stm32f4xx_usart.c.

void USART_SendBreak ( USART_TypeDef USARTx)

Transmits break characters.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
Return values
None

Definition at line 783 of file stm32f4xx_usart.c.

void USART_SendData ( USART_TypeDef USARTx,
uint16_t  Data 
)

Transmits single data through the USARTx peripheral.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
Datathe data to transmit.
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
Datathe data to transmit.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
Datathe data to transmit.
Return values
None

Definition at line 557 of file stm32f4xx_usart.c.

void USART_SetAddress ( USART_TypeDef USARTx,
uint8_t  USART_Address 
)

Sets the address of the USART node.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
USART_AddressIndicates the address of the USART node.
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
USART_AddressIndicates the address of the USART node.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_AddressIndicates the address of the USART node.
Return values
None

Definition at line 625 of file stm32f4xx_usart.c.

void USART_SetGuardTime ( USART_TypeDef USARTx,
uint8_t  USART_GuardTime 
)

Sets the specified USART guard time.

Parameters
USARTxwhere x can be 1, 2, 3 or 6 to select the USART or UART peripheral.
USART_GuardTimespecifies the guard time.
Return values
None
Parameters
USARTxwhere x can be 1, 2 or 3 to select the USART peripheral.
USART_GuardTimespecifies the guard time.
Note
The guard time bits are not available for UART4 and UART5.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3.
USART_GuardTimespecifies the guard time.
Return values
None

Definition at line 920 of file stm32f4xx_usart.c.

void USART_SetPrescaler ( USART_TypeDef USARTx,
uint8_t  USART_Prescaler 
)

Sets the system clock prescaler.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
USART_Prescalerspecifies the prescaler clock.
Note
The function is used for IrDA mode with UART4 and UART5.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_Prescalerspecifies the prescaler clock.
Note
This function has to be called before calling USART_Cmd() function.
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
USART_Prescalerspecifies the prescaler clock.
Note
The function is used for IrDA mode with UART4 and UART5.
Return values
None

Definition at line 453 of file stm32f4xx_usart.c.

void USART_SmartCardCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's Smart Card mode.

Parameters
USARTxwhere x can be 1, 2, 3 or 6 to select the USART or UART peripheral.
NewStatenew state of the Smart Card mode. This parameter can be: ENABLE or DISABLE.
Return values
NoneEnables or disables the USART's Smart Card mode.
Parameters
USARTxwhere x can be 1, 2 or 3 to select the USART peripheral.
NewStatenew state of the Smart Card mode. This parameter can be: ENABLE or DISABLE.
Note
The Smart Card mode is not available for UART4 and UART5.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3.
NewStatenew state of the Smart Card mode. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 939 of file stm32f4xx_usart.c.

void USART_SmartCardNACKCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables NACK transmission.

Parameters
USARTxwhere x can be 1, 2, 3 or 6 to select the USART or UART peripheral.
NewStatenew state of the NACK transmission. This parameter can be: ENABLE or DISABLE.
Return values
None
Parameters
USARTxwhere x can be 1, 2 or 3 to select the USART peripheral.
NewStatenew state of the NACK transmission. This parameter can be: ENABLE or DISABLE.
Note
The Smart Card mode is not available for UART4 and UART5.
Return values
None
Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3.
NewStatenew state of the NACK transmission. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 964 of file stm32f4xx_usart.c.

void USART_StructInit ( USART_InitTypeDef USART_InitStruct)

Fills each USART_InitStruct member with its default value.

Parameters
USART_InitStructpointer to a USART_InitTypeDef structure which will be initialized.
Return values
None

Definition at line 359 of file stm32f4xx_usart.c.

void USART_WakeUpConfig ( USART_TypeDef USARTx,
uint16_t  USART_WakeUp 
)

Selects the USART WakeUp method.

Parameters
USARTxwhere x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral.
USART_WakeUpspecifies the USART wakeup method. This parameter can be one of the following values:
  • USART_WakeUp_IdleLine: WakeUp by an idle line detection
  • USART_WakeUp_AddressMark: WakeUp by an address mark
Return values
None
Parameters
USARTxSelect the USART or the UART peripheral. This parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
USART_WakeUpspecifies the USART wakeup method. This parameter can be one of the following values:
  • USART_WakeUp_IdleLine: WakeUp by an idle line detection
  • USART_WakeUp_AddressMark: WakeUp by an address mark
Return values
None

Definition at line 672 of file stm32f4xx_usart.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:56