EFM32 Giant Gecko Software Documentation  efm32gg-doc-5.1.2
em_usart.h
Go to the documentation of this file.
1 /***************************************************************************/
35 #ifndef EM_USART_H
36 #define EM_USART_H
37 
38 #include "em_device.h"
39 #if defined(USART_COUNT) && (USART_COUNT > 0)
40 
41 #include <stdbool.h>
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /***************************************************************************/
52 /***************************************************************************/
100 /*******************************************************************************
101  ******************************** ENUMS ************************************
102  ******************************************************************************/
103 
105 typedef enum
106 {
121 
122 
124 typedef enum
125 {
128 
131 
134 
138 
139 
141 typedef enum
142 {
148 
149 
151 typedef enum
152 {
157 
158 
160 typedef enum
161 {
167 
168 
170 typedef enum
171 {
174 
177 
180 
184 
185 
187 typedef enum
188 {
191 
194 
197 
201 
202 
204 typedef enum
205 {
210 #if defined(USART_IRCTRL_IRPRSSEL_PRSCH4)
212 #endif
213 #if defined(USART_IRCTRL_IRPRSSEL_PRSCH5)
215 #endif
216 #if defined(USART_IRCTRL_IRPRSSEL_PRSCH6)
218 #endif
219 #if defined(USART_IRCTRL_IRPRSSEL_PRSCH7)
221 #endif
223 
224 #if defined(_USART_I2SCTRL_MASK)
225 
226 typedef enum
227 {
237 
239 typedef enum
240 {
244 #endif
245 
246 #if defined(_USART_INPUT_MASK)
247 
248 typedef enum
249 {
255 #if defined(USART_INPUT_RXPRSSEL_PRSCH7)
260 #endif
261 
262 #if defined(USART_INPUT_RXPRSSEL_PRSCH11)
267 #endif
269 #endif
270 
272 typedef enum
273 {
279 #if defined(USART_TRIGCTRL_TSEL_PRSCH7)
284 #endif
286 
287 /*******************************************************************************
288  ******************************* STRUCTS ***********************************
289  ******************************************************************************/
290 
292 typedef struct
293 {
296 
301  uint32_t refFreq;
302 
304  uint32_t baudrate;
305 
308 
312 
315 
318 
319 #if defined(USART_INPUT_RXPRS) && defined(USART_CTRL_MVDIS)
320 
321  bool mvdis;
322 
325 
328 #endif
329 #if defined(_USART_TIMING_CSHOLD_MASK)
330 
331  bool autoCsEnable;
333  uint8_t autoCsHold;
335  uint8_t autoCsSetup;
336 #endif
338 
340 typedef struct
341 {
342 #if defined(USART_TRIGCTRL_AUTOTXTEN)
343 
345 #endif
346 
353 
355 #if defined(_USART_TIMING_CSHOLD_MASK) && defined(USART_CTRL_MVDIS)
356 #define USART_INITASYNC_DEFAULT \
357 { \
358  usartEnable, /* Enable RX/TX when init completed. */ \
359  0, /* Use current configured reference clock for configuring baudrate. */ \
360  115200, /* 115200 bits/s. */ \
361  usartOVS16, /* 16x oversampling. */ \
362  usartDatabits8, /* 8 databits. */ \
363  usartNoParity, /* No parity. */ \
364  usartStopbits1, /* 1 stopbit. */ \
365  false, /* Do not disable majority vote. */ \
366  false, /* Not USART PRS input mode. */ \
367  usartPrsRxCh0, /* PRS channel 0. */ \
368  false, /* Auto CS functionality enable/disable switch */ \
369  0, /* Auto CS Hold cycles */ \
370  0 /* Auto CS Setup cycles */ \
371 }
372 #elif defined(USART_INPUT_RXPRS) && defined(USART_CTRL_MVDIS)
373 #define USART_INITASYNC_DEFAULT \
374 { \
375  usartEnable, /* Enable RX/TX when init completed. */ \
376  0, /* Use current configured reference clock for configuring baudrate. */ \
377  115200, /* 115200 bits/s. */ \
378  usartOVS16, /* 16x oversampling. */ \
379  usartDatabits8, /* 8 databits. */ \
380  usartNoParity, /* No parity. */ \
381  usartStopbits1, /* 1 stopbit. */ \
382  false, /* Do not disable majority vote. */ \
383  false, /* Not USART PRS input mode. */ \
384  usartPrsRxCh0 /* PRS channel 0. */ \
385 }
386 #else
387 #define USART_INITASYNC_DEFAULT \
388 { \
389  usartEnable, /* Enable RX/TX when init completed. */ \
390  0, /* Use current configured reference clock for configuring baudrate. */ \
391  115200, /* 115200 bits/s. */ \
392  usartOVS16, /* 16x oversampling. */ \
393  usartDatabits8, /* 8 databits. */ \
394  usartNoParity, /* No parity. */ \
395  usartStopbits1 /* 1 stopbit. */ \
396 }
397 #endif
398 
400 #if defined(USART_TRIGCTRL_AUTOTXTEN)
401 #define USART_INITPRSTRIGGER_DEFAULT \
402 { \
403  false, /* Do not enable autoTX triggering. */ \
404  false, /* Do not enable receive triggering. */ \
405  false, /* Do not enable transmit triggering. */ \
406  usartPrsTriggerCh0 /* Set default channel to zero. */ \
407 }
408 #else
409 #define USART_INITPRSTRIGGER_DEFAULT \
410 { \
411  false, /* Do not enable receive triggering. */ \
412  false, /* Do not enable transmit triggering. */ \
413  usartPrsTriggerCh0 /* Set default channel to zero. */ \
414 }
415 #endif
416 
418 typedef struct
419 {
422 
427  uint32_t refFreq;
428 
430  uint32_t baudrate;
431 
434 
436  bool master;
437 
439  bool msbf;
440 
443 
444 #if defined(USART_INPUT_RXPRS) && defined(USART_TRIGCTRL_AUTOTXTEN)
445 
447 
450 
453  bool autoTx;
454 #endif
455 #if defined(_USART_TIMING_CSHOLD_MASK)
456 
457  bool autoCsEnable;
459  uint8_t autoCsHold;
461  uint8_t autoCsSetup;
462 #endif
464 
466 #if defined(_USART_TIMING_CSHOLD_MASK)
467 #define USART_INITSYNC_DEFAULT \
468 { \
469  usartEnable, /* Enable RX/TX when init completed. */ \
470  0, /* Use current configured reference clock for configuring baudrate. */ \
471  1000000, /* 1 Mbits/s. */ \
472  usartDatabits8, /* 8 databits. */ \
473  true, /* Master mode. */ \
474  false, /* Send least significant bit first. */ \
475  usartClockMode0, /* Clock idle low, sample on rising edge. */ \
476  false, /* Not USART PRS input mode. */ \
477  usartPrsRxCh0, /* PRS channel 0. */ \
478  false, /* No AUTOTX mode. */ \
479  false, /* No AUTOCS mode */ \
480  0, /* Auto CS Hold cycles */ \
481  0 /* Auto CS Setup cycles */ \
482 }
483 #elif defined(USART_INPUT_RXPRS) && defined(USART_TRIGCTRL_AUTOTXTEN)
484 #define USART_INITSYNC_DEFAULT \
485 { \
486  usartEnable, /* Enable RX/TX when init completed. */ \
487  0, /* Use current configured reference clock for configuring baudrate. */ \
488  1000000, /* 1 Mbits/s. */ \
489  usartDatabits8, /* 8 databits. */ \
490  true, /* Master mode. */ \
491  false, /* Send least significant bit first. */ \
492  usartClockMode0, /* Clock idle low, sample on rising edge. */ \
493  false, /* Not USART PRS input mode. */ \
494  usartPrsRxCh0, /* PRS channel 0. */ \
495  false /* No AUTOTX mode. */ \
496 }
497 #else
498 #define USART_INITSYNC_DEFAULT \
499 { \
500  usartEnable, /* Enable RX/TX when init completed. */ \
501  0, /* Use current configured reference clock for configuring baudrate. */ \
502  1000000, /* 1 Mbits/s. */ \
503  usartDatabits8, /* 8 databits. */ \
504  true, /* Master mode. */ \
505  false, /* Send least significant bit first. */ \
506  usartClockMode0 /* Clock idle low, sample on rising edge. */ \
507 }
508 #endif
509 
510 
512 typedef struct
513 {
516 
518  bool irRxInv;
519 
521  bool irFilt;
522 
526 
529  bool irPrsEn;
530 
535 
536 
538 #if defined(_USART_TIMING_CSHOLD_MASK) && defined(USART_CTRL_MVDIS)
539 #define USART_INITIRDA_DEFAULT \
540 { \
541  { \
542  usartEnable, /* Enable RX/TX when init completed. */ \
543  0, /* Use current configured reference clock for configuring baudrate. */ \
544  115200, /* 115200 bits/s. */ \
545  usartOVS16, /* 16x oversampling. */ \
546  usartDatabits8, /* 8 databits. */ \
547  usartEvenParity, /* Even parity. */ \
548  usartStopbits1, /* 1 stopbit. */ \
549  false, /* Do not disable majority vote. */ \
550  false, /* Not USART PRS input mode. */ \
551  usartPrsRxCh0, /* PRS channel 0. */ \
552  false, /* Auto CS functionality enable/disable switch */ \
553  0, /* Auto CS Hold cycles */ \
554  0 /* Auto CS Setup cycles */ \
555  }, \
556  false, /* Rx invert disabled. */ \
557  false, /* Filtering disabled. */ \
558  usartIrDAPwTHREE, /* Pulse width is set to ONE. */ \
559  false, /* Routing to PRS is disabled. */ \
560  usartIrDAPrsCh0 /* PRS channel 0. */ \
561 }
562 #elif defined(USART_INPUT_RXPRS) && defined(USART_CTRL_MVDIS)
563 #define USART_INITIRDA_DEFAULT \
564 { \
565  { \
566  usartEnable, /* Enable RX/TX when init completed. */ \
567  0, /* Use current configured reference clock for configuring baudrate. */ \
568  115200, /* 115200 bits/s. */ \
569  usartOVS16, /* 16x oversampling. */ \
570  usartDatabits8, /* 8 databits. */ \
571  usartEvenParity, /* Even parity. */ \
572  usartStopbits1, /* 1 stopbit. */ \
573  false, /* Do not disable majority vote. */ \
574  false, /* Not USART PRS input mode. */ \
575  usartPrsRxCh0 /* PRS channel 0. */ \
576  }, \
577  false, /* Rx invert disabled. */ \
578  false, /* Filtering disabled. */ \
579  usartIrDAPwTHREE, /* Pulse width is set to ONE. */ \
580  false, /* Routing to PRS is disabled. */ \
581  usartIrDAPrsCh0 /* PRS channel 0. */ \
582 }
583 #else
584 #define USART_INITIRDA_DEFAULT \
585 { \
586  { \
587  usartEnable, /* Enable RX/TX when init completed. */ \
588  0, /* Use current configured reference clock for configuring baudrate. */ \
589  115200, /* 115200 bits/s. */ \
590  usartOVS16, /* 16x oversampling. */ \
591  usartDatabits8, /* 8 databits. */ \
592  usartEvenParity, /* Even parity. */ \
593  usartStopbits1 /* 1 stopbit. */ \
594  }, \
595  false, /* Rx invert disabled. */ \
596  false, /* Filtering disabled. */ \
597  usartIrDAPwTHREE, /* Pulse width is set to ONE. */ \
598  false, /* Routing to PRS is disabled. */ \
599  usartIrDAPrsCh0 /* PRS channel 0. */ \
600 }
601 #endif
602 
603 #if defined(_USART_I2SCTRL_MASK)
604 
605 typedef struct
606 {
609 
612 
616  bool delay;
617 
619  bool dmaSplit;
620 
623 
625  bool mono;
627 
628 
630 #if defined(_USART_TIMING_CSHOLD_MASK)
631 #define USART_INITI2S_DEFAULT \
632 { \
633  { \
634  usartEnableTx, /* Enable TX when init completed. */ \
635  0, /* Use current configured reference clock for configuring baudrate. */ \
636  1000000, /* Baudrate 1M bits/s. */ \
637  usartDatabits16, /* 16 databits. */ \
638  true, /* Operate as I2S master. */ \
639  true, /* Most significant bit first. */ \
640  usartClockMode0, /* Clock idle low, sample on rising edge. */ \
641  false, /* Don't enable USARTRx via PRS. */ \
642  usartPrsRxCh0, /* PRS channel selection (dummy). */ \
643  false, /* Disable AUTOTX mode. */ \
644  false, /* No AUTOCS mode */ \
645  0, /* Auto CS Hold cycles */ \
646  0 /* Auto CS Setup cycles */ \
647  }, \
648  usartI2sFormatW16D16, /* 16-bit word, 16-bit data */ \
649  true, /* Delay on I2S data. */ \
650  false, /* No DMA split. */ \
651  usartI2sJustifyLeft, /* Data is left-justified within the frame */ \
652  false /* Stereo mode. */ \
653 }
654 #else
655 #define USART_INITI2S_DEFAULT \
656 { \
657  { \
658  usartEnableTx, /* Enable TX when init completed. */ \
659  0, /* Use current configured reference clock for configuring baudrate. */ \
660  1000000, /* Baudrate 1M bits/s. */ \
661  usartDatabits16, /* 16 databits. */ \
662  true, /* Operate as I2S master. */ \
663  true, /* Most significant bit first. */ \
664  usartClockMode0, /* Clock idle low, sample on rising edge. */ \
665  false, /* Don't enable USARTRx via PRS. */ \
666  usartPrsRxCh0, /* PRS channel selection (dummy). */ \
667  false /* Disable AUTOTX mode. */ \
668  }, \
669  usartI2sFormatW16D16, /* 16-bit word, 16-bit data */ \
670  true, /* Delay on I2S data. */ \
671  false, /* No DMA split. */ \
672  usartI2sJustifyLeft, /* Data is left-justified within the frame */ \
673  false /* Stereo mode. */ \
674 }
675 #endif
676 #endif
677 
678 /*******************************************************************************
679  ***************************** PROTOTYPES **********************************
680  ******************************************************************************/
681 
683  uint32_t refFreq,
684  uint32_t baudrate,
685  USART_OVS_TypeDef ovs);
686 uint32_t USART_BaudrateCalc(uint32_t refFreq,
687  uint32_t clkdiv,
688  bool syncmode,
689  USART_OVS_TypeDef ovs);
690 uint32_t USART_BaudrateGet(USART_TypeDef *usart);
692  uint32_t refFreq,
693  uint32_t baudrate);
694 void USART_Enable(USART_TypeDef *usart, USART_Enable_TypeDef enable);
695 
696 void USART_InitAsync(USART_TypeDef *usart, const USART_InitAsync_TypeDef *init);
697 void USART_InitSync(USART_TypeDef *usart, const USART_InitSync_TypeDef *init);
698 void USARTn_InitIrDA(USART_TypeDef *usart, const USART_InitIrDA_TypeDef *init);
699 
700 #if defined(_USART_I2SCTRL_MASK)
702 #endif
704 
705 #if defined(DEFAULT_IRDA_USART) || defined(USART0) || ((USART_COUNT == 1) && defined(USART1))
706 /***************************************************************************/
733 __STATIC_INLINE void USART_InitIrDA(const USART_InitIrDA_TypeDef *init)
734 {
735 #if defined(DEFAULT_IRDA_USART)
736  USART_TypeDef *usart = DEFAULT_IRDA_USART;
737 #elif (USART_COUNT == 1) && defined(USART1)
738  USART_TypeDef *usart = USART1;
739 #else
740  USART_TypeDef *usart = USART0;
741 #endif
742  USARTn_InitIrDA(usart, init);
743 }
744 #endif
745 
746 /***************************************************************************/
757 __STATIC_INLINE void USART_IntClear(USART_TypeDef *usart, uint32_t flags)
758 {
759  usart->IFC = flags;
760 }
761 
762 
763 /***************************************************************************/
774 __STATIC_INLINE void USART_IntDisable(USART_TypeDef *usart, uint32_t flags)
775 {
776  usart->IEN &= ~flags;
777 }
778 
779 
780 /***************************************************************************/
796 __STATIC_INLINE void USART_IntEnable(USART_TypeDef *usart, uint32_t flags)
797 {
798  usart->IEN |= flags;
799 }
800 
801 
802 /***************************************************************************/
816 __STATIC_INLINE uint32_t USART_IntGet(USART_TypeDef *usart)
817 {
818  return usart->IF;
819 }
820 
821 
822 /***************************************************************************/
841 __STATIC_INLINE uint32_t USART_IntGetEnabled(USART_TypeDef *usart)
842 {
843  uint32_t ien;
844 
845  /* Store USARTx->IEN in temporary variable in order to define explicit order
846  * of volatile accesses. */
847  ien = usart->IEN;
848 
849  /* Bitwise AND of pending and enabled interrupts */
850  return usart->IF & ien;
851 }
852 
853 
854 /***************************************************************************/
865 __STATIC_INLINE void USART_IntSet(USART_TypeDef *usart, uint32_t flags)
866 {
867  usart->IFS = flags;
868 }
869 
870 
871 /***************************************************************************/
882 __STATIC_INLINE uint32_t USART_StatusGet(USART_TypeDef *usart)
883 {
884  return usart->STATUS;
885 }
886 
887 void USART_Reset(USART_TypeDef *usart);
888 uint8_t USART_Rx(USART_TypeDef *usart);
889 uint16_t USART_RxDouble(USART_TypeDef *usart);
890 uint32_t USART_RxDoubleExt(USART_TypeDef *usart);
891 uint16_t USART_RxExt(USART_TypeDef *usart);
892 
893 
894 /***************************************************************************/
922 __STATIC_INLINE uint8_t USART_RxDataGet(USART_TypeDef *usart)
923 {
924  return (uint8_t)usart->RXDATA;
925 }
926 
927 
928 /***************************************************************************/
960 __STATIC_INLINE uint16_t USART_RxDoubleGet(USART_TypeDef *usart)
961 {
962  return (uint16_t)usart->RXDOUBLE;
963 }
964 
965 
966 /***************************************************************************/
996 __STATIC_INLINE uint32_t USART_RxDoubleXGet(USART_TypeDef *usart)
997 {
998  return usart->RXDOUBLEX;
999 }
1000 
1001 
1002 /***************************************************************************/
1031 __STATIC_INLINE uint16_t USART_RxDataXGet(USART_TypeDef *usart)
1032 {
1033  return (uint16_t)usart->RXDATAX;
1034 }
1035 
1036 uint8_t USART_SpiTransfer(USART_TypeDef *usart, uint8_t data);
1037 void USART_Tx(USART_TypeDef *usart, uint8_t data);
1038 void USART_TxDouble(USART_TypeDef *usart, uint16_t data);
1039 void USART_TxDoubleExt(USART_TypeDef *usart, uint32_t data);
1040 void USART_TxExt(USART_TypeDef *usart, uint16_t data);
1041 
1042 
1046 #ifdef __cplusplus
1047 }
1048 #endif
1049 
1050 #endif /* defined(USART_COUNT) && (USART_COUNT > 0) */
1051 #endif /* EM_USART_H */
#define USART_FRAME_STOPBITS_ONEANDAHALF
#define USART_I2SCTRL_FORMAT_W8D8
#define USART_CTRL_OVS_X16
#define USART_CTRL_OVS_X6
#define USART_TRIGCTRL_TSEL_PRSCH0
#define USART1
USART_Stopbits_TypeDef stopbits
Definition: em_usart.h:317
USART_I2sJustify_TypeDef justify
Definition: em_usart.h:622
#define USART_CTRL_CLKPOL_IDLEHIGH
__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...
Definition: em_usart.h:841
void USART_Tx(USART_TypeDef *usart, uint8_t data)
Transmit one 4-9 bit frame.
Definition: em_usart.c:1084
#define USART_FRAME_DATABITS_FOURTEEN
#define USART_I2SCTRL_FORMAT_W32D16
#define USART_CTRL_CLKPOL_IDLELOW
USART_PrsTriggerCh_TypeDef prsTriggerChannel
Definition: em_usart.h:351
void USART_InitSync(USART_TypeDef *usart, const USART_InitSync_TypeDef *init)
Init USART for synchronous mode.
Definition: em_usart.c:640
#define USART_IRCTRL_IRPW_FOUR
USART_OVS_TypeDef oversampling
Definition: em_usart.h:307
#define USART_TRIGCTRL_TSEL_PRSCH5
#define USART_FRAME_DATABITS_THIRTEEN
#define USART_FRAME_DATABITS_FOUR
__STATIC_INLINE void USART_IntClear(USART_TypeDef *usart, uint32_t flags)
Clear one or more pending USART interrupts.
Definition: em_usart.h:757
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...
Definition: em_usart.c:480
#define USART_CTRL_OVS_X4
#define USART_INPUT_RXPRSSEL_PRSCH9
__IM uint32_t RXDATAX
Definition: efm32gg_usart.h:49
#define USART_IRCTRL_IRPRSSEL_PRSCH6
#define USART_IRCTRL_IRPRSSEL_PRSCH5
USART_Databits_TypeDef databits
Definition: em_usart.h:311
#define USART_TRIGCTRL_TSEL_PRSCH3
uint8_t USART_Rx(USART_TypeDef *usart)
Receive one 4-8 bit frame, (or part of 10-16 bit frame).
Definition: em_usart.c:923
#define USART_IRCTRL_IRPRSSEL_PRSCH7
USART_InitAsync_TypeDef async
Definition: em_usart.h:515
__IM uint32_t IF
Definition: efm32gg_usart.h:59
#define USART_INPUT_RXPRSSEL_PRSCH11
#define USART_IRCTRL_IRPRSSEL_PRSCH0
#define USART_INPUT_RXPRSSEL_PRSCH10
void USART_TxDoubleExt(USART_TypeDef *usart, uint32_t data)
Transmit two 4-9 bit frames, or one 10-16 bit frame with extended control.
Definition: em_usart.c:1156
USART_Stopbits_TypeDef
Definition: em_usart.h:160
USART_InitSync_TypeDef sync
Definition: em_usart.h:608
USART_IrDAPw_Typedef
Definition: em_usart.h:187
uint32_t USART_RxDoubleExt(USART_TypeDef *usart)
Receive two 4-9 bit frames, or one 10-16 bit frame with extended information.
Definition: em_usart.c:989
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...
Definition: em_usart.c:295
USART_PrsRxCh_TypeDef prsRxCh
Definition: em_usart.h:449
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
#define USART_I2SCTRL_FORMAT_W32D24M
#define USART_CTRL_CLKPHA_SAMPLETRAILING
USART_IrDAPw_Typedef irPw
Definition: em_usart.h:525
#define USART_CMD_TXEN
USART_Parity_TypeDef parity
Definition: em_usart.h:314
#define USART_CTRL_OVS_X8
USART_ClockMode_TypeDef
Definition: em_usart.h:170
__IOM uint32_t IFS
Definition: efm32gg_usart.h:60
#define USART_FRAME_DATABITS_ELEVEN
__STATIC_INLINE void USART_IntEnable(USART_TypeDef *usart, uint32_t flags)
Enable one or more USART interrupts.
Definition: em_usart.h:796
#define USART_I2SCTRL_JUSTIFY_RIGHT
USART_Enable_TypeDef enable
Definition: em_usart.h:295
#define USART_FRAME_DATABITS_FIVE
#define USART_FRAME_DATABITS_SIX
__STATIC_INLINE void USART_InitIrDA(const USART_InitIrDA_TypeDef *init)
Init DEFAULT_IRDA_USART for asynchronous IrDA mode.
Definition: em_usart.h:733
USART_PrsTriggerCh_TypeDef
Definition: em_usart.h:272
USART_I2sFormat_TypeDef format
Definition: em_usart.h:611
__IM uint32_t RXDATA
Definition: efm32gg_usart.h:50
#define USART_I2SCTRL_FORMAT_W32D32
#define USART_FRAME_DATABITS_SIXTEEN
#define USART_INPUT_RXPRSSEL_PRSCH0
__STATIC_INLINE uint32_t USART_IntGet(USART_TypeDef *usart)
Get pending USART interrupt flags.
Definition: em_usart.h:816
USART_IrDAPrsSel_Typedef
Definition: em_usart.h:204
#define USART_FRAME_STOPBITS_TWO
#define USART_FRAME_DATABITS_FIFTEEN
uint16_t USART_RxExt(USART_TypeDef *usart)
Receive one 4-9 bit frame, (or part of 10-16 bit frame) with extended information.
Definition: em_usart.c:1022
#define USART_INPUT_RXPRSSEL_PRSCH4
#define USART_INPUT_RXPRSSEL_PRSCH7
#define USART0
__STATIC_INLINE void USART_IntSet(USART_TypeDef *usart, uint32_t flags)
Set one or more pending USART interrupts from SW.
Definition: em_usart.h:865
#define USART_IRCTRL_IRPRSSEL_PRSCH3
USART_PrsRxCh_TypeDef
Definition: em_usart.h:248
__STATIC_INLINE uint16_t USART_RxDoubleGet(USART_TypeDef *usart)
Receive two 4-8 bit frames, or one 10-16 bit frame.
Definition: em_usart.h:960
#define USART_IRCTRL_IRPW_THREE
#define USART_INPUT_RXPRSSEL_PRSCH5
#define USART_FRAME_DATABITS_SEVEN
#define USART_IRCTRL_IRPRSSEL_PRSCH4
#define USART_INPUT_RXPRSSEL_PRSCH6
__STATIC_INLINE uint32_t USART_RxDoubleXGet(USART_TypeDef *usart)
Receive two 4-9 bit frames, or one 10-16 bit frame with extended information.
Definition: em_usart.h:996
#define USART_TRIGCTRL_TSEL_PRSCH2
USART_IrDAPrsSel_Typedef irPrsSel
Definition: em_usart.h:533
USART_Databits_TypeDef
Definition: em_usart.h:105
__IOM uint32_t IFC
Definition: efm32gg_usart.h:61
#define USART_INPUT_RXPRSSEL_PRSCH1
#define USART_I2SCTRL_JUSTIFY_LEFT
#define USART_FRAME_DATABITS_TEN
__IM uint32_t RXDOUBLE
Definition: efm32gg_usart.h:52
#define USART_TRIGCTRL_TSEL_PRSCH6
USART_ClockMode_TypeDef clockMode
Definition: em_usart.h:442
#define USART_INPUT_RXPRSSEL_PRSCH3
#define USART_FRAME_STOPBITS_ONE
#define USART_TRIGCTRL_TSEL_PRSCH7
__IM uint32_t RXDOUBLEX
Definition: efm32gg_usart.h:51
void USARTn_InitIrDA(USART_TypeDef *usart, const USART_InitIrDA_TypeDef *init)
Init USART for asynchronous IrDA mode.
Definition: em_usart.c:721
__STATIC_INLINE uint32_t USART_StatusGet(USART_TypeDef *usart)
Get USART STATUS register.
Definition: em_usart.h:882
#define USART_TRIGCTRL_TSEL_PRSCH1
#define USART_IRCTRL_IRPRSSEL_PRSCH1
#define USART_FRAME_PARITY_NONE
USART_Enable_TypeDef enable
Definition: em_usart.h:421
void USART_TxExt(USART_TypeDef *usart, uint16_t data)
Transmit one 4-9 bit frame with extended control.
Definition: em_usart.c:1184
USART_I2sJustify_TypeDef
Definition: em_usart.h:239
#define USART_FRAME_PARITY_ODD
#define USART_FRAME_PARITY_EVEN
USART_Databits_TypeDef databits
Definition: em_usart.h:433
__STATIC_INLINE void USART_IntDisable(USART_TypeDef *usart, uint32_t flags)
Disable one or more USART interrupts.
Definition: em_usart.h:774
#define USART_FRAME_DATABITS_EIGHT
#define USART_FRAME_DATABITS_NINE
void USART_Reset(USART_TypeDef *usart)
Reset USART/UART to same state as after a HW reset.
Definition: em_usart.c:856
#define USART_CTRL_CLKPHA_SAMPLELEADING
uint8_t USART_SpiTransfer(USART_TypeDef *usart, uint8_t data)
Perform one 8 bit frame SPI transfer.
Definition: em_usart.c:1050
USART_OVS_TypeDef
Definition: em_usart.h:141
#define USART_FRAME_DATABITS_TWELVE
void USART_InitI2s(USART_TypeDef *usart, USART_InitI2s_TypeDef *init)
Init USART for I2S mode.
Definition: em_usart.c:777
#define USART_IRCTRL_IRPRSSEL_PRSCH2
USART_Enable_TypeDef
Definition: em_usart.h:124
#define USART_I2SCTRL_FORMAT_W16D8
#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.
Definition: em_usart.h:1031
#define USART_FRAME_STOPBITS_HALF
void USART_Enable(USART_TypeDef *usart, USART_Enable_TypeDef enable)
Enable/disable USART/UART receiver and/or transmitter.
Definition: em_usart.c:527
void USART_InitPrsTrigger(USART_TypeDef *usart, const USART_PrsTriggerInit_TypeDef *init)
Initialize automatic transmissions using PRS channel as trigger.
Definition: em_usart.c:816
#define USART_IRCTRL_IRPW_ONE
#define USART_CMD_RXEN
void USART_InitAsync(USART_TypeDef *usart, const USART_InitAsync_TypeDef *init)
Init USART/UART for normal asynchronous mode.
Definition: em_usart.c:569
uint16_t USART_RxDouble(USART_TypeDef *usart)
Receive two 4-8 bit frames, or one 10-16 bit frame.
Definition: em_usart.c:956
USART_Parity_TypeDef
Definition: em_usart.h:151
uint32_t USART_BaudrateGet(USART_TypeDef *usart)
Get current baudrate for USART/UART.
Definition: em_usart.c:431
#define USART_I2SCTRL_FORMAT_W32D8
#define USART_I2SCTRL_FORMAT_W32D24
__IM uint32_t STATUS
Definition: efm32gg_usart.h:47
#define USART_IRCTRL_IRPW_TWO
__IOM uint32_t IEN
Definition: efm32gg_usart.h:62
#define USART_INPUT_RXPRSSEL_PRSCH2
__STATIC_INLINE uint8_t USART_RxDataGet(USART_TypeDef *usart)
Receive one 4-8 bit frame, (or part of 10-16 bit frame).
Definition: em_usart.h:922
void USART_TxDouble(USART_TypeDef *usart, uint16_t data)
Transmit two 4-9 bit frames, or one 10-16 bit frame.
Definition: em_usart.c:1120
USART_PrsRxCh_TypeDef prsRxCh
Definition: em_usart.h:327
#define USART_I2SCTRL_FORMAT_W16D16
#define USART_INPUT_RXPRSSEL_PRSCH8
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 ...
Definition: em_usart.c:164
USART_I2sFormat_TypeDef
Definition: em_usart.h:226