Modules | Classes | Macros | Functions

USART driver modules. More...

Collaboration diagram for USART:

Modules

 USART_Exported_Constants
 
 USART_Private_Functions
 
 USART_Exported_Types
 
 USART_Exported_Macros
 
 USART_Exported_Functions
 
 USART_Private_TypesDefinitions
 
 USART_Private_Defines
 
 USART_Private_Macros
 
 USART_Private_Variables
 
 USART_Private_FunctionPrototypes
 

Classes

struct  USART_ClockInitTypeDef
 USART Clock Init Structure definition. More...
 
struct  USART_InitTypeDef
 USART Init Structure definition. More...
 

Macros

#define CR1_CLEAR_MASK
 
#define CR1_CLEAR_MASK
 
#define CR2_CLOCK_CLEAR_MASK
 
#define CR2_CLOCK_CLEAR_MASK
 
#define CR3_CLEAR_MASK   ((uint32_t)(USART_CR3_RTSE | USART_CR3_CTSE))
 
#define CR3_CLEAR_MASK   ((uint16_t)(USART_CR3_RTSE | USART_CR3_CTSE))
 
#define IT_MASK   ((uint32_t)0x000000FF)
 
#define IT_MASK   ((uint16_t)0x001F)
 

Functions

void USART_AddressDetectionConfig (USART_TypeDef *USARTx, uint32_t USART_AddressLength)
 Configure the the USART Address detection length. More...
 
void USART_AutoBaudRateCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the Auto Baud Rate. More...
 
void USART_AutoBaudRateConfig (USART_TypeDef *USARTx, uint32_t USART_AutoBaudRate)
 Selects the USART auto baud rate method. More...
 
void USART_ClearFlag (USART_TypeDef *USARTx, uint16_t USART_FLAG)
 Clears the USARTx's pending flags. More...
 
