Martin Johnson / STM32F3-Discovery

Dependents:   Space_Invaders_Demo neopixels gpio_test_stm32f3_discovery gpio_test_systimer ... more

Embed: (wiki syntax)

« Back to documentation index

RS485 mode function

RS485 mode function
[USART_Private_Functions]

RS485 mode function. More...

Functions

void USART_DECmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART's DE functionality.
void USART_DEPolarityConfig (USART_TypeDef *USARTx, uint32_t USART_DEPolarity)
 Configures the USART's DE polarity.
void USART_SetDEAssertionTime (USART_TypeDef *USARTx, uint32_t USART_DEAssertionTime)
 Sets the specified RS485 DE assertion time.
void USART_SetDEDeassertionTime (USART_TypeDef *USARTx, uint32_t USART_DEDeassertionTime)
 Sets the specified RS485 DE deassertion time.

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,:Select the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
NewState,:new state of the driver enable mode. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 1501 of file stm32f30x_usart.c.

void USART_DEPolarityConfig ( USART_TypeDef *  USARTx,
uint32_t  USART_DEPolarity 
)

Configures the USART's DE polarity.

Parameters:
USARTx,:Select the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3 or UART4 or UART5.
USART_DEPolarity,:specifies the DE polarity. This parameter can be one of the following values:

  • USART_DEPolarity_Low
  • USART_DEPolarity_High
Return values:
None

Definition at line 1528 of file stm32f30x_usart.c.

void USART_SetDEAssertionTime ( USART_TypeDef *  USARTx,
uint32_t  USART_DEAssertionTime 
)

Sets the specified RS485 DE assertion time.

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

Definition at line 1546 of file stm32f30x_usart.c.

void USART_SetDEDeassertionTime ( USART_TypeDef *  USARTx,
uint32_t  USART_DEDeassertionTime 
)

Sets the specified RS485 DE deassertion time.

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

Definition at line 1566 of file stm32f30x_usart.c.