EFM32 Wonder Gecko Software Documentation  efm32wg-doc-5.1.2
em_lesense.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef EM_LESENSE_H
34 #define EM_LESENSE_H
35 
36 #include "em_device.h"
37 
38 #if defined(LESENSE_COUNT) && (LESENSE_COUNT > 0)
39 #include <stdint.h>
40 #include <stdbool.h>
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 
47 /***************************************************************************/
52 /***************************************************************************/
58 #define LESENSE_NUM_DECODER_STATES (_LESENSE_DECSTATE_DECSTATE_MASK + 1)
59 
61 #define LESENSE_NUM_CHANNELS 16
62 
63 /*******************************************************************************
64  ******************************** ENUMS ************************************
65  ******************************************************************************/
66 
71 typedef enum
72 {
82 
83 
85 typedef enum
86 {
89 
92 
96 
97 
101 typedef enum
102 {
107 #if defined( LESENSE_CTRL_PRSSEL_PRSCH4 )
109 #endif
110 #if defined( LESENSE_CTRL_PRSSEL_PRSCH5 )
112 #endif
113 #if defined( LESENSE_CTRL_PRSSEL_PRSCH6 )
115 #endif
116 #if defined( LESENSE_CTRL_PRSSEL_PRSCH7 )
118 #endif
119 #if defined( LESENSE_CTRL_PRSSEL_PRSCH8 )
121 #endif
122 #if defined( LESENSE_CTRL_PRSSEL_PRSCH9 )
124 #endif
125 #if defined( LESENSE_CTRL_PRSSEL_PRSCH10 )
127 #endif
128 #if defined( LESENSE_CTRL_PRSSEL_PRSCH11 )
130 #endif
132 
133 
135 typedef enum
136 {
139 
140 #if defined(_LESENSE_CTRL_ALTEXMAP_ACMP)
141 
143 #endif
144 
145 #if defined(_LESENSE_CTRL_ALTEXMAP_CH)
146 
148  lesenseAltExMapCH = _LESENSE_CTRL_ALTEXMAP_CH,
149 #endif
151 
152 
154 typedef enum
155 {
158 
162 
163 
165 typedef enum
166 {
169 
172 
178 
179 
181 typedef enum
182 {
185 
188 
192 
193 
195 typedef enum
196 {
200 
204 
208 
213 
214 
216 typedef enum
217 {
221 
222 #if defined(_LESENSE_PERCTRL_DACCH0DATA_ACMPTHRES)
223 
226 #endif
227 
228 #if defined(_LESENSE_PERCTRL_DACCH0DATA_THRES)
229 
231  lesenseThres = _LESENSE_PERCTRL_DACCH0DATA_THRES,
232 #endif
234 
235 #if defined(_LESENSE_PERCTRL_DACCH0CONV_MASK)
236 
237 typedef enum
238 {
242 
246 
250 
255 #endif
256 
257 #if defined(_LESENSE_PERCTRL_DACCH0OUT_MASK)
258 
259 typedef enum
260 {
264 
268 
272 
277 #endif
278 
279 
280 #if defined(_LESENSE_PERCTRL_DACREF_MASK)
281 
282 typedef enum
283 {
286 
290 #endif
291 
292 
294 typedef enum
295 {
299 
303 
308 
309 
311 typedef enum
312 {
315 
318 
321 
325 
326 
328 typedef enum
329 {
332 
336 
337 
339 typedef enum
340 {
343 
346 
347 #if defined(LESENSE_CH_INTERACT_SAMPLE_ADC)
348 
349  lesenseSampleModeADC = LESENSE_CH_INTERACT_SAMPLE_ADC,
350 
352  lesenseSampleModeADCDiff = LESENSE_CH_INTERACT_SAMPLE_ADCDIFF,
353 #endif
355 
356 
358 typedef enum
359 {
362 
365 
368 
372 
373 
375 typedef enum
376 {
379 
382 
385 
389 
390 
392 typedef enum
393 {
397 
401 
405 
406 #if defined(_LESENSE_IDLECONF_CH0_DAC)
407 
409  lesenseChPinIdleDACC = _LESENSE_IDLECONF_CH0_DAC
410 #else
411 
414 
418 #endif
420 
421 
423 typedef enum
424 {
427 
431 
432 
434 typedef enum
435 {
439 
444 
445 
446 #if defined(_LESENSE_CH_EVAL_MODE_MASK)
447 
448 typedef enum
449 {
455  lesenseEvalModeThreshold = _LESENSE_CH_EVAL_MODE_THRES,
456 
460  lesenseEvalModeSlidingWindow = _LESENSE_CH_EVAL_MODE_SLIDINGWIN,
461 
468  lesenseEvalModeStepDetection = _LESENSE_CH_EVAL_MODE_STEPDET,
469 } LESENSE_ChEvalMode_TypeDef;
470 #endif
471 
472 
474 typedef enum
475 {
479 
483 
488 
489 
491 typedef enum
492 {
496 
499 
502 
505 
508 
511 
514 
517 
520 
523 
526 
530 
531 
532 /*******************************************************************************
533  ******************************* STRUCTS ***********************************
534  ******************************************************************************/
535 
537 typedef struct
538 {
541 
544 
547 
549  bool invACMP0;
550 
552  bool invACMP1;
553 
556 
560 
563  bool bufOverWr;
564 
567 
570 
573 
575  bool debugRun;
577 
579 #define LESENSE_CORECTRL_DESC_DEFAULT \
580 { \
581  lesenseScanStartPeriodic, /* Start new scan each time the period counter overflows. */ \
582  lesensePRSCh0, /* Default PRS channel is selected. */ \
583  lesenseScanConfDirMap, /* Direct mapping SCANCONF register usage strategy. */ \
584  false, /* Don't invert ACMP0 output. */ \
585  false, /* Don't invert ACMP1 output. */ \
586  false, /* Disable dual sampling. */ \
587  true, /* Store scan result after each scan. */ \
588  true, /* Overwrite result buffer register even if it is full. */ \
589  lesenseBufTrigHalf, /* Trigger interrupt and DMA request if result buffer is half full. */ \
590  lesenseDMAWakeUpDisable, /* Don't wake up on DMA from EM2. */ \
591  lesenseBiasModeDontTouch, /* Don't touch bias configuration. */ \
592  true /* Keep LESENSE running in debug mode. */ \
593 }
594 
596 typedef struct
597 {
600  uint8_t startDelay;
601 
608 
610 #define LESENSE_TIMECTRL_DESC_DEFAULT \
611 { \
612  0U, /* No sensor interaction delay. */ \
613  false /* Don't delay the AUXHFRCO startup. */ \
614 }
615 
616 
618 typedef struct
619 {
622 
623 #if defined(_LESENSE_PERCTRL_DACCH0CONV_MASK)
624 
626 
629 #endif
630 
633 
634 #if defined(_LESENSE_PERCTRL_DACCH1CONV_MASK)
635 
637 
640 #endif
641 
642 #if defined(_LESENSE_PERCTRL_DACPRESC_MASK)
643 
645  uint8_t dacPresc;
646 #endif
647 
648 #if defined(_LESENSE_PERCTRL_DACREF_MASK)
649 
652 #endif
653 
656 
659 
662 
663 #if defined(_LESENSE_PERCTRL_DACCONVTRIG_MASK)
664 
666  bool dacScan;
667 #endif
669 
671 #if defined(_SILICON_LABS_32B_SERIES_0)
672 #define LESENSE_PERCTRL_DESC_DEFAULT \
673 { \
674  lesenseDACIfData, /* DAC channel 0 data is defined by DAC_CH0DATA register */ \
675  lesenseDACConvModeDisable, /* LESENSE does not control DAC CH0. */ \
676  lesenseDACOutModeDisable, /* DAC channel 0 output to pin disabled. */ \
677  lesenseDACIfData, /* DAC channel 1 data is defined by DAC_CH1DATA register */ \
678  lesenseDACConvModeDisable, /* LESENSE does not control DAC CH1. */ \
679  lesenseDACOutModeDisable, /* DAC channel 1 output to pin disabled. */ \
680  0U, /* DAC prescaling factor of 1 (0+1). */ \
681  lesenseDACRefVdd, /* DAC uses VDD reference. */ \
682  lesenseACMPModeMuxThres, /* LESENSE controls the input mux and the threshold value of ACMP0. */ \
683  lesenseACMPModeMuxThres, /* LESENSE controls the input mux and the threshold value of ACMP1. */ \
684  lesenseWarmupModeKeepWarm, /* Keep both ACMPs and the DAC powered up when LESENSE is idle. */ \
685 }
686 #else
687 #define LESENSE_PERCTRL_DESC_DEFAULT \
688 { \
689  lesenseDACIfData, /* DAC channel 0 data is defined by DAC_CH0DATA register. */ \
690  lesenseDACIfData, /* DAC channel 1 data is defined by DAC_CH1DATA register. */ \
691  lesenseACMPModeMuxThres, /* LESENSE controls the input mux and the threshold value of ACMP0. */ \
692  lesenseACMPModeMuxThres, /* LESENSE controls the input mux and the threshold value of ACMP1. */ \
693  lesenseWarmupModeKeepWarm, /* Keep both ACMPs and the DAC powered up when LESENSE is idle. */ \
694  false, /* DAC is enable for before every channel measurement. */ \
695 }
696 #endif
697 
699 typedef struct
700 {
703 
705  uint32_t initState;
706 
709  bool chkState;
710 
713  bool intMap;
714 
717  bool hystPRS0;
718 
721  bool hystPRS1;
722 
725  bool hystPRS2;
726 
729  bool hystIRQ;
730 
733  bool prsCount;
734 
737 
740 
743 
747 
749 #define LESENSE_DECCTRL_DESC_DEFAULT \
750 { \
751  lesenseDecInputSensorSt, /* The SENSORSTATE register is used as input to the decoder. */ \
752  0U, /* State 0 is the initial state of the decoder. */ \
753  false, /* Disable check of current state. */ \
754  true, /* Enable channel x % 16 interrupt on state x change. */ \
755  true, /* Enable decoder hysteresis on PRS0 output. */ \
756  true, /* Enable decoder hysteresis on PRS1 output. */ \
757  true, /* Enable decoder hysteresis on PRS2 output. */ \
758  true, /* Enable decoder hysteresis on PRS3 output. */ \
759  false, /* Disable count mode on decoder PRS channels 0 and 1*/ \
760  lesensePRSCh0, /* PRS Channel 0 as input for bit 0 of the LESENSE decoder. */ \
761  lesensePRSCh1, /* PRS Channel 1 as input for bit 1 of the LESENSE decoder. */ \
762  lesensePRSCh2, /* PRS Channel 2 as input for bit 2 of the LESENSE decoder. */ \
763  lesensePRSCh3, /* PRS Channel 3 as input for bit 3 of the LESENSE decoder. */ \
764 }
765 
766 
768 typedef struct
769 {
772 
775 
778 
782 
784 #define LESENSE_INIT_DEFAULT \
785 { \
786  .coreCtrl = LESENSE_CORECTRL_DESC_DEFAULT, /* Default core control parameters. */ \
787  .timeCtrl = LESENSE_TIMECTRL_DESC_DEFAULT, /* Default time control parameters. */ \
788  .perCtrl = LESENSE_PERCTRL_DESC_DEFAULT, /* Default peripheral control parameters. */ \
789  .decCtrl = LESENSE_DECCTRL_DESC_DEFAULT /* Default decoder control parameters. */ \
790 }
791 
792 
794 typedef struct
795 {
797  bool enaScanCh;
798 
800  bool enaPin;
801 
804  bool enaInt;
805 
809 
812 
814  bool useAltEx;
815 
818  bool shiftRes;
819 
821  bool invRes;
822 
826 
829 
832 
835  uint8_t exTime;
836 
840  uint8_t sampleDelay;
841 
845  uint16_t measDelay;
846 
856  uint16_t acmpThres;
857 
861 
864 
867  uint16_t cntThres;
868 
871 
872 #if defined(_LESENSE_CH_EVAL_MODE_MASK)
873 
874  LESENSE_ChEvalMode_TypeDef evalMode;
875 #endif
876 
878 
879 
881 typedef struct
882 {
886 
888 #if defined(_LESENSE_CH_EVAL_MODE_MASK)
889 #define LESENSE_CH_CONF_DEFAULT \
890 { \
891  true, /* Enable scan channel. */ \
892  true, /* Enable the assigned pin on scan channel. */ \
893  true, /* Enable interrupts on channel. */ \
894  lesenseChPinExHigh, /* Channel pin is high during the excitation period. */ \
895  lesenseChPinIdleLow, /* Channel pin is low during the idle period. */ \
896  false, /* Don't use alternate excitation pins for excitation. */ \
897  false, /* Disabled to shift results from this channel to the decoder register. */ \
898  false, /* Disabled to invert the scan result bit. */ \
899  false, /* Disabled to store counter value in the result buffer. */ \
900  lesenseClkLF, /* Use the LF clock for excitation timing. */ \
901  lesenseClkLF, /* Use the LF clock for sample timing. */ \
902  0x03U, /* Excitation time is set to 3(+1) excitation clock cycles. */ \
903  0x09U, /* Sample delay is set to 9(+1) sample clock cycles. */ \
904  0x06U, /* Measure delay is set to 6 excitation clock cycles.*/ \
905  0x00U, /* ACMP threshold has been set to 0. */ \
906  lesenseSampleModeACMP, /* ACMP output will be used in comparison. */ \
907  lesenseSetIntNone, /* No interrupt is generated by the channel. */ \
908  0xFFU, /* Counter threshold has bee set to 0xFF. */ \
909  lesenseCompModeLess, /* Compare mode has been set to trigger interrupt on "less". */ \
910  lesenseEvalModeThreshold /* Compare mode has been set to trigger interrupt on "less". */ \
911 }
912 #else
913 #define LESENSE_CH_CONF_DEFAULT \
914 { \
915  true, /* Enable scan channel. */ \
916  true, /* Enable the assigned pin on scan channel. */ \
917  true, /* Enable interrupts on channel. */ \
918  lesenseChPinExHigh, /* Channel pin is high during the excitation period. */ \
919  lesenseChPinIdleLow, /* Channel pin is low during the idle period. */ \
920  false, /* Don't use alternate excitation pins for excitation. */ \
921  false, /* Disabled to shift results from this channel to the decoder register. */ \
922  false, /* Disabled to invert the scan result bit. */ \
923  false, /* Disabled to store counter value in the result buffer. */ \
924  lesenseClkLF, /* Use the LF clock for excitation timing. */ \
925  lesenseClkLF, /* Use the LF clock for sample timing. */ \
926  0x03U, /* Excitation time is set to 3(+1) excitation clock cycles. */ \
927  0x09U, /* Sample delay is set to 9(+1) sample clock cycles. */ \
928  0x06U, /* Measure delay is set to 6 excitation clock cycles.*/ \
929  0x00U, /* ACMP threshold has been set to 0. */ \
930  lesenseSampleModeACMP, /* ACMP output will be used in comparison. */ \
931  lesenseSetIntNone, /* No interrupt is generated by the channel. */ \
932  0xFFU, /* Counter threshold has bee set to 0xFF. */ \
933  lesenseCompModeLess /* Compare mode has been set to trigger interrupt on "less". */ \
934 }
935 #endif
936 
937 
939 #define LESENSE_SCAN_CONF_DEFAULT \
940 { \
941  { \
942  LESENSE_CH_CONF_DEFAULT, /* Scan channel 0. */ \
943  LESENSE_CH_CONF_DEFAULT, /* Scan channel 1. */ \
944  LESENSE_CH_CONF_DEFAULT, /* Scan channel 2. */ \
945  LESENSE_CH_CONF_DEFAULT, /* Scan channel 3. */ \
946  LESENSE_CH_CONF_DEFAULT, /* Scan channel 4. */ \
947  LESENSE_CH_CONF_DEFAULT, /* Scan channel 5. */ \
948  LESENSE_CH_CONF_DEFAULT, /* Scan channel 6. */ \
949  LESENSE_CH_CONF_DEFAULT, /* Scan channel 7. */ \
950  LESENSE_CH_CONF_DEFAULT, /* Scan channel 8. */ \
951  LESENSE_CH_CONF_DEFAULT, /* Scan channel 9. */ \
952  LESENSE_CH_CONF_DEFAULT, /* Scan channel 10. */ \
953  LESENSE_CH_CONF_DEFAULT, /* Scan channel 11. */ \
954  LESENSE_CH_CONF_DEFAULT, /* Scan channel 12. */ \
955  LESENSE_CH_CONF_DEFAULT, /* Scan channel 13. */ \
956  LESENSE_CH_CONF_DEFAULT, /* Scan channel 14. */ \
957  LESENSE_CH_CONF_DEFAULT, /* Scan channel 15. */ \
958  } \
959 }
960 
961 
963 typedef struct
964 {
967  bool enablePin;
968 
972 
980  bool alwaysEx;
982 
983 
985 typedef struct
986 {
989 
1003 
1005 
1006 
1008 #define LESENSE_ALTEX_CH_CONF_DEFAULT \
1009 { \
1010  true, /* Alternate excitation enabled.*/ \
1011  lesenseAltExPinIdleDis,/* Alternate excitation pin is disabled in idle. */ \
1012  false /* Excite only for corresponding channel. */ \
1013 }
1014 
1016 #if defined(_LESENSE_CTRL_ALTEXMAP_ACMP)
1017 #define LESENSE_ALTEX_CONF_DEFAULT \
1018 { \
1019  lesenseAltExMapACMP, \
1020  { \
1021  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 0. */ \
1022  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 1. */ \
1023  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 2. */ \
1024  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 3. */ \
1025  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 4. */ \
1026  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 5. */ \
1027  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 6. */ \
1028  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 7. */ \
1029  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 8. */ \
1030  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 9. */ \
1031  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 10. */ \
1032  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 11. */ \
1033  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 12. */ \
1034  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 13. */ \
1035  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 14. */ \
1036  LESENSE_ALTEX_CH_CONF_DEFAULT /* Alternate excitation channel 15. */ \
1037  } \
1038 }
1039 #else
1040 #define LESENSE_ALTEX_CONF_DEFAULT \
1041 { \
1042  lesenseAltExMapCH, \
1043  { \
1044  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 0. */ \
1045  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 1. */ \
1046  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 2. */ \
1047  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 3. */ \
1048  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 4. */ \
1049  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 5. */ \
1050  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 6. */ \
1051  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 7. */ \
1052  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 8. */ \
1053  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 9. */ \
1054  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 10. */ \
1055  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 11. */ \
1056  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 12. */ \
1057  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 13. */ \
1058  LESENSE_ALTEX_CH_CONF_DEFAULT, /* Alternate excitation channel 14. */ \
1059  LESENSE_ALTEX_CH_CONF_DEFAULT /* Alternate excitation channel 15. */ \
1060  } \
1061 }
1062 #endif
1063 
1065 typedef struct
1066 {
1069  uint8_t compVal;
1070 
1074  uint8_t compMask;
1075 
1078  uint8_t nextState;
1079 
1083 
1085  bool setInt;
1087 
1089 #define LESENSE_ST_CONF_DEFAULT \
1090 { \
1091  0x0FU, /* Compare value set to 0x0F. */ \
1092  0x00U, /* All decoder inputs masked. */ \
1093  0U, /* Next state is state 0. */ \
1094  lesenseTransActNone, /* No PRS action performed on compare match. */ \
1095  false /* No interrupt triggered on compare match. */ \
1096 }
1097 
1098 
1100 typedef struct
1101 {
1105 
1109 
1114 
1115 
1117 typedef struct
1118 {
1122 
1124 #if defined(_SILICON_LABS_32B_SERIES_0)
1125 #define LESENSE_DECODER_CONF_DEFAULT \
1126 { /* chain | Descriptor A | Descriptor B */ \
1127  { \
1128  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 0. */ \
1129  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 1. */ \
1130  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 2. */ \
1131  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 3. */ \
1132  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 4. */ \
1133  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 5. */ \
1134  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 6. */ \
1135  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 7. */ \
1136  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 8. */ \
1137  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 9. */ \
1138  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 10. */ \
1139  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 11. */ \
1140  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 12. */ \
1141  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 13. */ \
1142  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 14. */ \
1143  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT } /* Decoder state 15. */ \
1144  } \
1145 }
1146 #else
1147 #define LESENSE_DECODER_CONF_DEFAULT \
1148 { /* chain | Descriptor A | Descriptor B */ \
1149  { \
1150  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 0. */ \
1151  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 1. */ \
1152  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 2. */ \
1153  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 3. */ \
1154  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 4. */ \
1155  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 5. */ \
1156  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 6. */ \
1157  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 7. */ \
1158  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 8. */ \
1159  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 9. */ \
1160  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 10. */ \
1161  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 11. */ \
1162  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 12. */ \
1163  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 13. */ \
1164  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 14. */ \
1165  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 15. */ \
1166  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 16. */ \
1167  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 17. */ \
1168  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 18. */ \
1169  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 19. */ \
1170  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 20. */ \
1171  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 21. */ \
1172  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 22. */ \
1173  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 23. */ \
1174  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 24. */ \
1175  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 25. */ \
1176  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 26. */ \
1177  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 27. */ \
1178  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 28. */ \
1179  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 29. */ \
1180  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT }, /* Decoder state 30. */ \
1181  { false, LESENSE_ST_CONF_DEFAULT, LESENSE_ST_CONF_DEFAULT } /* Decoder state 31. */ \
1182  } \
1183 }
1184 #endif
1185 
1186 /*******************************************************************************
1187  ***************************** PROTOTYPES **********************************
1188  ******************************************************************************/
1189 void LESENSE_Init(const LESENSE_Init_TypeDef * init, bool reqReset);
1190 void LESENSE_Reset(void);
1191 
1192 uint32_t LESENSE_ScanFreqSet(uint32_t refFreq, uint32_t scanFreq);
1193 void LESENSE_ScanModeSet(LESENSE_ScanMode_TypeDef scanMode, bool start);
1194 void LESENSE_StartDelaySet(uint8_t startDelay);
1196  LESENSE_ClkPresc_TypeDef clkDiv);
1197 
1198 void LESENSE_ChannelAllConfig(const LESENSE_ChAll_TypeDef * confChAll);
1199 void LESENSE_ChannelConfig(const LESENSE_ChDesc_TypeDef * confCh,
1200  uint32_t chIdx);
1201 void LESENSE_ChannelEnable(uint8_t chIdx,
1202  bool enaScanCh,
1203  bool enaPin);
1204 void LESENSE_ChannelEnableMask(uint16_t chMask, uint16_t pinMask);
1205 void LESENSE_ChannelTimingSet(uint8_t chIdx,
1206  uint8_t exTime,
1207  uint8_t sampleDelay,
1208  uint16_t measDelay);
1209 void LESENSE_ChannelThresSet(uint8_t chIdx,
1210  uint16_t acmpThres,
1211  uint16_t cntThres);
1212 #if defined(_LESENSE_CH_EVAL_MODE_MASK)
1213 void LESENSE_ChannelSlidingWindow(uint8_t chIdx,
1214  uint32_t windowSize,
1215  uint32_t initValue);
1216 void LESENSE_ChannelStepDetection(uint8_t chIdx,
1217  uint32_t stepSize,
1218  uint32_t initValue);
1219 void LESENSE_WindowSizeSet(uint32_t windowSize);
1220 void LESENSE_StepSizeSet(uint32_t stepSize);
1221 #endif
1222 
1223 void LESENSE_AltExConfig(const LESENSE_ConfAltEx_TypeDef * confAltEx);
1224 
1225 void LESENSE_DecoderStateAllConfig(const LESENSE_DecStAll_TypeDef * confDecStAll);
1227  uint32_t decSt);
1228 void LESENSE_DecoderStateSet(uint32_t decSt);
1229 uint32_t LESENSE_DecoderStateGet(void);
1230 #if defined(_LESENSE_PRSCTRL_MASK)
1231 void LESENSE_DecoderPrsOut(bool enable, uint32_t decMask, uint32_t decCmp);
1232 #endif
1233 
1234 void LESENSE_ScanStart(void);
1235 void LESENSE_ScanStop(void);
1236 void LESENSE_DecoderStart(void);
1237 void LESENSE_ResultBufferClear(void);
1238 
1239 
1240 /***************************************************************************/
1248 __STATIC_INLINE void LESENSE_DecoderStop(void)
1249 {
1250  /* Stop the decoder */
1251  LESENSE->DECCTRL |= LESENSE_DECCTRL_DISABLE;
1252 }
1253 
1254 
1255 /***************************************************************************/
1269 __STATIC_INLINE uint32_t LESENSE_StatusGet(void)
1270 {
1271  return LESENSE->STATUS;
1272 }
1273 
1274 
1275 /***************************************************************************/
1295 __STATIC_INLINE void LESENSE_StatusWait(uint32_t flag)
1296 {
1297  while (!(LESENSE->STATUS & flag))
1298  ;
1299 }
1300 
1301 
1302 /***************************************************************************/
1310 __STATIC_INLINE uint32_t LESENSE_ChannelActiveGet(void)
1311 {
1312  return LESENSE->CURCH;
1313 }
1314 
1315 
1316 /***************************************************************************/
1327 __STATIC_INLINE uint32_t LESENSE_ScanResultGet(void)
1328 {
1329  return LESENSE->SCANRES & _LESENSE_SCANRES_SCANRES_MASK;
1330 }
1331 
1332 
1333 /***************************************************************************/
1346 __STATIC_INLINE uint32_t LESENSE_ScanResultDataGet(void)
1347 {
1348  return LESENSE->BUFDATA;
1349 }
1350 
1351 
1352 /***************************************************************************/
1367 __STATIC_INLINE uint32_t LESENSE_ScanResultDataBufferGet(uint32_t idx)
1368 {
1369  /* Note: masking is needed to avoid over-indexing! */
1370  return LESENSE->BUF[idx & 0x0FU].DATA;
1371 }
1372 
1373 /***************************************************************************/
1381 __STATIC_INLINE uint32_t LESENSE_SensorStateGet(void)
1382 {
1383  return LESENSE->SENSORSTATE;
1384 }
1385 
1386 
1387 #if defined(LESENSE_POWERDOWN_RAM)
1388 /***************************************************************************/
1400 __STATIC_INLINE void LESENSE_RAMPowerDown(void)
1401 {
1402  /* Power down LESENSE RAM */
1403  LESENSE->POWERDOWN = LESENSE_POWERDOWN_RAM;
1404 }
1405 #endif
1406 
1407 
1408 /***************************************************************************/
1417 __STATIC_INLINE void LESENSE_IntClear(uint32_t flags)
1418 {
1419  LESENSE->IFC = flags;
1420 }
1421 
1422 
1423 /***************************************************************************/
1432 __STATIC_INLINE void LESENSE_IntEnable(uint32_t flags)
1433 {
1434  LESENSE->IEN |= flags;
1435 }
1436 
1437 
1438 /***************************************************************************/
1447 __STATIC_INLINE void LESENSE_IntDisable(uint32_t flags)
1448 {
1449  LESENSE->IEN &= ~flags;
1450 }
1451 
1452 
1453 /***************************************************************************/
1462 __STATIC_INLINE void LESENSE_IntSet(uint32_t flags)
1463 {
1464  LESENSE->IFS = flags;
1465 }
1466 
1467 
1468 /***************************************************************************/
1479 __STATIC_INLINE uint32_t LESENSE_IntGet(void)
1480 {
1481  return LESENSE->IF;
1482 }
1483 
1484 
1485 /***************************************************************************/
1503 __STATIC_INLINE uint32_t LESENSE_IntGetEnabled(void)
1504 {
1505  uint32_t tmp;
1506 
1507  /* Store LESENSE->IEN in temporary variable in order to define explicit order
1508  * of volatile accesses. */
1509  tmp = LESENSE->IEN;
1510 
1511  /* Bitwise AND of pending and enabled interrupts */
1512  return LESENSE->IF & tmp;
1513 }
1514 
1515 
1519 #ifdef __cplusplus
1520 }
1521 #endif
1522 
1523 #endif /* defined(LESENSE_COUNT) && (LESENSE_COUNT > 0) */
1524 
1525 #endif /* EM_LESENSE_H */
__STATIC_INLINE uint32_t LESENSE_IntGetEnabled(void)
Get enabled and pending LESENSE interrupt flags.
Definition: em_lesense.h:1503
LESENSE_PRSSel_TypeDef
Definition: em_lesense.h:101
__STATIC_INLINE void LESENSE_StatusWait(uint32_t flag)
Wait until the status of LESENSE is equal to what requested.
Definition: em_lesense.h:1295
LESENSE_PRSSel_TypeDef prsChSel3
Definition: em_lesense.h:745
#define LESENSE_CTRL_BUFIDL_FULL
__STATIC_INLINE void LESENSE_IntClear(uint32_t flags)
Clear one or more pending LESENSE interrupts.
Definition: em_lesense.h:1417
LESENSE_TimeCtrlDesc_TypeDef timeCtrl
Definition: em_lesense.h:774
void LESENSE_AltExConfig(const LESENSE_ConfAltEx_TypeDef *confAltEx)
Configure the LESENSE alternate excitation modes.
Definition: em_lesense.c:620
LESENSE_ControlACMP_TypeDef acmp1Mode
Definition: em_lesense.h:658
#define LESENSE_NUM_CHANNELS
Definition: em_lesense.h:61
#define LESENSE_POWERDOWN_RAM
#define _LESENSE_PERCTRL_DACCH0OUT_DISABLE
LESENSE_ControlACMP_TypeDef
Definition: em_lesense.h:294
void LESENSE_DecoderStart(void)
Start LESENSE decoder.
Definition: em_lesense.c:1199
#define _LESENSE_IDLECONF_CH0_DACCH0
LESENSE_ChSampleMode_TypeDef
Definition: em_lesense.h:339
LESENSE_ControlDACData_TypeDef dacCh0Data
Definition: em_lesense.h:621
LESENSE_DecStCond_TypeDef confA
Definition: em_lesense.h:1108
LESENSE_BufTrigLevel_TypeDef
Definition: em_lesense.h:154
LESENSE_DecCtrlDesc_TypeDef decCtrl
Definition: em_lesense.h:780
LESENSE_BiasMode_TypeDef
Definition: em_lesense.h:181
LESENSE_AltExMap_TypeDef
Definition: em_lesense.h:135
#define _LESENSE_PERCTRL_DACCH0OUT_PIN
#define LESENSE_ST_TCONFA_PRSACT_NONE
LESENSE_ControlDACData_TypeDef dacCh1Data
Definition: em_lesense.h:632
LESENSE_ChPinIdleMode_TypeDef chPinIdleMode
Definition: em_lesense.h:811
void LESENSE_Init(const LESENSE_Init_TypeDef *init, bool reqReset)
Initialize the LESENSE module.
Definition: em_lesense.c:118
#define LESENSE_CTRL_BUFIDL_HALFFULL
#define _LESENSE_IDLECONF_CH0_DISABLE
#define LESENSE_ST_TCONFA_PRSACT_PRS12
LESENSE_ScanConfSel_TypeDef
Definition: em_lesense.h:195
#define LESENSE_ST_TCONFA_PRSACT_PRS0
LESENSE_ControlDACOut_TypeDef
Definition: em_lesense.h:259
#define _LESENSE_PERCTRL_DACCH0DATA_DACDATA
#define _LESENSE_IDLECONF_CH0_LOW
__STATIC_INLINE uint32_t LESENSE_SensorStateGet(void)
Get the current state of the LESENSE sensor.
Definition: em_lesense.h:1381
void LESENSE_Reset(void)
Reset the LESENSE module.
Definition: em_lesense.c:1258
#define LESENSE_CTRL_SCANMODE_PERIODIC
#define _LESENSE_PERCTRL_DACCH0OUT_PINADCACMP
LESENSE_DMAWakeUp_TypeDef
Definition: em_lesense.h:165
void LESENSE_ResultBufferClear(void)
Clear result buffer.
Definition: em_lesense.c:1229
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
LESENSE_DACRef_TypeDef
Definition: em_lesense.h:282
void LESENSE_ChannelThresSet(uint8_t chIdx, uint16_t acmpThres, uint16_t cntThres)
Set LESENSE channel threshold parameters.
Definition: em_lesense.c:837
#define _LESENSE_CH_INTERACT_SAMPLE_SHIFT
#define _LESENSE_PERCTRL_DACCH0CONV_SAMPLEOFF
void LESENSE_ScanModeSet(LESENSE_ScanMode_TypeDef scanMode, bool start)
Set scan mode of the LESENSE channels.
Definition: em_lesense.c:329
#define LESENSE_CH_INTERACT_SETIF_LEVEL
#define LESENSE_ST_TCONFA_PRSACT_PRS1
#define LESENSE_CTRL_SCANMODE_PRS
LESENSE_PRSSel_TypeDef prsChSel0
Definition: em_lesense.h:736
#define _LESENSE_SCANRES_SCANRES_MASK
#define LESENSE_ST_TCONFA_PRSACT_DOWNANDPRS2
#define _LESENSE_ALTEXCONF_IDLECONF0_HIGH
#define LESENSE_DECCTRL_INPUT_PRS
#define LESENSE_CH_INTERACT_EXMODE_DACOUT
LESENSE_ClkPresc_TypeDef
Definition: em_lesense.h:71
LESENSE_ControlDACOut_TypeDef dacCh0OutMode
Definition: em_lesense.h:628
#define LESENSE_CH_INTERACT_SETIF_POSEDGE
#define LESENSE_ST_TCONFA_PRSACT_PRS2
void LESENSE_DecoderStateSet(uint32_t decSt)
Set LESENSE decoder state.
Definition: em_lesense.c:1079
#define _LESENSE_IDLECONF_CH12_DACCH1
#define LESENSE_ST_TCONFA_PRSACT_UPANDPRS2
#define LESENSE_PERCTRL_DACREF_BANDGAP
#define LESENSE_CH_EVAL_COMP_GE
#define LESENSE_CTRL_DMAWU_BUFLEVEL
#define _LESENSE_CTRL_ALTEXMAP_ALTEX
#define LESENSE_CH_INTERACT_SETIF_NEGEDGE
LESENSE_PRSSel_TypeDef prsSel
Definition: em_lesense.h:543
#define _LESENSE_PERCTRL_ACMP0MODE_MUXTHRES
LESENSE_AltExPinIdle_TypeDef
Definition: em_lesense.h:474
#define _LESENSE_PERCTRL_DACCH0OUT_ADCACMP
#define _LESENSE_PERCTRL_DACCH0CONV_DISABLE
LESENSE_ChClk_TypeDef exClk
Definition: em_lesense.h:828
#define LESENSE_CH_INTERACT_EXMODE_HIGH
#define LESENSE_PERCTRL_DACREF_VDD
#define LESENSE_BIASCTRL_BIASMODE_HIGHACC
#define _LESENSE_ALTEXCONF_IDLECONF0_LOW
void LESENSE_ChannelTimingSet(uint8_t chIdx, uint8_t exTime, uint8_t sampleDelay, uint16_t measDelay)
Set LESENSE channel timing parameters.
Definition: em_lesense.c:782
#define LESENSE_CH_INTERACT_EXMODE_DISABLE
#define LESENSE_CH_INTERACT_SETIF_NONE
#define _LESENSE_PERCTRL_ACMP0MODE_MUX
#define _LESENSE_PERCTRL_ACMP0MODE_DISABLE
uint32_t LESENSE_ScanFreqSet(uint32_t refFreq, uint32_t scanFreq)
Set scan frequency for periodic scanning.
Definition: em_lesense.c:247
#define LESENSE_CH_INTERACT_SAMPLE_ACMP
__STATIC_INLINE void LESENSE_IntDisable(uint32_t flags)
Disable one or more LESENSE interrupts.
Definition: em_lesense.h:1447
LESENSE_DMAWakeUp_TypeDef wakeupOnDMA
Definition: em_lesense.h:569
LESENSE_ControlDACConv_TypeDef dacCh1ConvMode
Definition: em_lesense.h:636
#define LESENSE_CTRL_SCANCONF_INVMAP
#define LESENSE
#define _LESENSE_CTRL_ALTEXMAP_ACMP
__STATIC_INLINE uint32_t LESENSE_ScanResultDataBufferGet(uint32_t idx)
Get data from the result data buffer.
Definition: em_lesense.h:1367
#define _LESENSE_ALTEXCONF_IDLECONF0_DISABLE
#define _LESENSE_CH_INTERACT_EXCLK_LFACLK
#define LESENSE_ST_TCONFA_PRSACT_DOWN
#define LESENSE_CH_INTERACT_EXMODE_LOW
#define _LESENSE_PERCTRL_DACCH0CONV_CONTINUOUS
LESENSE_StTransAct_TypeDef
Definition: em_lesense.h:491
LESENSE_ChCompMode_TypeDef compMode
Definition: em_lesense.h:870
#define _LESENSE_IDLECONF_CH0_HIGH
__STATIC_INLINE uint32_t LESENSE_StatusGet(void)
Get the current status of LESENSE.
Definition: em_lesense.h:1269
LESENSE_DecInput_TypeDef
Definition: em_lesense.h:328
void LESENSE_ClkDivSet(LESENSE_ChClk_TypeDef clk, LESENSE_ClkPresc_TypeDef clkDiv)
Set clock division for LESENSE timers.
Definition: em_lesense.c:414
LESENSE_PRSSel_TypeDef prsChSel2
Definition: em_lesense.h:742
#define LESENSE_NUM_DECODER_STATES
Definition: em_lesense.h:58
LESENSE_DACRef_TypeDef dacRef
Definition: em_lesense.h:651
void LESENSE_ChannelAllConfig(const LESENSE_ChAll_TypeDef *confChAll)
Configure all (16) LESENSE sensor channels.
Definition: em_lesense.c:476
LESENSE_WarmupMode_TypeDef
Definition: em_lesense.h:311
__STATIC_INLINE uint32_t LESENSE_ScanResultGet(void)
Get the latest scan comparison result (1 bit / channel).
Definition: em_lesense.h:1327
LESENSE_PerCtrlDesc_TypeDef perCtrl
Definition: em_lesense.h:777
void LESENSE_ChannelConfig(const LESENSE_ChDesc_TypeDef *confCh, uint32_t chIdx)
Configure a single LESENSE sensor channel.
Definition: em_lesense.c:511
LESENSE_ScanConfSel_TypeDef scanConfSel
Definition: em_lesense.h:546
uint32_t LESENSE_DecoderStateGet(void)
Get the current state of the LESENSE decoder.
Definition: em_lesense.c:1095
#define LESENSE_PERCTRL_WARMUPMODE_KEEPACMPDACWARM
LESENSE_ControlACMP_TypeDef acmp0Mode
Definition: em_lesense.h:655
#define LESENSE_CTRL_SCANCONF_DECDEF
#define LESENSE_ST_TCONFA_PRSACT_PRS01
LESENSE_ChCompMode_TypeDef
Definition: em_lesense.h:434
void LESENSE_ChannelEnable(uint8_t chIdx, bool enaScanCh, bool enaPin)
Enable/disable LESENSE scan channel and the pin assigned to it.
Definition: em_lesense.c:708
#define LESENSE_CH_EVAL_COMP_LESS
LESENSE_ControlDACConv_TypeDef
Definition: em_lesense.h:237
#define LESENSE_DECCTRL_INPUT_SENSORSTATE
#define LESENSE_ST_TCONFA_PRSACT_PRS02
#define LESENSE_CTRL_SCANMODE_ONESHOT
__STATIC_INLINE uint32_t LESENSE_IntGet(void)
Get pending LESENSE interrupt flags.
Definition: em_lesense.h:1479
LESENSE_ChPinExMode_TypeDef
Definition: em_lesense.h:375
#define LESENSE_ST_TCONFA_PRSACT_UP
LESENSE_ControlDACConv_TypeDef dacCh0ConvMode
Definition: em_lesense.h:625
LESENSE_ControlDACOut_TypeDef dacCh1OutMode
Definition: em_lesense.h:639
#define LESENSE_PERCTRL_WARMUPMODE_KEEPACMPWARM
LESENSE_DecStCond_TypeDef confB
Definition: em_lesense.h:1112
LESENSE_ChClk_TypeDef sampleClk
Definition: em_lesense.h:831
LESENSE_CoreCtrlDesc_TypeDef coreCtrl
Definition: em_lesense.h:771
LESENSE_ScanMode_TypeDef scanStart
Definition: em_lesense.h:540
__STATIC_INLINE uint32_t LESENSE_ScanResultDataGet(void)
Get the oldest unread data from the result buffer.
Definition: em_lesense.h:1346
#define LESENSE_DECCTRL_DISABLE
#define LESENSE_ST_TCONFA_PRSACT_PRS012
LESENSE_AltExMap_TypeDef altExMap
Definition: em_lesense.h:988
LESENSE_ScanMode_TypeDef
Definition: em_lesense.h:85
void LESENSE_DecoderStateConfig(const LESENSE_DecStDesc_TypeDef *confDecSt, uint32_t decSt)
Configure a single LESENSE decoder state.
Definition: em_lesense.c:1027
LESENSE_ControlDACData_TypeDef
Definition: em_lesense.h:216
#define LESENSE_CTRL_DMAWU_BUFDATAV
LESENSE_DecInput_TypeDef decInput
Definition: em_lesense.h:702
LESENSE_ChIntMode_TypeDef
Definition: em_lesense.h:358
LESENSE_WarmupMode_TypeDef warmupMode
Definition: em_lesense.h:661
LESENSE_StTransAct_TypeDef prsAct
Definition: em_lesense.h:1082
#define _LESENSE_PERCTRL_DACCH0CONV_SAMPLEHOLD
LESENSE_BiasMode_TypeDef biasMode
Definition: em_lesense.h:572
LESENSE_AltExPinIdle_TypeDef idleConf
Definition: em_lesense.h:971
#define LESENSE_CTRL_SCANCONF_DIRMAP
#define LESENSE_PERCTRL_WARMUPMODE_NORMAL
void LESENSE_ChannelEnableMask(uint16_t chMask, uint16_t pinMask)
Enable/disable LESENSE scan channel and the pin assigned to it.
Definition: em_lesense.c:745
void LESENSE_StartDelaySet(uint8_t startDelay)
Set start delay of sensor interaction on each channel.
Definition: em_lesense.c:371
void LESENSE_ScanStart(void)
Start scanning of sensors.
Definition: em_lesense.c:1136
#define LESENSE_PERCTRL_WARMUPMODE_KEEPDACWARM
__STATIC_INLINE void LESENSE_DecoderStop(void)
Stop LESENSE decoder.
Definition: em_lesense.h:1248
void LESENSE_ScanStop(void)
Stop scanning of sensors.
Definition: em_lesense.c:1169
#define _LESENSE_CH_INTERACT_EXCLK_AUXHFRCO
#define LESENSE_CTRL_SCANCONF_TOGGLE
#define LESENSE_BIASCTRL_BIASMODE_DUTYCYCLE
__STATIC_INLINE uint32_t LESENSE_ChannelActiveGet(void)
Get the currently active channel index.
Definition: em_lesense.h:1310
__STATIC_INLINE void LESENSE_IntEnable(uint32_t flags)
Enable one or more LESENSE interrupts.
Definition: em_lesense.h:1432
LESENSE_ChClk_TypeDef
Definition: em_lesense.h:423
LESENSE_ChPinIdleMode_TypeDef
Definition: em_lesense.h:392
__STATIC_INLINE void LESENSE_RAMPowerDown(void)
Shut off power to the LESENSE RAM, disables LESENSE.
Definition: em_lesense.h:1400
#define _LESENSE_PERCTRL_DACCH0DATA_ACMPTHRES
#define LESENSE_BIASCTRL_BIASMODE_DONTTOUCH
#define LESENSE_CTRL_DMAWU_DISABLE
LESENSE_ChIntMode_TypeDef intMode
Definition: em_lesense.h:863
LESENSE_ChPinExMode_TypeDef chPinExMode
Definition: em_lesense.h:808
LESENSE_BufTrigLevel_TypeDef bufTrigLevel
Definition: em_lesense.h:566
LESENSE_PRSSel_TypeDef prsChSel1
Definition: em_lesense.h:739
LESENSE_ChSampleMode_TypeDef sampleMode
Definition: em_lesense.h:860
__STATIC_INLINE void LESENSE_IntSet(uint32_t flags)
Set one or more pending LESENSE interrupts from SW.
Definition: em_lesense.h:1462
void LESENSE_DecoderStateAllConfig(const LESENSE_DecStAll_TypeDef *confDecStAll)
Configure all LESENSE decoder states.
Definition: em_lesense.c:999