STM32F0 Standard Peripheral bibliotheek  1.0
ST Microelectronics standard peripheral bibliotheek documentatie voor de STM32F0 familie
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
RS485 mode function

RS485 mode function. More...

Functions

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_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...
 

Detailed Description

RS485 mode function.

 ===============================================================================
                        ##### RS485 mode functions #####
 ===============================================================================
    [..] This subsection provides a set of functions allowing to manage the USART
         RS485 flow control.
    [..] RS485 flow control (Driver enable feature) handling is possible through
         the following procedure:
         (#) Program the Baud rate, Word length = 8 bits, Stop bits, Parity, 
             Transmitter/Receiver modes and hardware flow control values using 
             the USART_Init() function.
         (#) Enable the Driver Enable using the USART_DECmd() function.
         (#) Configures the Driver Enable polarity using the USART_DEPolarityConfig()
             function.
         (#) Configures the Driver Enable assertion time using USART_SetDEAssertionTime() 
             function and deassertion time using the USART_SetDEDeassertionTime()
             function.    
         (#) Enable the USART using the USART_Cmd() function.
      -@-  
       (+@) The assertion and dessertion times are expressed in sample time units (1/8 or 
            1/16 bit time, depending on the oversampling rate).

Function Documentation

void USART_DECmd ( USART_TypeDef *  USARTx,
FunctionalState  NewState 
)

Enables or disables the USART's DE functionality.

Parameters
USARTx,:where x can be 1 or 2 to select the USART peripheral.
NewState,:new state of the driver enable mode. This parameter can be: ENABLE or DISABLE.
Return values
None
void USART_DEPolarityConfig ( USART_TypeDef *  USARTx,
uint32_t  USART_DEPolarity 
)

Configures the USART's DE polarity.

Parameters
USARTx,:where x can be 1 or 2 to select the USART peripheral.
USART_DEPolarity,:specifies the DE polarity. This parameter can be one of the following values:
  • USART_DEPolarity_Low
  • USART_DEPolarity_High
Return values
None
void USART_SetDEAssertionTime ( USART_TypeDef *  USARTx,
uint32_t  USART_DEAssertionTime 
)

Sets the specified RS485 DE assertion time.

Parameters
USARTx,:where x can be 1 or 2 to select the USART peripheral.
USART_DEAssertionTime,:specifies the time between the activation of the DE signal and the beginning of the start bit
Return values
None
void USART_SetDEDeassertionTime ( USART_TypeDef *  USARTx,
uint32_t  USART_DEDeassertionTime 
)

Sets the specified RS485 DE deassertion time.

Parameters
USARTx,:where x can be 1 or 2 to select the USART peripheral.
USART_DeassertionTime,:specifies 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