EUSART - Extended USART
Description
Extended Universal Synchronous/Asynchronous Receiver/Transmitter.
Introduction
This module contains functions to control the Enhanced Universal Synchronous / Asynchronous Receiver / Transmitter controller(s) (EUSART) peripheral of Silicon Labs' 32-bit MCUs and SoCs. The EUSART can be used as a UART and can, therefore, be connected to an external transceiver to communicate with another host using the serial link.
It supports full duplex asynchronous UART communication as well as RS-485, SPI, MicroWire, and 3-wire. It can also interface with ISO7816 Smart-Cards, and IrDA devices.
The EUSART has a wide selection of operating modes, frame formats, and baud rates. All features are supported through the API of this module.
This module does not support DMA configuration. The UARTDRV and SPIDRV drivers provide full support for DMA and more.
Example
EUSART Async Tx example:
EUSART Sync SPI Transaction example:
EM2 guidelines for non EM2-Capable instances
- Note
- EUSART instances located in the PD1 power domain are non EM2-capable. The EUSART_EM2_CAPABLE() and EUSART_NOT_EM2_CAPABLE() macros can be used to determine whether or not a EUSART instance is EM2-Capable.
Follow theses steps when entering in EM2:
- Wait for the current transaction to complete with TXCIF interrupt
- Disable TX and RX using TXDIS and RXDIS cmd
- Poll for EUSARTn_SYNCBUSY.TXDIS and EUSARTn_SYNCBUSY.RXDIS to go low
- Wait for EUSARTn_STATUS.TXENS and EUSARTn_STATUS.RXENS to go low
- Disable SCLKPEN and CSPEN in GPIO if they were previously enabled
- Enter EM2
On wakeup from EM2, EUSART transmitter/receiver and relevant GPIO (SCLKPEN and CSPEN) must be re-enabled. For example:
Data Structures |
|
struct | EUSART_AdvancedInit_TypeDef |
Advanced initialization structure.
|
|
struct | EUSART_UartInit_TypeDef |
Initialization structure.
|
|
struct | EUSART_IrDAInit_TypeDef |
IrDA Initialization structure.
|
|
struct | EUSART_PrsTriggerInit_TypeDef |
PRS Trigger initialization structure.
|
|
struct | EUSART_SpiAdvancedInit_TypeDef |
SPI Advanced initialization structure.
|
|
struct | EUSART_SpiInit_TypeDef |
SPI Initialization structure.
|
|
struct | EUSART_DaliInit_TypeDef |
DALI Initialization structure.
|
|
Functions |
|
void | EUSART_UartInitHf (EUSART_TypeDef *eusart, const EUSART_UartInit_TypeDef *init) |
Initializes the EUSART when used in UART mode with the high frequency clock.
|
|
void | EUSART_UartInitLf (EUSART_TypeDef *eusart, const EUSART_UartInit_TypeDef *init) |
Initializes the EUSART when used in UART mode with the low frequency clock.
|
|
void | EUSART_IrDAInit (EUSART_TypeDef *eusart, const EUSART_IrDAInit_TypeDef *irdaInit) |
Initializes the EUSART when used in IrDA mode with the high or low frequency clock.
|
|
void | EUSART_SpiInit (EUSART_TypeDef *eusart, const EUSART_SpiInit_TypeDef *init) |
Initializes the EUSART when used in SPI mode.
|
|
void | EUSART_DaliInit (EUSART_TypeDef *eusart, const EUSART_DaliInit_TypeDef *daliInit) |
Initializes the EUSART when used in DALI mode with the high or low frequency clock.
|
|
void | EUSART_Reset (EUSART_TypeDef *eusart) |
Configures the EUSART to its reset state.
|
|
void | EUSART_Enable (EUSART_TypeDef *eusart, EUSART_Enable_TypeDef enable) |
Enables/disables the EUSART receiver and/or transmitter.
|
|
uint8_t | EUSART_Rx (EUSART_TypeDef *eusart) |
Receives one 8 bit frame, (or part of 9 bit frame).
|
|
uint16_t | EUSART_RxExt (EUSART_TypeDef *eusart) |
Receives one 8-16 bit frame with extended information.
|
|
void | EUSART_Tx (EUSART_TypeDef *eusart, uint8_t data) |
Transmits one frame.
|
|
void | EUSART_TxExt (EUSART_TypeDef *eusart, uint16_t data) |
Transmits one 8-9 bit frame with extended control.
|
|
uint16_t | EUSART_Spi_TxRx (EUSART_TypeDef *eusart, uint16_t data) |
Transmits one 8-16 bit frame and return received data.
|
|
void | EUSART_Dali_Tx (EUSART_TypeDef *eusart, uint32_t data) |
Transmits one DALI frame.
|
|
uint32_t | EUSART_Dali_Rx (EUSART_TypeDef *eusart) |
Receives one 8-32 bit DALI frame.
|
|
void | EUSART_BaudrateSet (EUSART_TypeDef *eusart, uint32_t refFreq, uint32_t baudrate) |
Configures the baudrate (or as close as possible to a specified baudrate).
|
|
uint32_t | EUSART_BaudrateGet (EUSART_TypeDef *eusart) |
Gets the current baudrate.
|
|
void | EUSART_RxBlock (EUSART_TypeDef *eusart, EUSART_BlockRx_TypeDef enable) |
Enables/Disables reception operation until the configured start frame is received.
|
|
void | EUSART_TxTristateSet (EUSART_TypeDef *eusart, EUSART_TristateTx_TypeDef enable) |
Enables/Disables the tristating of the transmitter output.
|
|
void | EUSART_PrsTriggerEnable (EUSART_TypeDef *eusart, const EUSART_PrsTriggerInit_TypeDef *init) |
Initializes the automatic enabling of transmissions and/or reception using the PRS as a trigger.
|
|
uint32_t | EUSART_StatusGet (EUSART_TypeDef *eusart) |
Gets EUSART STATUS register.
|
|
void | EUSART_IntClear (EUSART_TypeDef *eusart, uint32_t flags) |
Clears one or more pending EUSART interrupts.
|
|
void | EUSART_IntDisable (EUSART_TypeDef *eusart, uint32_t flags) |
Disables one or more EUSART interrupts.
|
|
void | EUSART_IntEnable (EUSART_TypeDef *eusart, uint32_t flags) |
Enables one or more EUSART interrupts.
|
|
uint32_t | EUSART_IntGet (EUSART_TypeDef *eusart) |
Gets pending EUSART interrupt flags.
|
|
uint32_t | EUSART_IntGetEnabled (EUSART_TypeDef *eusart) |
Gets enabled and pending EUSART interrupt flags.
|
|
void | EUSART_IntSet (EUSART_TypeDef *eusart, uint32_t flags) |
Sets one or more pending EUSART interrupts from SW.
|
|
Macros |
|
#define | EUSART_UART_INIT_DEFAULT_HF |
Default configuration for EUSART initialization structure in UART mode with high-frequency clock.
|
|
#define | EUSART_DEFAULT_START_FRAME 0x00u |
Default start frame configuration, i.e. feature disabled.
|
|
#define | EUSART_ADVANCED_INIT_DEFAULT |
Default configuration for EUSART advanced initialization structure.
|
|
#define | EUSART_UART_INIT_DEFAULT_LF |
Default configuration for EUSART initialization structure in UART mode with low-frequency clock.
|
|
#define | EUSART_IRDA_INIT_DEFAULT_HF |
Default configuration for EUSART initialization structure in IrDA mode with high-frequency clock.
|
|
#define | EUSART_IRDA_INIT_DEFAULT_LF |
Default configuration for EUSART initialization structure in IrDA mode with low-frequency clock.
|
|
#define | EUSART_SPI_ADVANCED_INIT_DEFAULT |
Default advanced configuration for EUSART initialization structure in SPI mode with high-frequency clock.
|
|
#define | EUSART_SPI_MASTER_INIT_DEFAULT_HF |
Default configuration for EUSART initialization structure in SPI master mode with high-frequency clock.
|
|
#define | EUSART_SPI_SLAVE_INIT_DEFAULT_HF |
Default configuration for EUSART initialization structure in SPI slave mode with high-frequency clock.
|
|
#define | EUSART_ADVANCED_DALI_INIT_DEFAULT |
Default configuration for EUSART initialization structure in DALI mode with high-frequency clock.
|
|
#define | EUSART_UART_DALI_INIT_DEFAULT_HF |
Default configuration for EUSART initialization structure in DALI mode with high-frequency clock.
|
|
#define | EUSART_UART_DALI_INIT_DEFAULT_LF |
Default configuration for EUSART initialization structure in DALI mode with low-frequency clock.
|
|
#define | EUSART_DALI_INIT_DEFAULT_HF |
Default configuration for EUSART initialization structure in DALI mode with high-frequency clock.
|
|
#define | EUSART_DALI_INIT_DEFAULT_LF |
Default configuration for EUSART initialization structure in DALI mode with low-frequency clock.
|
|
Typedefs |
|
typedef uint8_t | EUSART_PrsChannel_TypeDef |
PRS Channel type.
|
|
Enumerations |
|
enum |
EUSART_Enable_TypeDef
{
eusartDisable = 0x0, eusartEnableRx = (EUSART_CMD_RXEN | EUSART_CMD_TXDIS), eusartEnableTx = (EUSART_CMD_TXEN | EUSART_CMD_RXDIS), eusartEnable = (EUSART_CMD_RXEN | EUSART_CMD_TXEN) } |
Enable selection.
|
|
enum |
EUSART_Databits_TypeDef
{
eusartDataBits7 = EUSART_FRAMECFG_DATABITS_SEVEN, eusartDataBits8 = EUSART_FRAMECFG_DATABITS_EIGHT, eusartDataBits9 = EUSART_FRAMECFG_DATABITS_NINE, eusartDataBits10 = EUSART_FRAMECFG_DATABITS_TEN, eusartDataBits11 = EUSART_FRAMECFG_DATABITS_ELEVEN, eusartDataBits12 = EUSART_FRAMECFG_DATABITS_TWELVE, eusartDataBits13 = EUSART_FRAMECFG_DATABITS_THIRTEEN, eusartDataBits14 = EUSART_FRAMECFG_DATABITS_FOURTEEN, eusartDataBits15 = EUSART_FRAMECFG_DATABITS_FIFTEEN, eusartDataBits16 = EUSART_FRAMECFG_DATABITS_SIXTEEN } |
Data bit selection.
|
|
enum |
EUSART_Parity_TypeDef
{
eusartNoParity = EUSART_FRAMECFG_PARITY_NONE, eusartEvenParity = EUSART_FRAMECFG_PARITY_EVEN, eusartOddParity = EUSART_FRAMECFG_PARITY_ODD } |
Parity selection.
|
|
enum |
EUSART_Stopbits_TypeDef
{
eusartStopbits0p5 = EUSART_FRAMECFG_STOPBITS_HALF, eusartStopbits1p5 = EUSART_FRAMECFG_STOPBITS_ONEANDAHALF, eusartStopbits1 = EUSART_FRAMECFG_STOPBITS_ONE, eusartStopbits2 = EUSART_FRAMECFG_STOPBITS_TWO } |
Stop bits selection.
|
|
enum |
EUSART_OVS_TypeDef
{
eusartOVS16 = EUSART_CFG0_OVS_X16, eusartOVS8 = EUSART_CFG0_OVS_X8, eusartOVS6 = EUSART_CFG0_OVS_X6, eusartOVS4 = EUSART_CFG0_OVS_X4, eusartOVS0 = EUSART_CFG0_OVS_DISABLE } |
Oversampling selection, used for asynchronous operation.
|
|
enum |
EUSART_HwFlowControl_TypeDef
{
eusartHwFlowControlNone = 0, eusartHwFlowControlCts , eusartHwFlowControlRts , eusartHwFlowControlCtsAndRts } |
HW flow control config.
|
|
enum |
EUSART_LoopbackEnable_TypeDef
{
eusartLoopbackEnable = EUSART_CFG0_LOOPBK, eusartLoopbackDisable = _EUSART_CFG0_RESETVALUE } |
Loopback enable.
|
|
enum |
EUSART_MajorityVote_TypeDef
{
eusartMajorityVoteEnable = EUSART_CFG0_MVDIS_DEFAULT, eusartMajorityVoteDisable = EUSART_CFG0_MVDIS } |
Majority vote enable.
|
|
enum |
EUSART_BlockRx_TypeDef
{
eusartBlockRxEnable = EUSART_CMD_RXBLOCKEN, eusartBlockRxDisable = EUSART_CMD_RXBLOCKDIS } |
Block reception enable.
|
|
enum |
EUSART_TristateTx_TypeDef
{
eusartTristateTxEnable = EUSART_CMD_TXTRIEN, eusartTristateTxDisable = EUSART_CMD_TXTRIDIS } |
Tx output tristate enable.
|
|
enum |
EUSART_IrDARxFilterEnable_TypeDef
{
eusartIrDARxFilterEnable = EUSART_IRHFCFG_IRHFFILT_ENABLE, eusartIrDARxFilterDisable = EUSART_IRHFCFG_IRHFFILT_DISABLE } |
IrDA filter enable.
|
|
enum |
EUSART_IrDAPulseWidth_Typedef
{
eusartIrDAPulseWidthOne = EUSART_IRHFCFG_IRHFPW_ONE, eusartIrDAPulseWidthTwo = EUSART_IRHFCFG_IRHFPW_TWO, eusartIrDAPulseWidthThree = EUSART_IRHFCFG_IRHFPW_THREE, eusartIrDAPulseWidthFour = EUSART_IRHFCFG_IRHFPW_FOUR } |
Pulse width selection for IrDA mode.
|
|
enum |
EUSART_PrsTriggerEnable_TypeDef
{
eusartPrsTriggerDisable = 0x0, eusartPrsTriggerEnableRx = EUSART_TRIGCTRL_RXTEN, eusartPrsTriggerEnableTx = EUSART_TRIGCTRL_TXTEN, eusartPrsTriggerEnableRxTx = (EUSART_TRIGCTRL_RXTEN | EUSART_TRIGCTRL_TXTEN) } |
PRS trigger enable.
|
|
enum |
EUSART_InvertIO_TypeDef
{
eusartInvertIODisable = (EUSART_CFG0_RXINV_DISABLE | EUSART_CFG0_TXINV_DISABLE), eusartInvertRxEnable = EUSART_CFG0_RXINV_ENABLE, eusartInvertTxEnable = EUSART_CFG0_TXINV_ENABLE, eusartInvertIOEnable = (EUSART_CFG0_RXINV_ENABLE | EUSART_CFG0_TXINV_ENABLE) } |
IO polarity selection.
|
|
enum |
EUSART_ClockMode_TypeDef
{
eusartClockMode0 = EUSART_CFG2_CLKPOL_IDLELOW | EUSART_CFG2_CLKPHA_SAMPLELEADING, eusartClockMode1 = EUSART_CFG2_CLKPOL_IDLELOW | EUSART_CFG2_CLKPHA_SAMPLETRAILING, eusartClockMode2 = EUSART_CFG2_CLKPOL_IDLEHIGH | EUSART_CFG2_CLKPHA_SAMPLELEADING, eusartClockMode3 = EUSART_CFG2_CLKPOL_IDLEHIGH | EUSART_CFG2_CLKPHA_SAMPLETRAILING } |
Clock polarity/phase mode.
|
|
enum |
EUSART_CsPolarity_TypeDef
{
eusartCsActiveLow = EUSART_CFG2_CSINV_AL, eusartCsActiveHigh = EUSART_CFG2_CSINV_AH } |
Chip select polarity.
|
|
enum |
EUSART_DaliTxDatabits_TypeDef
{
eusartDaliTxDataBits8 = EUSART_DALICFG_DALITXDATABITS_EIGHT, eusartDaliTxDataBits9 = EUSART_DALICFG_DALITXDATABITS_NINE, eusartDaliTxDataBits10 = EUSART_DALICFG_DALITXDATABITS_TEN, eusartDaliTxDataBits11 = EUSART_DALICFG_DALITXDATABITS_ELEVEN, eusartDaliTxDataBits12 = EUSART_DALICFG_DALITXDATABITS_TWELVE, eusartDaliTxDataBits13 = EUSART_DALICFG_DALITXDATABITS_THIRTEEN, eusartDaliTxDataBits14 = EUSART_DALICFG_DALITXDATABITS_FOURTEEN, eusartDaliTxDataBits15 = EUSART_DALICFG_DALITXDATABITS_FIFTEEN, eusartDaliTxDataBits16 = EUSART_DALICFG_DALITXDATABITS_SIXTEEN, eusartDaliTxDataBits17 = EUSART_DALICFG_DALITXDATABITS_SEVENTEEN, eusartDaliTxDataBits18 = EUSART_DALICFG_DALITXDATABITS_EIGHTEEN, eusartDaliTxDataBits19 = EUSART_DALICFG_DALITXDATABITS_NINETEEN, eusartDaliTxDataBits20 = EUSART_DALICFG_DALITXDATABITS_TWENTY, eusartDaliTxDataBits21 = EUSART_DALICFG_DALITXDATABITS_TWENTYONE, eusartDaliTxDataBits22 = EUSART_DALICFG_DALITXDATABITS_TWENTYTWO, eusartDaliTxDataBits23 = EUSART_DALICFG_DALITXDATABITS_TWENTYEIGHT, eusartDaliTxDataBits24 = EUSART_DALICFG_DALITXDATABITS_TWENTYFOUR, eusartDaliTxDataBits25 = EUSART_DALICFG_DALITXDATABITS_TWENTYFIVE, eusartDaliTxDataBits26 = EUSART_DALICFG_DALITXDATABITS_TWENTYSIX, eusartDaliTxDataBits27 = EUSART_DALICFG_DALITXDATABITS_TWENTYSEVEN, eusartDaliTxDataBits28 = EUSART_DALICFG_DALITXDATABITS_TWENTYEIGHT, eusartDaliTxDataBits29 = EUSART_DALICFG_DALITXDATABITS_TWENTYNINE, eusartDaliTxDataBits30 = EUSART_DALICFG_DALITXDATABITS_THIRTY, eusartDaliTxDataBits31 = EUSART_DALICFG_DALITXDATABITS_THIRTYONE, eusartDaliTxDataBits32 = EUSART_DALICFG_DALITXDATABITS_THIRTYTWO } |
DALI TX databits (8-32).
|
|
enum |
EUSART_DaliRxDatabits_TypeDef
{
eusartDaliRxDataBits8 = EUSART_DALICFG_DALIRXDATABITS_EIGHT, eusartDaliRxDataBits9 = EUSART_DALICFG_DALIRXDATABITS_NINE, eusartDaliRxDataBits10 = EUSART_DALICFG_DALIRXDATABITS_TEN, eusartDaliRxDataBits11 = EUSART_DALICFG_DALIRXDATABITS_ELEVEN, eusartDaliRxDataBits12 = EUSART_DALICFG_DALIRXDATABITS_TWELVE, eusartDaliRxDataBits13 = EUSART_DALICFG_DALIRXDATABITS_THIRTEEN, eusartDaliRxDataBits14 = EUSART_DALICFG_DALIRXDATABITS_FOURTEEN, eusartDaliRxDataBits15 = EUSART_DALICFG_DALIRXDATABITS_FIFTEEN, eusartDaliRxDataBits16 = EUSART_DALICFG_DALIRXDATABITS_SIXTEEN, eusartDaliRxDataBits17 = EUSART_DALICFG_DALIRXDATABITS_SEVENTEEN, eusartDaliRxDataBits18 = EUSART_DALICFG_DALIRXDATABITS_EIGHTEEN, eusartDaliRxDataBits19 = EUSART_DALICFG_DALIRXDATABITS_NINETEEN, eusartDaliRxDataBits20 = EUSART_DALICFG_DALIRXDATABITS_TWENTY, eusartDaliRxDataBits21 = EUSART_DALICFG_DALIRXDATABITS_TWENTYONE, eusartDaliRxDataBits22 = EUSART_DALICFG_DALIRXDATABITS_TWENTYTWO, eusartDaliRxDataBits23 = EUSART_DALICFG_DALIRXDATABITS_TWENTYEIGHT, eusartDaliRxDataBits24 = EUSART_DALICFG_DALIRXDATABITS_TWENTYFOUR, eusartDaliRxDataBits25 = EUSART_DALICFG_DALIRXDATABITS_TWENTYFIVE, eusartDaliRxDataBits26 = EUSART_DALICFG_DALIRXDATABITS_TWENTYSIX, eusartDaliRxDataBits27 = EUSART_DALICFG_DALIRXDATABITS_TWENTYSEVEN, eusartDaliRxDataBits28 = EUSART_DALICFG_DALIRXDATABITS_TWENTYEIGHT, eusartDaliRxDataBits29 = EUSART_DALICFG_DALIRXDATABITS_TWENTYNINE, eusartDaliRxDataBits30 = EUSART_DALICFG_DALIRXDATABITS_THIRTY, eusartDaliRxDataBits31 = EUSART_DALICFG_DALIRXDATABITS_THIRTYONE, eusartDaliRxDataBits32 = EUSART_DALICFG_DALIRXDATABITS_THIRTYTWO } |
DALI RX databits (8-32).
|
|
Function Documentation
◆ EUSART_UartInitHf()
void EUSART_UartInitHf | ( | EUSART_TypeDef * |
eusart,
|
const EUSART_UartInit_TypeDef * |
init
|
||
) |
Initializes the EUSART when used in UART mode with the high frequency clock.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. init
A pointer to the initialization structure.
Initializes the EUSART when used in UART mode with the high frequency clock.
◆ EUSART_UartInitLf()
void EUSART_UartInitLf | ( | EUSART_TypeDef * |
eusart,
|
const EUSART_UartInit_TypeDef * |
init
|
||
) |
Initializes the EUSART when used in UART mode with the low frequency clock.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. init
A pointer to the initialization structure.
Initializes the EUSART when used in UART mode with the low frequency clock.
- Note
- (1) When EUSART oversampling is set to eusartOVS0 (Disable), the peripheral clock frequency must be at least three times higher than the chosen baud rate. In LF, max input clock is 32768 (LFXO or LFRCO), thus 32768 / 3 ~ 9600 baudrate.
◆ EUSART_IrDAInit()
void EUSART_IrDAInit | ( | EUSART_TypeDef * |
eusart,
|
const EUSART_IrDAInit_TypeDef * |
irdaInit
|
||
) |
Initializes the EUSART when used in IrDA mode with the high or low frequency clock.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. irdaInit
A pointer to the initialization structure.
◆ EUSART_SpiInit()
void EUSART_SpiInit | ( | EUSART_TypeDef * |
eusart,
|
const EUSART_SpiInit_TypeDef * |
init
|
||
) |
Initializes the EUSART when used in SPI mode.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. init
A pointer to the initialization structure.
◆ EUSART_DaliInit()
void EUSART_DaliInit | ( | EUSART_TypeDef * |
eusart,
|
const EUSART_DaliInit_TypeDef * |
daliInit
|
||
) |
Initializes the EUSART when used in DALI mode with the high or low frequency clock.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. daliInit
A pointer to the initialization structure.
- Note
- (1) When EUSART oversampling is set to eusartOVS0 (Disable), the peripheral clock frequency must be at least three times higher than the chosen baud rate. In LF, max input clock is 32768 (LFXO or LFRCO), thus 32768 / 3 ~ 9600 baudrate.
◆ EUSART_Reset()
void EUSART_Reset | ( | EUSART_TypeDef * |
eusart
|
) |
Configures the EUSART to its reset state.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block.
Configures the EUSART to its reset state.
◆ EUSART_Enable()
void EUSART_Enable | ( | EUSART_TypeDef * |
eusart,
|
EUSART_Enable_TypeDef |
enable
|
||
) |
Enables/disables the EUSART receiver and/or transmitter.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. enable
Select the status for the receiver and transmitter.
◆ EUSART_Rx()
uint8_t EUSART_Rx | ( | EUSART_TypeDef * |
eusart
|
) |
Receives one 8 bit frame, (or part of 9 bit frame).
- Parameters
-
eusart
Pointer to the EUSART peripheral register block.
- Note
- This function is normally used to receive one frame when operating with frame length of 8 bits. See EUSART_RxExt() for reception of 9 bit frames. Notice that possible parity/stop bits are not considered a part of the specified frame bit length.
- This function will stall if buffer is empty until data is received.
- Returns
- Data received.
◆ EUSART_RxExt()
uint16_t EUSART_RxExt | ( | EUSART_TypeDef * |
eusart
|
) |
Receives one 8-16 bit frame with extended information.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block.
- Note
- This function is normally used to receive one frame and additional RX status information.
- This function will stall if buffer is empty until data is received.
- Returns
- Data received and receive status.
Receives one 8-16 bit frame with extended information.
◆ EUSART_Tx()
void EUSART_Tx | ( | EUSART_TypeDef * |
eusart,
|
uint8_t |
data
|
||
) |
Transmits one frame.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. data
Data to transmit.
- Note
-
Depending on the frame length configuration, 8 (least significant) bits from
data
are transmitted. If the frame length is 9, 8 bits are transmitted fromdata
. See EUSART_TxExt() for transmitting 9 bit frame with full control of all 9 bits. - This function will stall if the 4 frame FIFO is full, until the buffer becomes available.
◆ EUSART_TxExt()
void EUSART_TxExt | ( | EUSART_TypeDef * |
eusart,
|
uint16_t |
data
|
||
) |
Transmits one 8-9 bit frame with extended control.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. data
Data to transmit.
- Note
- Possible parity/stop bits in asynchronous mode are not considered part of a specified frame bit length.
- This function will stall if buffer is full until the buffer becomes available.
◆ EUSART_Spi_TxRx()
uint16_t EUSART_Spi_TxRx | ( | EUSART_TypeDef * |
eusart,
|
uint16_t |
data
|
||
) |
Transmits one 8-16 bit frame and return received data.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. data
Data to transmit.
- Returns
- Data received and receive status.
- Note
- SPI master mode only.
- This function will stall if the Tx buffer is full until the buffer becomes available.
◆ EUSART_Dali_Tx()
void EUSART_Dali_Tx | ( | EUSART_TypeDef * |
eusart,
|
uint32_t |
data
|
||
) |
Transmits one DALI frame.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. data
Data to transmit.
- Note
-
Depending on the TXdatabits configuration, N (least significant) bits from
data
are transmitted. - This function will stall if the 16 frame FIFO is full, until the buffer becomes available.
Transmits one DALI frame.
◆ EUSART_Dali_Rx()
uint32_t EUSART_Dali_Rx | ( | EUSART_TypeDef * |
eusart
|
) |
Receives one 8-32 bit DALI frame.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block.
- Note
- This function is normally used to receive one DALI frame (RXdatabits).
- This function will stall if the 16 frame FIFO is empty until new data is received.
- Returns
- Data received. Depending on the RXdatabits configuration, N (least significant) bits are returned.
Receives one 8-32 bit DALI frame.
◆ EUSART_BaudrateSet()
void EUSART_BaudrateSet | ( | EUSART_TypeDef * |
eusart,
|
uint32_t |
refFreq,
|
||
uint32_t |
baudrate
|
||
) |
Configures the baudrate (or as close as possible to a specified baudrate).
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. refFreq
The EUSART reference clock frequency in Hz that will be used. If set to 0, the currently configured peripheral clock is used. baudrate
A baudrate to try to achieve.
Configures the baudrate (or as close as possible to a specified baudrate).
- Note
- (1) When the oversampling is disabled, the peripheral clock frequency must be at least three times higher than the chosen baud rate.
◆ EUSART_BaudrateGet()
uint32_t EUSART_BaudrateGet | ( | EUSART_TypeDef * |
eusart
|
) |
Gets the current baudrate.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block.
- Returns
- The current baudrate.
◆ EUSART_RxBlock()
void EUSART_RxBlock | ( | EUSART_TypeDef * |
eusart,
|
EUSART_BlockRx_TypeDef |
enable
|
||
) |
Enables/Disables reception operation until the configured start frame is received.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. enable
Select the receiver blocking status.
Enables/Disables reception operation until the configured start frame is received.
◆ EUSART_TxTristateSet()
void EUSART_TxTristateSet | ( | EUSART_TypeDef * |
eusart,
|
EUSART_TristateTx_TypeDef |
enable
|
||
) |
Enables/Disables the tristating of the transmitter output.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. enable
Select the transmitter tristate status.
◆ EUSART_PrsTriggerEnable()
void EUSART_PrsTriggerEnable | ( | EUSART_TypeDef * |
eusart,
|
const EUSART_PrsTriggerInit_TypeDef * |
init
|
||
) |
Initializes the automatic enabling of transmissions and/or reception using the PRS as a trigger.
- Note
- Initialize EUSART with sl_eusart_initHf() or sl_eusart_initLf() before enabling the PRS trigger.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. init
Pointer to the initialization structure.
◆ EUSART_StatusGet()
|
inline |
Gets EUSART STATUS register.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block.
- Returns
- STATUS register value.
◆ EUSART_IntClear()
|
inline |
Clears one or more pending EUSART interrupts.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. flags
Pending EUSART interrupt source to clear. Use a bitwise logic OR combination of valid interrupt flags for EUSART module (EUSART_IF_nnn).
◆ EUSART_IntDisable()
|
inline |
Disables one or more EUSART interrupts.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. flags
Pending EUSART interrupt source to clear. Use a bitwise logic OR combination of valid interrupt flags for EUSART module (EUSART_IF_nnn).
◆ EUSART_IntEnable()
|
inline |
Enables one or more EUSART interrupts.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. flags
Pending EUSART interrupt source to clear. Use a bitwise logic OR combination of valid interrupt flags for EUSART module (EUSART_IF_nnn).
◆ EUSART_IntGet()
|
inline |
Gets pending EUSART interrupt flags.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block.
- Returns
- Pending EUSART interrupt sources.
◆ EUSART_IntGetEnabled()
|
inline |
Gets enabled and pending EUSART interrupt flags.
Useful for handling more interrupt sources in the same interrupt handler.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block.
- Returns
- Pending and enabled EUSART interrupt sources.
◆ EUSART_IntSet()
|
inline |
Sets one or more pending EUSART interrupts from SW.
- Parameters
-
eusart
Pointer to the EUSART peripheral register block. flags
Interrupt source(s) to set to pending. Use a bitwise logic OR combination of valid interrupt flags for EUSART module (EUSART_IF_nnn).
Macro Definition Documentation
◆ EUSART_UART_INIT_DEFAULT_HF
#define EUSART_UART_INIT_DEFAULT_HF |
Default configuration for EUSART initialization structure in UART mode with high-frequency clock.
◆ EUSART_DEFAULT_START_FRAME
#define EUSART_DEFAULT_START_FRAME 0x00u |
Default start frame configuration, i.e. feature disabled.
◆ EUSART_ADVANCED_INIT_DEFAULT
#define EUSART_ADVANCED_INIT_DEFAULT |
Default configuration for EUSART advanced initialization structure.
◆ EUSART_UART_INIT_DEFAULT_LF
#define EUSART_UART_INIT_DEFAULT_LF |
Default configuration for EUSART initialization structure in UART mode with low-frequency clock.
◆ EUSART_IRDA_INIT_DEFAULT_HF
#define EUSART_IRDA_INIT_DEFAULT_HF |
Default configuration for EUSART initialization structure in IrDA mode with high-frequency clock.
◆ EUSART_IRDA_INIT_DEFAULT_LF
#define EUSART_IRDA_INIT_DEFAULT_LF |
Default configuration for EUSART initialization structure in IrDA mode with low-frequency clock.
◆ EUSART_SPI_ADVANCED_INIT_DEFAULT
#define EUSART_SPI_ADVANCED_INIT_DEFAULT |
Default advanced configuration for EUSART initialization structure in SPI mode with high-frequency clock.
◆ EUSART_SPI_MASTER_INIT_DEFAULT_HF
#define EUSART_SPI_MASTER_INIT_DEFAULT_HF |
Default configuration for EUSART initialization structure in SPI master mode with high-frequency clock.
◆ EUSART_SPI_SLAVE_INIT_DEFAULT_HF
#define EUSART_SPI_SLAVE_INIT_DEFAULT_HF |
Default configuration for EUSART initialization structure in SPI slave mode with high-frequency clock.
◆ EUSART_ADVANCED_DALI_INIT_DEFAULT
#define EUSART_ADVANCED_DALI_INIT_DEFAULT |
Default configuration for EUSART initialization structure in DALI mode with high-frequency clock.
Default configuration for EUSART advanced initialization structure.
◆ EUSART_UART_DALI_INIT_DEFAULT_HF
#define EUSART_UART_DALI_INIT_DEFAULT_HF |
Default configuration for EUSART initialization structure in DALI mode with high-frequency clock.
◆ EUSART_UART_DALI_INIT_DEFAULT_LF
#define EUSART_UART_DALI_INIT_DEFAULT_LF |
Default configuration for EUSART initialization structure in DALI mode with low-frequency clock.
◆ EUSART_DALI_INIT_DEFAULT_HF
#define EUSART_DALI_INIT_DEFAULT_HF |
Default configuration for EUSART initialization structure in DALI mode with high-frequency clock.
◆ EUSART_DALI_INIT_DEFAULT_LF
#define EUSART_DALI_INIT_DEFAULT_LF |
Default configuration for EUSART initialization structure in DALI mode with low-frequency clock.
Typedef Documentation
◆ EUSART_PrsChannel_TypeDef
typedef uint8_t EUSART_PrsChannel_TypeDef |
PRS Channel type.
Enumeration Type Documentation
◆ EUSART_Enable_TypeDef
◆ EUSART_Databits_TypeDef
Data bit selection.
◆ EUSART_Parity_TypeDef
◆ EUSART_Stopbits_TypeDef
◆ EUSART_OVS_TypeDef
enum EUSART_OVS_TypeDef |
◆ EUSART_HwFlowControl_TypeDef
◆ EUSART_LoopbackEnable_TypeDef
◆ EUSART_MajorityVote_TypeDef
◆ EUSART_BlockRx_TypeDef
◆ EUSART_TristateTx_TypeDef
◆ EUSART_IrDARxFilterEnable_TypeDef
◆ EUSART_IrDAPulseWidth_Typedef
Pulse width selection for IrDA mode.
◆ EUSART_PrsTriggerEnable_TypeDef
PRS trigger enable.
◆ EUSART_InvertIO_TypeDef
◆ EUSART_ClockMode_TypeDef
◆ EUSART_CsPolarity_TypeDef
◆ EUSART_DaliTxDatabits_TypeDef
DALI TX databits (8-32).
◆ EUSART_DaliRxDatabits_TypeDef
DALI RX databits (8-32).