STM8L15x Standard Peripherals Drivers: Halfduplex mode function

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

Halfduplex mode function

Half-duplex mode function. More...

Functions

void USART_HalfDuplexCmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART�s Half Duplex communication.

Detailed Description

Half-duplex mode function.

 ===============================================================================
                         Half-duplex mode function
 ===============================================================================  

  This subsection provides a function allowing to manage the USART 
  Half-duplex communication.
  
  The USART can be configured to follow a single-wire half-duplex protocol where 
  the TX and RX lines are internally connected.

  USART Half duplex communication is possible through the following procedure:
     1. Program the Baud rate, Word length, Stop bits, Parity, Mode transmitter 
        or Mode receiver and hardware flow control values using the USART_Init()
        function.
     2. Configures the USART address using the USART_SetAddress() function.
     3. Enable the USART using the USART_Cmd() function.
     4. Enable the half duplex mode using USART_HalfDuplexCmd() function.

Note:
----
  1. The RX pin is no longer used
  2. In Half-duplex mode the following bits must be kept cleared:
       - CLKEN bits in the USART_CR3 register.
       - SCEN and IREN bits in the USART_CR5 register.


Function Documentation

void USART_HalfDuplexCmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART�s Half Duplex communication.

Parameters:
USARTx,:where x can be 1 to select the specified USART peripheral.
NewStatenew state of the USART Communication. This parameter can be: ENABLE or DISABLE.
Return values:
None

< USART Half Duplex Enable

< USART Half Duplex Disable

Definition at line 560 of file stm8l15x_usart.c.

References USART_struct::CR5, DISABLE, IS_FUNCTIONAL_STATE, and USART_CR5_HDSEL.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com