RS485 mode function.
More...
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).
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
-
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
-
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
-
Definition at line 1522 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
-
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
-
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
-
Definition at line 1560 of file stm32f30x_usart.c.