CARME-M4 BSP  V1.5
Initialization and Configuration functions

Initialization and Configuration functions. More...

+ Collaboration diagram for Initialization and Configuration functions:

Functions

void USART_DeInit (USART_TypeDef *USARTx)
 Deinitializes the USARTx peripheral registers to their default reset values. 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_StructInit (USART_InitTypeDef *USART_InitStruct)
 Fills each USART_InitStruct member with its default value. 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_SetPrescaler (USART_TypeDef *USARTx, uint8_t USART_Prescaler)
 Sets the system clock prescaler. More...
 
void USART_OverSampling8Cmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's 8x oversampling mode. More...
 
void USART_OneBitMethodCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's one bit sampling method. More...
 

Detailed Description

Initialization and Configuration functions.

 ===============================================================================
            ##### Initialization and Configuration functions #####
 ===============================================================================  
    [..]
    This subsection provides a set of functions allowing to initialize the USART 
    in asynchronous and in synchronous modes.
      (+) For the asynchronous mode only these parameters can be configured: 
        (++) Baud Rate
        (++) Word Length 
        (++) Stop Bit
        (++) Parity: If the parity is enabled, then the MSB bit of the data written
             in the data register is transmitted but is changed by the parity bit.
             Depending on the frame length defined by the M bit (8-bits or 9-bits),
             the possible USART frame formats are as listed in the following table:
   +-------------------------------------------------------------+     
   |   M bit |  PCE bit  |            USART frame                |
   |---------------------|---------------------------------------|             
   |    0    |    0      |    | SB | 8 bit data | STB |          |
   |---------|-----------|---------------------------------------|  
   |    0    |    1      |    | SB | 7 bit data | PB | STB |     |
   |---------|-----------|---------------------------------------|  
   |    1    |    0      |    | SB | 9 bit data | STB |          |
   |---------|-----------|---------------------------------------|  
   |    1    |    1      |    | SB | 8 bit data | PB | STB |     |
   +-------------------------------------------------------------+            
        (++) Hardware flow control
        (++) Receiver/transmitter modes

    [..]
    The USART_Init() function follows the USART  asynchronous configuration 
    procedure (details for the procedure are available in reference manual (RM0090)).

     (+) For the synchronous mode in addition to the asynchronous mode parameters these 
         parameters should be also configured:
        (++) USART Clock Enabled
        (++) USART polarity
        (++) USART phase
        (++) USART LastBit
  
    [..]
    These parameters can be configured using the USART_ClockInit() function.

Function Documentation

void USART_ClockInit ( USART_TypeDef *  USARTx,
USART_ClockInitTypeDef 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

Definition at line 379 of file stm32f4xx_usart.c.

+ Here is the caller graph for this function:

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.

+ Here is the caller graph for this function:

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

Definition at line 427 of file stm32f4xx_usart.c.

+ Here is the caller graph for this function:

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

Definition at line 187 of file stm32f4xx_usart.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 246 of file stm32f4xx_usart.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

Definition at line 474 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

Definition at line 453 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.