STM8L15x Standard Peripherals Drivers: IrDA mode functions

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

IrDA mode functions

IrDA mode functions. More...

Functions

void USART_IrDACmd (USART_TypeDef *USARTx, FunctionalState NewState)
 Enables or disables the USART�s IrDA interface.
void USART_IrDAConfig (USART_TypeDef *USARTx, USART_IrDAMode_TypeDef USART_IrDAMode)
 Configures the USART�s IrDA interface.

Detailed Description

IrDA mode functions.

 ===============================================================================
                                IrDA mode functions
 ===============================================================================  

  This subsection provides a set of functions allowing to manage the USART 
  IrDA communication.
  
  IrDA is a half duplex communication protocol. If the Transmitter is busy, any data
  on the IrDA receive line will be ignored by the IrDA decoder and if the Receiver 
  is busy, data on the TX from the USART to IrDA will not be encoded by IrDA.
  While receiving data, transmission should be avoided as the data to be transmitted
  could be corrupted.

  IrDA communication is possible through the following procedure:
     1. Program the Baud rate, Word length = 8 bits, Stop bits, Parity, Transmitter/Receiver 
        modes and hardware flow control values using the USART_Init() function.
     2. Enable the USART using the USART_Cmd() function.
     3. Configures the IrDA pulse width by configuring the prescaler using  
        the USART_SetPrescaler() function.
     4. Configures the IrDA  USART_IrDAMode_LowPower or USART_IrDAMode_Normal mode
        using the USART_IrDAConfig() function.
     5. Enable the IrDA using the USART_IrDACmd() function.

Note: 
-----
  1. A pulse of width less than two and greater than one PSC period(s) may or may
     not be rejected.
  2. The receiver set up time should be managed by software. The IrDA physical layer
     specification specifies a minimum of 10 ms delay between transmission and 
     reception (IrDA is a half duplex protocol).
  3. In IrDA mode, the following bits must be kept cleared:
    - STOP and CLKEN bits in the USART_CR3 register.
    - SCEN and HDSEL bits in the USART_CR5 register.


Function Documentation

void USART_IrDACmd ( USART_TypeDef USARTx,
FunctionalState  NewState 
)

Enables or disables the USART�s IrDA interface.

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

Definition at line 766 of file stm8l15x_usart.c.

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

void USART_IrDAConfig ( USART_TypeDef USARTx,
USART_IrDAMode_TypeDef  USART_IrDAMode 
)

Configures the USART�s IrDA interface.

Parameters:
USARTx,:where x can be 1 to select the specified USART peripheral.
USART_IrDAModespecifies the IrDA mode. This parameter can be one of the following values:
  • USART_IrDAMode_Normal: IrDA Normal Mode
  • USART_IrDAMode_LowPower: IrDA Low Power Mode
Return values:
None

Definition at line 745 of file stm8l15x_usart.c.

References USART_struct::CR5, IS_USART_IRDAMODE, USART_CR5_IRLP, and USART_IrDAMode_Normal.

STM8S Firmware Library: Overview

 

 

 

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