STM8L15x Standard Peripherals Drivers: Data transfers functions

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

Data transfers functions

Data transfers functions. More...

Functions

uint8_t USART_ReceiveData8 (USART_TypeDef *USARTx)
 Returns the most recent received data by the USART peripheral.
uint16_t USART_ReceiveData9 (USART_TypeDef *USARTx)
 Returns the most recent received data by the USART peripheral.
void USART_SendData8 (USART_TypeDef *USARTx, uint8_t Data)
 Transmits 8 bit data through the USART peripheral.
void USART_SendData9 (USART_TypeDef *USARTx, uint16_t Data)
 Transmits 9 bit data through the USART peripheral.

Detailed Description

Data transfers functions.

 ===============================================================================
                            Data transfers functions
 ===============================================================================  

  This subsection provides a set of functions allowing to manage the USART data 
  transfers.
  
  During an USART reception, data shifts in least significant bit first through 
  the RX pin. In this mode, the USART_DR register is similar to a buffer (RDR) 
  between the internal bus and the received shift register.

  When a transmission is taking place, a write instruction to the USART_DR register 
  stores the data in the TDR register which is copied in the shift register 
  at the end of the current transmission.

  The read access of the USART_DR register can be done using the USART_ReceiveData8()
  or USART_ReceiveData9() functions and returns the RDR buffered value. Whereas a write
	access to the USART_DR can be done using USART_SendData8() or USART_SendData9() 
	functions and stores the written data into TDR buffer.


Function Documentation

uint8_t USART_ReceiveData8 ( USART_TypeDef USARTx)

Returns the most recent received data by the USART peripheral.

Parameters:
USARTx,:where x can be 1 to select the specified USART peripheral.
Return values:
Thereceived data.

Definition at line 376 of file stm8l15x_usart.c.

References USART_struct::DR.

uint16_t USART_ReceiveData9 ( USART_TypeDef USARTx)

Returns the most recent received data by the USART peripheral.

Parameters:
USARTx,:where x can be 1 to select the specified USART peripheral.
Return values:
Thereceived data.

Definition at line 386 of file stm8l15x_usart.c.

References USART_struct::CR1, USART_struct::DR, and USART_CR1_R8.

void USART_SendData8 ( USART_TypeDef USARTx,
uint8_t  Data 
)

Transmits 8 bit data through the USART peripheral.

Parameters:
Data,:The data to transmit.
Return values:
None

Definition at line 399 of file stm8l15x_usart.c.

References USART_struct::DR.

void USART_SendData9 ( USART_TypeDef USARTx,
uint16_t  Data 
)

Transmits 9 bit data through the USART peripheral.

Parameters:
USARTx,:Select the USARTx peripheral.
Data,:The data to transmit. This parameter should be lower than 0x1FF.
Return values:
None

Definition at line 412 of file stm8l15x_usart.c.

References USART_struct::CR1, USART_struct::DR, IS_USART_DATA_9BITS, and USART_CR1_T8.

STM8S Firmware Library: Overview

 

 

 

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