EFM32 Happy Gecko Software Documentation  efm32hg-doc-5.1.2
em_usart.c File Reference

Detailed Description

Universal synchronous/asynchronous receiver/transmitter (USART/UART) Peripheral API.

Version
5.1.2

License

Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no obligation to support this Software. Silicon Labs is providing the Software "AS IS", with no express or implied warranties of any kind, including, but not limited to, any implied warranties of merchantability or fitness for any particular purpose or warranties against infringement of any proprietary rights of a third party.

Silicon Labs will not be liable for any consequential, incidental, or special damages, or any other relief, or for any claim by any third party, arising from your use of this Software.

Definition in file em_usart.c.

#include "em_usart.h"
#include "em_cmu.h"
#include "em_bus.h"
#include "em_assert.h"

Go to the source code of this file.

Functions

void USART_BaudrateAsyncSet (USART_TypeDef *usart, uint32_t refFreq, uint32_t baudrate, USART_OVS_TypeDef ovs)
 Configure USART/UART operating in asynchronous mode to use a given baudrate (or as close as possible to specified baudrate). More...
 
uint32_t USART_BaudrateCalc (uint32_t refFreq, uint32_t clkdiv, bool syncmode, USART_OVS_TypeDef ovs)
 Calculate baudrate for USART/UART given reference frequency, clock division and oversampling rate (if async mode). More...
 
uint32_t USART_BaudrateGet (USART_TypeDef *usart)
 Get current baudrate for USART/UART. More...
 
void USART_BaudrateSyncSet (USART_TypeDef *usart, uint32_t refFreq, uint32_t baudrate)
 Configure USART operating in synchronous mode to use a given baudrate (or as close as possible to specified baudrate). More...
 
void USART_Enable (USART_TypeDef *usart, USART_Enable_TypeDef enable)
 Enable/disable USART/UART receiver and/or transmitter. More...
 
void USART_InitAsync (USART_TypeDef *usart, const USART_InitAsync_TypeDef *init)
 Init USART/UART for normal asynchronous mode. More...
 
void USART_InitI2s (USART_TypeDef *usart, USART_InitI2s_TypeDef *init)
 Init USART for I2S mode. More...
 
void USART_InitPrsTrigger (USART_TypeDef *usart, const USART_PrsTriggerInit_TypeDef *init)
 Initialize automatic transmissions using PRS channel as trigger. More...
 
void USART_InitSync (USART_TypeDef *usart, const USART_InitSync_TypeDef *init)
 Init USART for synchronous mode. More...
 
void USART_Reset (USART_TypeDef *usart)
 Reset USART/UART to same state as after a HW reset. More...
 
uint8_t USART_Rx (USART_TypeDef *usart)
 Receive one 4-8 bit frame, (or part of 10-16 bit frame). More...
 
uint16_t USART_RxDouble (USART_TypeDef *usart)
 Receive two 4-8 bit frames, or one 10-16 bit frame. More...
 
uint32_t USART_RxDoubleExt (USART_TypeDef *usart)
 Receive two 4-9 bit frames, or one 10-16 bit frame with extended information. More...
 
uint16_t USART_RxExt (USART_TypeDef *usart)
 Receive one 4-9 bit frame, (or part of 10-16 bit frame) with extended information. More...
 
uint8_t USART_SpiTransfer (USART_TypeDef *usart, uint8_t data)
 Perform one 8 bit frame SPI transfer. More...
 
void USART_Tx (USART_TypeDef *usart, uint8_t data)
 Transmit one 4-9 bit frame. More...
 
void USART_TxDouble (USART_TypeDef *usart, uint16_t data)
 Transmit two 4-9 bit frames, or one 10-16 bit frame. More...
 
void USART_TxDoubleExt (USART_TypeDef *usart, uint32_t data)
 Transmit two 4-9 bit frames, or one 10-16 bit frame with extended control. More...
 
void USART_TxExt (USART_TypeDef *usart, uint16_t data)
 Transmit one 4-9 bit frame with extended control. More...
 
void USARTn_InitIrDA (USART_TypeDef *usart, const USART_InitIrDA_TypeDef *init)
 Init USART for asynchronous IrDA mode. More...