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)
219 #if defined(USART_IRCTRL_IRPRSSEL_PRSCH7)
224 #if defined(_USART_I2SCTRL_MASK)
228 usartI2sFormatW32D32 = USART_I2SCTRL_FORMAT_W32D32,
229 usartI2sFormatW32D24M = USART_I2SCTRL_FORMAT_W32D24M,
230 usartI2sFormatW32D24 = USART_I2SCTRL_FORMAT_W32D24,
231 usartI2sFormatW32D16 = USART_I2SCTRL_FORMAT_W32D16,
232 usartI2sFormatW32D8 = USART_I2SCTRL_FORMAT_W32D8,
233 usartI2sFormatW16D16 = USART_I2SCTRL_FORMAT_W16D16,
234 usartI2sFormatW16D8 = USART_I2SCTRL_FORMAT_W16D8,
235 usartI2sFormatW8D8 = USART_I2SCTRL_FORMAT_W8D8
236 } USART_I2sFormat_TypeDef;
241 usartI2sJustifyLeft = USART_I2SCTRL_JUSTIFY_LEFT,
242 usartI2sJustifyRight = USART_I2SCTRL_JUSTIFY_RIGHT
243 } USART_I2sJustify_TypeDef;
246 #if defined(_USART_INPUT_MASK)
250 usartPrsRxCh0 = USART_INPUT_RXPRSSEL_PRSCH0,
251 usartPrsRxCh1 = USART_INPUT_RXPRSSEL_PRSCH1,
252 usartPrsRxCh2 = USART_INPUT_RXPRSSEL_PRSCH2,
253 usartPrsRxCh3 = USART_INPUT_RXPRSSEL_PRSCH3,
255 #if defined(USART_INPUT_RXPRSSEL_PRSCH7)
256 usartPrsRxCh4 = USART_INPUT_RXPRSSEL_PRSCH4,
257 usartPrsRxCh5 = USART_INPUT_RXPRSSEL_PRSCH5,
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
268 } USART_PrsRxCh_TypeDef;
279 #if defined(USART_TRIGCTRL_TSEL_PRSCH7)
319 #if defined(USART_INPUT_RXPRS) && defined(USART_CTRL_MVDIS)
327 USART_PrsRxCh_TypeDef prsRxCh;
329 #if defined(_USART_TIMING_CSHOLD_MASK)
342 #if defined(USART_TRIGCTRL_AUTOTXTEN)
344 bool autoTxTriggerEnable;
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)
449 USART_PrsRxCh_TypeDef prsRxCh;
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)
611 USART_I2sFormat_TypeDef format;
622 USART_I2sJustify_TypeDef justify;
626 } USART_InitI2s_TypeDef;
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)
701 void USART_InitI2s(
USART_TypeDef *usart, USART_InitI2s_TypeDef *init);
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;
#define USART_TRIGCTRL_TSEL_PRSCH1
#define USART_CTRL_OVS_X16
USART_Stopbits_TypeDef stopbits
__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...
void USART_Tx(USART_TypeDef *usart, uint8_t data)
Transmit one 4-9 bit frame.
#define USART_IRCTRL_IRPRSSEL_PRSCH7
#define USART_FRAME_DATABITS_EIGHT
#define USART_IRCTRL_IRPRSSEL_PRSCH0
USART_PrsTriggerCh_TypeDef prsTriggerChannel
#define USART_IRCTRL_IRPRSSEL_PRSCH1
#define USART_TRIGCTRL_TSEL_PRSCH2
#define USART_FRAME_STOPBITS_ONEANDAHALF
void USART_InitSync(USART_TypeDef *usart, const USART_InitSync_TypeDef *init)
Init USART for synchronous mode.
#define USART_TRIGCTRL_TSEL_PRSCH7
USART_OVS_TypeDef oversampling
__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...
USART_Databits_TypeDef databits
#define USART_IRCTRL_IRPRSSEL_PRSCH3
uint8_t USART_Rx(USART_TypeDef *usart)
Receive one 4-8 bit frame, (or part of 10-16 bit frame).
#define USART_FRAME_DATABITS_FOURTEEN
USART_InitAsync_TypeDef async
void USART_TxDoubleExt(USART_TypeDef *usart, uint32_t data)
Transmit two 4-9 bit frames, or one 10-16 bit frame with extended control.
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...
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
#define USART_FRAME_DATABITS_SIXTEEN
USART_IrDAPw_Typedef irPw
USART_Parity_TypeDef parity
#define USART_IRCTRL_IRPW_FOUR
__STATIC_INLINE void USART_IntEnable(USART_TypeDef *usart, uint32_t flags)
Enable one or more USART interrupts.
#define USART_IRCTRL_IRPW_THREE
USART_Enable_TypeDef enable
#define USART_IRCTRL_IRPRSSEL_PRSCH4
__STATIC_INLINE void USART_InitIrDA(const USART_InitIrDA_TypeDef *init)
Init DEFAULT_IRDA_USART for asynchronous IrDA mode.
#define USART_CTRL_CLKPOL_IDLELOW
USART_PrsTriggerCh_TypeDef
#define USART_IRCTRL_IRPW_ONE
#define USART_FRAME_DATABITS_SEVEN
#define USART_CTRL_CLKPHA_SAMPLETRAILING
__STATIC_INLINE uint32_t USART_IntGet(USART_TypeDef *usart)
Get pending USART interrupt flags.
#define USART_IRCTRL_IRPRSSEL_PRSCH2
#define USART_FRAME_STOPBITS_TWO
#define USART_CTRL_OVS_X6
uint16_t USART_RxExt(USART_TypeDef *usart)
Receive one 4-9 bit frame, (or part of 10-16 bit frame) with extended information.
__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_FRAME_DATABITS_FIFTEEN
#define USART_TRIGCTRL_TSEL_PRSCH5
__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_TRIGCTRL_TSEL_PRSCH6
USART_IrDAPrsSel_Typedef irPrsSel
#define USART_TRIGCTRL_TSEL_PRSCH3
#define USART_TRIGCTRL_TSEL_PRSCH0
#define USART_FRAME_STOPBITS_HALF
USART_ClockMode_TypeDef clockMode
#define USART_FRAME_PARITY_ODD
#define USART_CTRL_CLKPOL_IDLEHIGH
void USARTn_InitIrDA(USART_TypeDef *usart, const USART_InitIrDA_TypeDef *init)
Init USART for asynchronous IrDA mode.
__STATIC_INLINE uint32_t USART_StatusGet(USART_TypeDef *usart)
Get USART STATUS register.
#define USART_FRAME_DATABITS_THIRTEEN
USART_Enable_TypeDef enable
#define USART_FRAME_STOPBITS_ONE
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.
void USART_Reset(USART_TypeDef *usart)
Reset USART/UART to same state as after a HW reset.
uint8_t USART_SpiTransfer(USART_TypeDef *usart, uint8_t data)
Perform one 8 bit frame SPI transfer.
#define USART_FRAME_DATABITS_TWELVE
#define USART_FRAME_DATABITS_FOUR
#define USART_CTRL_OVS_X4
#define USART_TRIGCTRL_TSEL_PRSCH4
__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_IRCTRL_IRPW_TWO
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.
#define USART_FRAME_PARITY_NONE
#define USART_CTRL_CLKPHA_SAMPLELEADING
void USART_InitAsync(USART_TypeDef *usart, const USART_InitAsync_TypeDef *init)
Init USART/UART for normal asynchronous mode.
#define USART_FRAME_PARITY_EVEN
uint16_t USART_RxDouble(USART_TypeDef *usart)
Receive two 4-8 bit frames, or one 10-16 bit frame.
#define USART_FRAME_DATABITS_SIX
uint32_t USART_BaudrateGet(USART_TypeDef *usart)
Get current baudrate for USART/UART.
#define USART_IRCTRL_IRPRSSEL_PRSCH6
#define USART_CTRL_OVS_X8
#define USART_FRAME_DATABITS_ELEVEN
#define USART_FRAME_DATABITS_FIVE
#define USART_FRAME_DATABITS_NINE
#define USART_FRAME_DATABITS_TEN
__STATIC_INLINE uint8_t USART_RxDataGet(USART_TypeDef *usart)
Receive one 4-8 bit frame, (or part of 10-16 bit frame).
void USART_TxDouble(USART_TypeDef *usart, uint16_t data)
Transmit two 4-9 bit frames, or one 10-16 bit frame.
#define USART_IRCTRL_IRPRSSEL_PRSCH5
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 ...