39 #if defined(USART_COUNT) && (USART_COUNT > 0)
210 #if defined(USART_IRCTRL_IRPRSSEL_PRSCH4)
213 #if defined(USART_IRCTRL_IRPRSSEL_PRSCH5)
216 #if defined(USART_IRCTRL_IRPRSSEL_PRSCH6)
217 usartIrDAPrsCh6 = USART_IRCTRL_IRPRSSEL_PRSCH6,
219 #if defined(USART_IRCTRL_IRPRSSEL_PRSCH7)
220 usartIrDAPrsCh7 = USART_IRCTRL_IRPRSSEL_PRSCH7,
224 #if defined(_USART_I2SCTRL_MASK)
246 #if defined(_USART_INPUT_MASK)
255 #if defined(USART_INPUT_RXPRSSEL_PRSCH7)
258 usartPrsRxCh6 = USART_INPUT_RXPRSSEL_PRSCH6,
259 usartPrsRxCh7 = USART_INPUT_RXPRSSEL_PRSCH7,
262 #if defined(USART_INPUT_RXPRSSEL_PRSCH11)
263 usartPrsRxCh8 = USART_INPUT_RXPRSSEL_PRSCH8,
264 usartPrsRxCh9 = USART_INPUT_RXPRSSEL_PRSCH9,
265 usartPrsRxCh10 = USART_INPUT_RXPRSSEL_PRSCH10,
266 usartPrsRxCh11 = USART_INPUT_RXPRSSEL_PRSCH11
279 #if defined(USART_TRIGCTRL_TSEL_PRSCH7)
282 usartPrsTriggerCh6 = USART_TRIGCTRL_TSEL_PRSCH6,
283 usartPrsTriggerCh7 = USART_TRIGCTRL_TSEL_PRSCH7,
319 #if defined(USART_INPUT_RXPRS) && defined(USART_CTRL_MVDIS)
329 #if defined(_USART_TIMING_CSHOLD_MASK)
342 #if defined(USART_TRIGCTRL_AUTOTXTEN)
355 #if defined(_USART_TIMING_CSHOLD_MASK) && defined(USART_CTRL_MVDIS)
356 #define USART_INITASYNC_DEFAULT \
372 #elif defined(USART_INPUT_RXPRS) && defined(USART_CTRL_MVDIS)
373 #define USART_INITASYNC_DEFAULT \
387 #define USART_INITASYNC_DEFAULT \
400 #if defined(USART_TRIGCTRL_AUTOTXTEN)
401 #define USART_INITPRSTRIGGER_DEFAULT \
409 #define USART_INITPRSTRIGGER_DEFAULT \
444 #if defined(USART_INPUT_RXPRS) && defined(USART_TRIGCTRL_AUTOTXTEN)
455 #if defined(_USART_TIMING_CSHOLD_MASK)
466 #if defined(_USART_TIMING_CSHOLD_MASK)
467 #define USART_INITSYNC_DEFAULT \
483 #elif defined(USART_INPUT_RXPRS) && defined(USART_TRIGCTRL_AUTOTXTEN)
484 #define USART_INITSYNC_DEFAULT \
498 #define USART_INITSYNC_DEFAULT \
538 #if defined(_USART_TIMING_CSHOLD_MASK) && defined(USART_CTRL_MVDIS)
539 #define USART_INITIRDA_DEFAULT \
562 #elif defined(USART_INPUT_RXPRS) && defined(USART_CTRL_MVDIS)
563 #define USART_INITIRDA_DEFAULT \
584 #define USART_INITIRDA_DEFAULT \
603 #if defined(_USART_I2SCTRL_MASK)
630 #if defined(_USART_TIMING_CSHOLD_MASK)
631 #define USART_INITI2S_DEFAULT \
648 usartI2sFormatW16D16, \
651 usartI2sJustifyLeft, \
655 #define USART_INITI2S_DEFAULT \
669 usartI2sFormatW16D16, \
672 usartI2sJustifyLeft, \
700 #if defined(_USART_I2SCTRL_MASK)
705 #if defined(DEFAULT_IRDA_USART) || defined(USART0) || ((USART_COUNT == 1) && defined(USART1))
735 #if defined(DEFAULT_IRDA_USART)
737 #elif (USART_COUNT == 1) && defined(USART1)
776 usart->
IEN &= ~flags;
850 return usart->
IF & ien;
924 return (uint8_t)usart->
RXDATA;
1033 return (uint16_t)usart->
RXDATAX;
USART_Stopbits_TypeDef stopbits
USART_I2sJustify_TypeDef justify
__STATIC_INLINE uint32_t USART_IntGetEnabled(USART_TypeDef *usart)
Get enabled and pending USART interrupt flags. Useful for handling more interrupt sources in the same...
#define USART_FRAME_PARITY_EVEN
void USART_Tx(USART_TypeDef *usart, uint8_t data)
Transmit one 4-9 bit frame.
#define USART_FRAME_DATABITS_SIXTEEN
#define USART_FRAME_DATABITS_FOUR
#define USART_CTRL_OVS_X4
USART_PrsTriggerCh_TypeDef prsTriggerChannel
#define USART_CTRL_CLKPOL_IDLEHIGH
void USART_InitSync(USART_TypeDef *usart, const USART_InitSync_TypeDef *init)
Init USART for synchronous mode.
USART_OVS_TypeDef oversampling
#define USART_IRCTRL_IRPRSSEL_PRSCH3
#define USART_FRAME_DATABITS_SEVEN
__STATIC_INLINE void USART_IntClear(USART_TypeDef *usart, uint32_t flags)
Clear one or more pending USART interrupts.
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 spe...
#define USART_IRCTRL_IRPRSSEL_PRSCH4
#define USART_TRIGCTRL_TSEL_PRSCH4
USART_Databits_TypeDef databits
#define USART_FRAME_STOPBITS_HALF
uint8_t USART_Rx(USART_TypeDef *usart)
Receive one 4-8 bit frame, (or part of 10-16 bit frame).
USART_InitAsync_TypeDef async
#define USART_IRCTRL_IRPW_FOUR
#define USART_TRIGCTRL_TSEL_PRSCH5
void USART_TxDoubleExt(USART_TypeDef *usart, uint32_t data)
Transmit two 4-9 bit frames, or one 10-16 bit frame with extended control.
#define USART_IRCTRL_IRPW_ONE
USART_InitSync_TypeDef sync
uint32_t USART_RxDoubleExt(USART_TypeDef *usart)
Receive two 4-9 bit frames, or one 10-16 bit frame with extended information.
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...
USART_PrsRxCh_TypeDef prsRxCh
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
USART_IrDAPw_Typedef irPw
USART_Parity_TypeDef parity
__STATIC_INLINE void USART_IntEnable(USART_TypeDef *usart, uint32_t flags)
Enable one or more USART interrupts.
USART_Enable_TypeDef enable
#define USART_I2SCTRL_FORMAT_W32D32
#define USART_I2SCTRL_FORMAT_W32D24M
__STATIC_INLINE void USART_InitIrDA(const USART_InitIrDA_TypeDef *init)
Init DEFAULT_IRDA_USART for asynchronous IrDA mode.
#define USART_INPUT_RXPRSSEL_PRSCH0
#define USART_CTRL_OVS_X8
#define USART_FRAME_DATABITS_ELEVEN
USART_PrsTriggerCh_TypeDef
USART_I2sFormat_TypeDef format
#define USART_FRAME_STOPBITS_ONEANDAHALF
#define USART_CTRL_OVS_X6
#define USART_FRAME_DATABITS_FIFTEEN
#define USART_FRAME_DATABITS_FOURTEEN
__STATIC_INLINE uint32_t USART_IntGet(USART_TypeDef *usart)
Get pending USART interrupt flags.
uint16_t USART_RxExt(USART_TypeDef *usart)
Receive one 4-9 bit frame, (or part of 10-16 bit frame) with extended information.
#define USART_TRIGCTRL_TSEL_PRSCH2
__STATIC_INLINE void USART_IntSet(USART_TypeDef *usart, uint32_t flags)
Set one or more pending USART interrupts from SW.
__STATIC_INLINE uint16_t USART_RxDoubleGet(USART_TypeDef *usart)
Receive two 4-8 bit frames, or one 10-16 bit frame.
#define USART_I2SCTRL_JUSTIFY_LEFT
__STATIC_INLINE uint32_t USART_RxDoubleXGet(USART_TypeDef *usart)
Receive two 4-9 bit frames, or one 10-16 bit frame with extended information.
#define USART_IRCTRL_IRPRSSEL_PRSCH5
#define USART_INPUT_RXPRSSEL_PRSCH4
USART_IrDAPrsSel_Typedef irPrsSel
#define USART_TRIGCTRL_TSEL_PRSCH1
#define USART_IRCTRL_IRPW_THREE
#define USART_INPUT_RXPRSSEL_PRSCH5
#define USART_IRCTRL_IRPRSSEL_PRSCH1
#define USART_FRAME_PARITY_ODD
#define USART_IRCTRL_IRPW_TWO
USART_ClockMode_TypeDef clockMode
#define USART_FRAME_DATABITS_EIGHT
#define USART_FRAME_DATABITS_NINE
#define USART_INPUT_RXPRSSEL_PRSCH2
void USARTn_InitIrDA(USART_TypeDef *usart, const USART_InitIrDA_TypeDef *init)
Init USART for asynchronous IrDA mode.
#define USART_I2SCTRL_FORMAT_W16D16
__STATIC_INLINE uint32_t USART_StatusGet(USART_TypeDef *usart)
Get USART STATUS register.
#define USART_INPUT_RXPRSSEL_PRSCH1
USART_Enable_TypeDef enable
#define USART_I2SCTRL_FORMAT_W8D8
#define USART_CTRL_OVS_X16
void USART_TxExt(USART_TypeDef *usart, uint16_t data)
Transmit one 4-9 bit frame with extended control.
USART_Databits_TypeDef databits
__STATIC_INLINE void USART_IntDisable(USART_TypeDef *usart, uint32_t flags)
Disable one or more USART interrupts.
#define USART_INPUT_RXPRSSEL_PRSCH3
#define USART_FRAME_DATABITS_TWELVE
void USART_Reset(USART_TypeDef *usart)
Reset USART/UART to same state as after a HW reset.
#define USART_IRCTRL_IRPRSSEL_PRSCH2
uint8_t USART_SpiTransfer(USART_TypeDef *usart, uint8_t data)
Perform one 8 bit frame SPI transfer.
#define USART_I2SCTRL_FORMAT_W16D8
#define USART_CTRL_CLKPOL_IDLELOW
void USART_InitI2s(USART_TypeDef *usart, USART_InitI2s_TypeDef *init)
Init USART for I2S mode.
#define USART_FRAME_DATABITS_THIRTEEN
#define USART_CTRL_CLKPHA_SAMPLELEADING
#define USART_FRAME_STOPBITS_TWO
__STATIC_INLINE uint16_t USART_RxDataXGet(USART_TypeDef *usart)
Receive one 4-9 bit frame, (or part of 10-16 bit frame) with extended information.
#define USART_I2SCTRL_FORMAT_W32D8
#define USART_TRIGCTRL_TSEL_PRSCH3
#define USART_IRCTRL_IRPRSSEL_PRSCH0
void USART_Enable(USART_TypeDef *usart, USART_Enable_TypeDef enable)
Enable/disable USART/UART receiver and/or transmitter.
void USART_InitPrsTrigger(USART_TypeDef *usart, const USART_PrsTriggerInit_TypeDef *init)
Initialize automatic transmissions using PRS channel as trigger.
void USART_InitAsync(USART_TypeDef *usart, const USART_InitAsync_TypeDef *init)
Init USART/UART for normal asynchronous mode.
uint16_t USART_RxDouble(USART_TypeDef *usart)
Receive two 4-8 bit frames, or one 10-16 bit frame.
#define USART_CTRL_CLKPHA_SAMPLETRAILING
uint32_t USART_BaudrateGet(USART_TypeDef *usart)
Get current baudrate for USART/UART.
#define USART_I2SCTRL_JUSTIFY_RIGHT
#define USART_FRAME_DATABITS_TEN
#define USART_TRIGCTRL_TSEL_PRSCH0
#define USART_FRAME_STOPBITS_ONE
#define USART_FRAME_DATABITS_FIVE
__STATIC_INLINE uint8_t USART_RxDataGet(USART_TypeDef *usart)
Receive one 4-8 bit frame, (or part of 10-16 bit frame).
#define USART_FRAME_DATABITS_SIX
void USART_TxDouble(USART_TypeDef *usart, uint16_t data)
Transmit two 4-9 bit frames, or one 10-16 bit frame.
USART_PrsRxCh_TypeDef prsRxCh
#define USART_I2SCTRL_FORMAT_W32D16
#define USART_FRAME_PARITY_NONE
#define USART_I2SCTRL_FORMAT_W32D24
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 ...