void USART_ClearFlag (USART_TypeDef *USARTx, uint32_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_ClearITPendingBit (USART_TypeDef *USARTx, uint32_t USART_IT)
 Clears the USARTx's interrupt pending bits. More...
 
void USART_DataInvCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the binary data inversion. More...
 
void USART_DECmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's DE functionality. More...
 
void USART_DEPolarityConfig (USART_TypeDef *USARTx, uint32_t USART_DEPolarity)
 Configures the USART's DE polarity. More...
 
void USART_DirectionModeCmd (USART_TypeDef *USARTx, uint32_t USART_DirectionMode, FunctionalState NewState)
 Enables or disables the USART's transmitter or receiver. More...
 
void USART_DMACmd (USART_TypeDef *USARTx, uint16_t USART_DMAReq, FunctionalState NewState)
 Enables or disables the USART's DMA interface. More...
 
void USART_DMACmd (USART_TypeDef *USARTx, uint32_t USART_DMAReq, FunctionalState NewState)
 Enables or disables the USART's DMA interface. More...
 
void USART_DMAReceptionErrorConfig (USART_TypeDef *USARTx, uint32_t USART_DMAOnError)
 Enables or disables the USART's DMA interface when reception error occurs. More...
 
FlagStatus USART_GetFlagStatus (USART_TypeDef *USARTx, uint16_t USART_FLAG)
 Checks whether the specified USART flag is set or not. More...
 
FlagStatus USART_GetFlagStatus (USART_TypeDef *USARTx, uint32_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...
 
ITStatus USART_GetITStatus (USART_TypeDef *USARTx, uint32_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_InvPinCmd (USART_TypeDef *USARTx, uint32_t USART_InvPin, FunctionalState NewState)
 Enables or disables the Pin(s) active level inversion. 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_IrDAConfig (USART_TypeDef *USARTx, uint32_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_ITConfig (USART_TypeDef *USARTx, uint32_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_LINBreakDetectLengthConfig (USART_TypeDef *USARTx, uint32_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_MSBFirstCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's most significant bit first transmitted/received following the start bit. More...
 
void USART_MuteModeCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's mute mode. More...
 
void USART_MuteModeWakeUpConfig (USART_TypeDef *USARTx, uint32_t USART_WakeUp)
 Selects the USART WakeUp method from mute mode. More...
 
void USART_OverrunDetectionConfig (USART_TypeDef *USARTx, uint32_t USART_OVRDetection)
 Enables or disables the USART's Overrun detection. More...
 
uint16_t USART_ReceiveData (USART_TypeDef *USARTx)
 Returns the most recent received data by the USARTx peripheral. More...
 
void USART_ReceiverTimeOutCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the receiver Time Out feature. More...
 
void USART_ReceiverWakeUpCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Determines if the USART is in mute mode or not. More...
 
void USART_RequestCmd (USART_TypeDef *USARTx, uint32_t USART_Request, FunctionalState NewState)
 Enables the specified USART's Request. 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_SetAutoRetryCount (USART_TypeDef *USARTx, uint8_t USART_AutoCount)
 Sets the Smart Card number of retries in transmit and receive. More...
 
void USART_SetBlockLength (USART_TypeDef *USARTx, uint8_t USART_BlockLength)
 Sets the Smart Card Block length. More...
 
void USART_SetDEAssertionTime (USART_TypeDef *USARTx, uint32_t USART_DEAssertionTime)
 Sets the specified RS485 DE assertion time. More...
 
void USART_SetDEDeassertionTime (USART_TypeDef *USARTx, uint32_t USART_DEDeassertionTime)
 Sets the specified RS485 DE deassertion time. More...
 
void USART_SetGuardTime (USART_TypeDef *USARTx, uint8_t USART_GuardTime)
 Sets the specified USART guard time. More...
 
void USART_SetReceiverTimeOut (USART_TypeDef *USARTx, uint32_t USART_ReceiverTimeOut)
 Sets the receiver Time Out value. 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_STOPModeCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the specified USART peripheral in STOP Mode. More...
 
void USART_StopModeWakeUpSourceConfig (USART_TypeDef *USARTx, uint32_t USART_WakeUpSource)
 Selects the USART WakeUp method form stop mode. More...
 
void USART_SWAPPinCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the swap Tx/Rx pins. More...
 
void USART_WakeUpConfig (USART_TypeDef *USARTx, uint16_t USART_WakeUp)
 Selects the USART WakeUp method. More...
 

Detailed Description

USART driver modules.

Macro Definition Documentation

#define CR1_CLEAR_MASK
Value:
((uint32_t)(USART_CR1_M | USART_CR1_PCE | \
#define USART_CR1_TE
Definition: stm32f4xx.h:10831
#define USART_CR1_PS
Definition: stm32f4xx.h:10837
#define USART_CR1_PCE
Definition: stm32f4xx.h:10838
#define USART_CR1_RE
Definition: stm32f4xx.h:10830
#define USART_CR1_M
Definition: stm32f4xx.h:10840

< USART CR1 register clear Mask ((~(uint32_t)0xFFFFE6F3)) USART CR2 register clock bits clear Mask ((~(uint32_t)0xFFFFF0FF))

Definition at line 97 of file stm32f30x_usart.c.

#define CR1_CLEAR_MASK
Value:
((uint16_t)(USART_CR1_M | USART_CR1_PCE | \
#define USART_CR1_TE
Definition: stm32f4xx.h:10831
#define USART_CR1_PS
Definition: stm32f4xx.h:10837
#define USART_CR1_PCE
Definition: stm32f4xx.h:10838
#define USART_CR1_RE
Definition: stm32f4xx.h:10830
#define USART_CR1_M
Definition: stm32f4xx.h:10840

< USART CR1 register clear Mask ((~(uint16_t)0xE9F3)) USART CR2 register clock bits clear Mask ((~(uint16_t)0xF0FF))

Definition at line 108 of file stm32f4xx_usart.c.

#define CR2_CLOCK_CLEAR_MASK
Value:
#define USART_CR2_LBCL
Definition: stm32f4xx.h:10848
#define USART_CR2_CLKEN
Definition: stm32f4xx.h:10851
#define USART_CR2_CPOL
Definition: stm32f4xx.h:10850
#define USART_CR2_CPHA
Definition: stm32f4xx.h:10849

USART CR3 register clear Mask ((~(uint32_t)0xFFFFFCFF))

Definition at line 102 of file stm32f30x_usart.c.

#define CR2_CLOCK_CLEAR_MASK
Value:
#define USART_CR2_LBCL
Definition: stm32f4xx.h:10848
#define USART_CR2_CLKEN
Definition: stm32f4xx.h:10851
#define USART_CR2_CPOL
Definition: stm32f4xx.h:10850
#define USART_CR2_CPHA
Definition: stm32f4xx.h:10849

USART CR3 register clear Mask ((~(uint16_t)0xFCFF))

Definition at line 113 of file stm32f4xx_usart.c.

#define CR3_CLEAR_MASK   ((uint32_t)(USART_CR3_RTSE | USART_CR3_CTSE))

USART Interrupts mask

Definition at line 106 of file stm32f30x_usart.c.

#define CR3_CLEAR_MASK   ((uint16_t)(USART_CR3_RTSE | USART_CR3_CTSE))

USART Interrupts mask

Definition at line 117 of file stm32f4xx_usart.c.

#define IT_MASK   ((uint32_t)0x000000FF)

Definition at line 109 of file stm32f30x_usart.c.

#define IT_MASK   ((uint16_t)0x001F)

Definition at line 120 of file stm32f4xx_usart.c.

Function Documentation

void USART_AddressDetectionConfig ( USART_TypeDef USARTx,
uint32_t  USART_AddressLength 
)

Configure the the USART Address detection length.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_AddressLengthspecifies the USART address length detection. This parameter can be one of the following values:
  • USART_AddressLength_4b: 4-bit address length detection
  • USART_AddressLength_7b: 7-bit address length detection
Return values
None

Definition at line 1048 of file stm32f30x_usart.c.

void USART_AutoBaudRateCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the Auto Baud Rate.

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 auto baud rate. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 838 of file stm32f30x_usart.c.

void USART_AutoBaudRateConfig ( USART_TypeDef USARTx,
uint32_t  USART_AutoBaudRate 
)

Selects the USART auto baud rate method.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_AutoBaudRatespecifies the selected USART auto baud rate method. This parameter can be one of the following values:
  • USART_AutoBaudRate_StartBit: Start Bit duration measurement.
  • USART_AutoBaudRate_FallingEdge: Falling edge to falling edge measurement.
  • USART_AutoBaudRate_0x7FFrame: 0x7F frame.
  • USART_AutoBaudRate_0x55Frame: 0x55 frame.
Note
This function has to be called before calling USART_Cmd() function.
Return values
None

Definition at line 872 of file stm32f30x_usart.c.

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_ClearFlag ( USART_TypeDef USARTx,
uint32_t  USART_FLAG 
)

Clears the USARTx's pending flags.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_FLAGspecifies the flag to clear. This parameter can be any combination of the following values:
  • USART_FLAG_WUF: Wake up flag.
  • USART_FLAG_CMF: Character match flag.
  • USART_FLAG_EOBF: End of block flag.
  • USART_FLAG_RTOF: Receive time out flag.
  • USART_FLAG_CTS: CTS Change flag.
  • USART_FLAG_LBD: LIN Break detection flag.
  • USART_FLAG_TC: Transmission Complete flag.
  • USART_FLAG_IDLE: IDLE line detected flag.
  • USART_FLAG_ORE: OverRun Error flag.
  • USART_FLAG_NE: Noise Error flag.
  • USART_FLAG_FE: Framing Error flag.
  • USART_FLAG_PE: Parity Errorflag.
Note
Return values
None

Definition at line 1953 of file stm32f30x_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_ClearITPendingBit ( USART_TypeDef USARTx,
uint32_t  USART_IT 
)

Clears the USARTx's interrupt pending bits.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_ITspecifies the interrupt pending bit to clear. This parameter can be one of the following values:
  • USART_IT_WU: Wake up interrupt.
  • USART_IT_CM: Character match interrupt.
  • USART_IT_EOB: End of block interrupt.
  • USART_IT_RTO: Receive time out interrupt.
  • USART_IT_CTS: CTS change interrupt.
  • USART_IT_LBD: LIN Break detection interrupt.
  • USART_IT_TC: Transmission complete interrupt.
  • USART_IT_IDLE: IDLE line detected 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.
Note
Return values
None

Definition at line 2056 of file stm32f30x_usart.c.

void USART_DataInvCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the binary data inversion.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
NewStatenew defined levels for the USART data. This parameter can be: ENABLE or DISABLE.
  • ENABLE: Logical data from the data register are send/received in negative logic. (1=L, 0=H). The parity bit is also inverted.
  • DISABLE: Logical data from the data register are send/received in positive logic. (1=H, 0=L)
Note
This function has to be called before calling USART_Cmd() function.
Return values
None

Definition at line 560 of file stm32f30x_usart.c.

void USART_DECmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's DE functionality.

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 driver enable mode. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 1495 of file stm32f30x_usart.c.

void USART_DEPolarityConfig ( USART_TypeDef USARTx,
uint32_t  USART_DEPolarity 
)

Configures the USART's DE polarity.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_DEPolarityspecifies the DE polarity. This parameter can be one of the following values:
  • USART_DEPolarity_Low
  • USART_DEPolarity_High
Return values
None

Definition at line 1522 of file stm32f30x_usart.c.

void USART_DirectionModeCmd ( USART_TypeDef USARTx,
uint32_t  USART_DirectionMode,
FunctionalState  NewState 
)

Enables or disables the USART's transmitter or receiver.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_Directionspecifies the USART direction. This parameter can be any combination of the following values:
  • USART_Mode_Tx: USART Transmitter
  • USART_Mode_Rx: USART Receiver
NewStatenew state of the USART transfer direction. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 436 of file stm32f30x_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.

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

Enables or disables the USART's DMA interface.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4.
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
None

Definition at line 1607 of file stm32f30x_usart.c.

void USART_DMAReceptionErrorConfig ( USART_TypeDef USARTx,
uint32_t  USART_DMAOnError 
)

Enables or disables the USART's DMA interface when reception error occurs.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4.
USART_DMAOnErrorspecifies the DMA status in case of reception error. This parameter can be any combination of the following values:
  • USART_DMAOnError_Enable: DMA receive request enabled when the USART DMA reception error is asserted.
  • USART_DMAOnError_Disable: DMA receive request disabled when the USART DMA reception error is asserted.
Return values
None

Definition at line 1640 of file stm32f30x_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.

FlagStatus USART_GetFlagStatus ( USART_TypeDef USARTx,
uint32_t  USART_FLAG 
)

Checks whether the specified USART flag is set or not.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_FLAGspecifies the flag to check. This parameter can be one of the following values:
  • USART_FLAG_REACK: Receive Enable acknowledge flag.
  • USART_FLAG_TEACK: Transmit Enable acknowledge flag.
  • USART_FLAG_WUF: Wake up flag.
  • USART_FLAG_RWU: Receive Wake up flag.
  • USART_FLAG_SBK: Send Break flag.
  • USART_FLAG_CMF: Character match flag.
  • USART_FLAG_BUSY: Busy flag.
  • USART_FLAG_ABRF: Auto baud rate flag.
  • USART_FLAG_ABRE: Auto baud rate error flag.
  • USART_FLAG_EOBF: End of block flag.
  • USART_FLAG_RTOF: Receive time out flag.
  • USART_FLAG_nCTSS: Inverted nCTS input bit status.
  • USART_FLAG_CTS: CTS Change flag.
  • 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 1902 of file stm32f30x_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.

ITStatus USART_GetITStatus ( USART_TypeDef USARTx,
uint32_t  USART_IT 
)

Checks whether the specified USART interrupt has occurred or not.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_ITspecifies the USART interrupt source to check. This parameter can be one of the following values:
  • USART_IT_WU: Wake up interrupt.
  • USART_IT_CM: Character match interrupt.
  • USART_IT_EOB: End of block interrupt.
  • USART_IT_RTO: Receive time out interrupt.
  • USART_IT_CTS: CTS change interrupt.
  • 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 1984 of file stm32f30x_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_InvPinCmd ( USART_TypeDef USARTx,
uint32_t  USART_InvPin,
FunctionalState  NewState 
)

Enables or disables the Pin(s) active level inversion.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_InvPinspecifies the USART pin(s) to invert. This parameter can be any combination of the following values:
  • USART_InvPin_Tx: USART Tx pin active level inversion.
  • USART_InvPin_Rx: USART Rx pin active level inversion.
NewStatenew active level status for the USART pin(s). This parameter can be: ENABLE or DISABLE.
  • ENABLE: pin(s) signal values are inverted (Vdd =0, Gnd =1).
  • DISABLE: pin(s) signal works using the standard logic levels (Vdd =1, Gnd =0).
Note
This function has to be called before calling USART_Cmd() function.
Return values
None

Definition at line 596 of file stm32f30x_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_IrDAConfig ( USART_TypeDef USARTx,
uint32_t  USART_IrDAMode 
)

Configures the USART's IrDA interface.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or 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 1419 of file stm32f30x_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_ITConfig ( USART_TypeDef USARTx,
uint32_t  USART_IT,
FunctionalState  NewState 
)

Enables or disables the specified USART interrupts.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or 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_WU: Wake up interrupt.
  • USART_IT_CM: Character match interrupt.
  • USART_IT_EOB: End of block interrupt.
  • USART_IT_RTO: Receive time out interrupt.
  • USART_IT_CTS: CTS change interrupt.
  • 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_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 1773 of file stm32f30x_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_LINBreakDetectLengthConfig ( USART_TypeDef USARTx,
uint32_t  USART_LINBreakDetectLength 
)

Sets the USART LIN Break detection length.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or 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 1113 of file stm32f30x_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_MSBFirstCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's most significant bit first transmitted/received following the start bit.

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 most significant bit first transmitted/received following the start bit. This parameter can be: ENABLE or DISABLE.
Note
This function has to be called before calling USART_Cmd() function.
Return values
None

Definition at line 526 of file stm32f30x_usart.c.

void USART_MuteModeCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's mute mode.

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 mute mode. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 1000 of file stm32f30x_usart.c.

void USART_MuteModeWakeUpConfig ( USART_TypeDef USARTx,
uint32_t  USART_WakeUp 
)

Selects the USART WakeUp method from mute mode.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or 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 1028 of file stm32f30x_usart.c.

void USART_OverrunDetectionConfig ( USART_TypeDef USARTx,
uint32_t  USART_OVRDetection 
)

Enables or disables the USART's Overrun detection.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_OVRDetectionspecifies the OVR detection status in case of OVR error. This parameter can be any combination of the following values:
  • USART_OVRDetection_Enable: OVR error detection enabled when the USART OVR error is asserted.
  • USART_OVRDetection_Disable: OVR error detection disabled when the USART OVR error is asserted.
Return values
None

Definition at line 1860 of file stm32f30x_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_ReceiverTimeOutCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the receiver Time Out feature.

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 receiver Time Out. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 655 of file stm32f30x_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_RequestCmd ( USART_TypeDef USARTx,
uint32_t  USART_Request,
FunctionalState  NewState 
)

Enables the specified USART's Request.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_Requestspecifies the USART request. This parameter can be any combination of the following values:
  • USART_Request_TXFRQ: Transmit data flush ReQuest
  • USART_Request_RXFRQ: Receive data flush ReQuest
  • USART_Request_MMRQ: Mute Mode ReQuest
  • USART_Request_SBKRQ: Send Break ReQuest
  • USART_Request_ABRRQ: Auto Baud Rate ReQuest
NewStatenew state of the DMA interface when reception error occurs. This parameter can be: ENABLE or DISABLE.
Return values
None

Definition at line 1827 of file stm32f30x_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_SetAutoRetryCount ( USART_TypeDef USARTx,
uint8_t  USART_AutoCount 
)

Sets the Smart Card number of retries in transmit and receive.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3.
USART_AutoCountspecifies the Smart Card auto retry count.
Return values
None

Definition at line 1338 of file stm32f30x_usart.c.

void USART_SetBlockLength ( USART_TypeDef USARTx,
uint8_t  USART_BlockLength 
)

Sets the Smart Card Block length.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3.
USART_BlockLengthspecifies the Smart Card block length.
Return values
None

Definition at line 1356 of file stm32f30x_usart.c.

void USART_SetDEAssertionTime ( USART_TypeDef USARTx,
uint32_t  USART_DEAssertionTime 
)

Sets the specified RS485 DE assertion time.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_AssertionTimespecifies the time between the activation of the DE signal and the beginning of the start bit
Return values
None

Definition at line 1540 of file stm32f30x_usart.c.

void USART_SetDEDeassertionTime ( USART_TypeDef USARTx,
uint32_t  USART_DEDeassertionTime 
)

Sets the specified RS485 DE deassertion time.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_DeassertionTimespecifies the time between the middle of the last stop bit in a transmitted message and the de-activation of the DE signal
Return values
None

Definition at line 1560 of file stm32f30x_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_SetReceiverTimeOut ( USART_TypeDef USARTx,
uint32_t  USART_ReceiverTimeOut 
)

Sets the receiver Time Out value.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_ReceiverTimeOutspecifies the Receiver Time Out value.
Return values
None

Definition at line 682 of file stm32f30x_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_STOPModeCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the specified USART peripheral in STOP Mode.

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 state in stop mode. This parameter can be: ENABLE or DISABLE.
Note
This function has to be called when USART clock is set to HSI or LSE.
Return values
None

Definition at line 754 of file stm32f30x_usart.c.

void USART_StopModeWakeUpSourceConfig ( USART_TypeDef USARTx,
uint32_t  USART_WakeUpSource 
)

Selects the USART WakeUp method form stop mode.

Parameters
USARTxSelect the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_WakeUpspecifies the selected USART wakeup method. This parameter can be one of the following values:
  • USART_WakeUpSource_AddressMatch: WUF active on address match.
  • USART_WakeUpSource_StartBit: WUF active on Start bit detection.
  • USART_WakeUpSource_RXNE: WUF active on RXNE.
Note
This function has to be called before calling USART_Cmd() function.
Return values
None

Definition at line 787 of file stm32f30x_usart.c.

void USART_SWAPPinCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the swap Tx/Rx pins.

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 TX/RX pins pinout. This parameter can be: ENABLE or DISABLE.
  • ENABLE: The TX and RX pins functions are swapped.
  • DISABLE: TX/RX pins are used as defined in standard pinout
Note
This function has to be called before calling USART_Cmd() function.
Return values
None

Definition at line 629 of file stm32f30x_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:55