EFR32 Blue Gecko 12 Software Documentation  efr32bg12-doc-5.1.2
em_csen.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef EM_CSEN_H
34 #define EM_CSEN_H
35 
36 #include "em_device.h"
37 #if defined( CSEN_COUNT ) && ( CSEN_COUNT > 0 )
38 
39 #include <stdbool.h>
40 #include "em_bus.h"
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /***************************************************************************/
51 /***************************************************************************/
81 /*******************************************************************************
82  ******************************** ENUMS ************************************
83  ******************************************************************************/
84 
86 typedef enum
87 {
90 
93 
96 
100 
101 
103 typedef enum
104 {
107 
110 
113 
117 
118 
120 typedef enum
121 {
124 
127 
130 
133 
136 
140 
141 
143 typedef enum
144 {
149 
150 
152 typedef enum
153 {
162 
163 
165 typedef enum
166 {
172 
173 
175 typedef enum
176 {
182 
183 
186 typedef enum
187 {
197 
198 
200 typedef enum
201 {
210 
211 
213 typedef enum
214 {
224 
225 
227 typedef enum
228 {
238 
239 
241 typedef enum
242 {
252 
253 
255 typedef enum
256 {
270 
271 
273 typedef enum
274 {
275  csenInputSelDefault = _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_DEFAULT,
276  csenInputSelAPORT1CH0TO7 = _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT1CH0TO7,
277  csenInputSelAPORT1CH8TO15 = _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT1CH8TO15,
278  csenInputSelAPORT1CH16TO23 = _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT1CH16TO23,
279  csenInputSelAPORT1CH24TO31 = _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT1CH24TO31,
280  csenInputSelAPORT3CH0TO7 = _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT3CH0TO7,
281  csenInputSelAPORT3CH8TO15 = _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT3CH8TO15,
282  csenInputSelAPORT3CH16TO23 = _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT3CH16TO23,
283  csenInputSelAPORT3CH24TO31 = _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT3CH24TO31,
285 
286 
288 typedef enum
289 {
290  csenSingleSelDefault = _CSEN_SINGLECTRL_SINGLESEL_DEFAULT,
291  csenSingleSelAPORT1XCH0 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH0,
292  csenSingleSelAPORT1YCH1 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH1,
293  csenSingleSelAPORT1XCH2 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH2,
294  csenSingleSelAPORT1YCH3 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH3,
295  csenSingleSelAPORT1XCH4 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH4,
296  csenSingleSelAPORT1YCH5 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH5,
297  csenSingleSelAPORT1XCH6 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH6,
298  csenSingleSelAPORT1YCH7 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH7,
299  csenSingleSelAPORT1XCH8 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH8,
300  csenSingleSelAPORT1YCH9 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH9,
301  csenSingleSelAPORT1XCH10 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH10,
302  csenSingleSelAPORT1YCH11 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH11,
303  csenSingleSelAPORT1XCH12 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH12,
304  csenSingleSelAPORT1YCH13 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH13,
305  csenSingleSelAPORT1XCH14 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH14,
306  csenSingleSelAPORT1YCH15 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH15,
307  csenSingleSelAPORT1XCH16 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH16,
308  csenSingleSelAPORT1YCH17 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH17,
309  csenSingleSelAPORT1XCH18 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH18,
310  csenSingleSelAPORT1YCH19 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH19,
311  csenSingleSelAPORT1XCH20 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH20,
312  csenSingleSelAPORT1YCH21 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH21,
313  csenSingleSelAPORT1XCH22 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH22,
314  csenSingleSelAPORT1YCH23 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH23,
315  csenSingleSelAPORT1XCH24 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH24,
316  csenSingleSelAPORT1YCH25 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH25,
317  csenSingleSelAPORT1XCH26 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH26,
318  csenSingleSelAPORT1YCH27 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH27,
319  csenSingleSelAPORT1XCH28 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH28,
320  csenSingleSelAPORT1YCH29 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH29,
321  csenSingleSelAPORT1XCH30 = _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH30,
322  csenSingleSelAPORT1YCH31 = _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH31,
323  csenSingleSelAPORT3XCH0 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH0,
324  csenSingleSelAPORT3YCH1 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH1,
325  csenSingleSelAPORT3XCH2 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH2,
326  csenSingleSelAPORT3YCH3 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH3,
327  csenSingleSelAPORT3XCH4 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH4,
328  csenSingleSelAPORT3YCH5 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH5,
329  csenSingleSelAPORT3XCH6 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH6,
330  csenSingleSelAPORT3YCH7 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH7,
331  csenSingleSelAPORT3XCH8 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH8,
332  csenSingleSelAPORT3YCH9 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH9,
333  csenSingleSelAPORT3XCH10 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH10,
334  csenSingleSelAPORT3YCH11 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH11,
335  csenSingleSelAPORT3XCH12 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH12,
336  csenSingleSelAPORT3YCH13 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH13,
337  csenSingleSelAPORT3XCH14 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH14,
338  csenSingleSelAPORT3YCH15 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH15,
339  csenSingleSelAPORT3XCH16 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH16,
340  csenSingleSelAPORT3YCH17 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH17,
341  csenSingleSelAPORT3XCH18 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH18,
342  csenSingleSelAPORT3YCH19 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH19,
343  csenSingleSelAPORT3XCH20 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH20,
344  csenSingleSelAPORT3YCH21 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH21,
345  csenSingleSelAPORT3XCH22 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH22,
346  csenSingleSelAPORT3YCH23 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH23,
347  csenSingleSelAPORT3XCH24 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH24,
348  csenSingleSelAPORT3YCH25 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH25,
349  csenSingleSelAPORT3XCH26 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH26,
350  csenSingleSelAPORT3YCH27 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH27,
351  csenSingleSelAPORT3XCH28 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH28,
352  csenSingleSelAPORT3YCH29 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH29,
353  csenSingleSelAPORT3XCH30 = _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH30,
354  csenSingleSelAPORT3YCH31 = _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH31,
356 
357 
358 /*******************************************************************************
359  ******************************* STRUCTS ***********************************
360  ******************************************************************************/
361 
363 typedef struct
364 {
367 
370 
372  bool keepWarm;
373 
375  uint8_t warmUpCount;
376 
378  uint8_t pcReload;
379 
382 
385 
388  CSEN_InputSel_TypeDef input8To15;
389  CSEN_InputSel_TypeDef input16To23;
390  CSEN_InputSel_TypeDef input24To31;
391  CSEN_InputSel_TypeDef input32To39;
392  CSEN_InputSel_TypeDef input40To47;
393  CSEN_InputSel_TypeDef input48To55;
394  CSEN_InputSel_TypeDef input56To63;
396 
397 #define CSEN_INIT_DEFAULT \
398 { \
399  false, /* Charge pump low accuracy mode. */ \
400  false, /* Use external kelvin connection. */ \
401  false, /* Disable keep warm. */ \
402  0, /* 0+3 cycle warmup time. */ \
403  0, /* Period counter reload. */ \
404  csenPCPrescaleDiv1, /* Period counter prescale. */ \
405  csenPRSSELCh0, /* PRS channel 0. */ \
406  csenInputSelAPORT1CH0TO7, /* input0To7 -> aport1ch0to7 */ \
407  csenInputSelAPORT1CH8TO15, /* input8To15 -> aport1ch8to15 */ \
408  csenInputSelAPORT1CH16TO23, /* input16To23 -> aport1ch16to23 */ \
409  csenInputSelAPORT1CH24TO31, /* input24To31 -> aport1ch24to31 */ \
410  csenInputSelAPORT3CH0TO7, /* input32To39 -> aport3ch0to7 */ \
411  csenInputSelAPORT3CH8TO15, /* input40To47 -> aport3ch8to15 */ \
412  csenInputSelAPORT3CH16TO23, /* input48To55 -> aport3ch16to23 */ \
413  csenInputSelAPORT3CH24TO31, /* input56To63 -> aport3ch24to31 */ \
414 }
415 
416 
418 typedef struct
419 {
422 
425 
427  bool enableDma;
428 
430  bool sumOnly;
431 
434 
437 
440 
442  uint16_t cmpThr;
443 
446 
454  uint32_t inputMask0;
455 
457  uint32_t inputMask1;
458 
460  bool autoGnd;
461 
464 
467 
470 
473  uint8_t dmIterPerCycle;
474 
477  uint8_t dmCycles;
478 
481  uint8_t dmDelta;
482 
486 
490 
494 
498 
499 #define CSEN_INITMODE_DEFAULT \
500 { \
501  csenSampleModeSingle, /* Sample one input and stop. */ \
502  csenTrigSelStart, /* Use start bit to trigger. */ \
503  false, /* Disable DMA. */ \
504  false, /* Average the accumulated result. */ \
505  csenAccMode1, /* Accumulate 1 sample. */ \
506  csenEMASampleW1, /* Disable the EMA. */ \
507  csenCmpModeDisabled, /* Disable the comparator. */ \
508  0, /* Comparator threshold not used. */ \
509  csenSingleSelDefault, /* Disconnect the single input. */ \
510  0, /* Disable inputs 0 to 31. */ \
511  0, /* Disable inputs 32 to 63. */ \
512  false, /* Do not ground inactive inputs. */ \
513  csenConvSelSAR, /* Use the SAR converter. */ \
514  csenSARRes10, /* Set SAR resolution to 10 bits. */ \
515  csenDMRes10, /* Set DM resolution to 10 bits. */ \
516  0, /* Set DM conv/cycle to default. */ \
517  0, /* Set DM cycles to default. */ \
518  0, /* Set DM initial delta to default. */ \
519  false, /* Use DM auto delta reduction. */ \
520  csenResetPhaseSel0, /* Use shortest reset phase time. */ \
521  csenDriveSelFull, /* Use full output current. */ \
522  csenGainSel8X, /* Use highest converter gain. */ \
523 }
524 
525 
526 /*******************************************************************************
527  ***************************** PROTOTYPES **********************************
528  ******************************************************************************/
529 
530 /***************************************************************************/
545 __STATIC_INLINE uint32_t CSEN_DataGet(CSEN_TypeDef *csen)
546 {
547  return csen->DATA;
548 }
549 
550 /***************************************************************************/
563 __STATIC_INLINE uint32_t CSEN_EMAGet(CSEN_TypeDef *csen)
564 {
565  return (csen->EMA & _CSEN_EMA_EMA_MASK);
566 }
567 
568 /***************************************************************************/
581 __STATIC_INLINE void CSEN_EMASet(CSEN_TypeDef *csen, uint32_t ema)
582 {
583  csen->EMA = ema & _CSEN_EMA_EMA_MASK;
584 }
585 
586 /***************************************************************************/
593 __STATIC_INLINE void CSEN_Disable(CSEN_TypeDef *csen)
594 {
596 }
597 
598 /***************************************************************************/
605 __STATIC_INLINE void CSEN_Enable(CSEN_TypeDef *csen)
606 {
608 }
609 
610 void CSEN_DMBaselineSet(CSEN_TypeDef *csen, uint32_t up, uint32_t down);
611 void CSEN_Init(CSEN_TypeDef *csen, const CSEN_Init_TypeDef *init);
612 void CSEN_InitMode(CSEN_TypeDef *csen, const CSEN_InitMode_TypeDef *init);
613 void CSEN_Reset(CSEN_TypeDef *csen);
614 
615 
616 /***************************************************************************/
627 __STATIC_INLINE void CSEN_IntClear(CSEN_TypeDef *csen, uint32_t flags)
628 {
629  csen->IFC = flags;
630 }
631 
632 
633 /***************************************************************************/
644 __STATIC_INLINE void CSEN_IntDisable(CSEN_TypeDef *csen, uint32_t flags)
645 {
646  csen->IEN &= ~flags;
647 }
648 
649 
650 /***************************************************************************/
666 __STATIC_INLINE void CSEN_IntEnable(CSEN_TypeDef *csen, uint32_t flags)
667 {
668  csen->IEN |= flags;
669 }
670 
671 
672 /***************************************************************************/
686 __STATIC_INLINE uint32_t CSEN_IntGet(CSEN_TypeDef *csen)
687 {
688  return csen->IF;
689 }
690 
691 
692 /***************************************************************************/
711 __STATIC_INLINE uint32_t CSEN_IntGetEnabled(CSEN_TypeDef *csen)
712 {
713  uint32_t ien;
714 
715  /* Store CSENx->IEN in temporary variable in order to define explicit order
716  * of volatile accesses. */
717  ien = csen->IEN;
718 
719  /* Bitwise AND of pending and enabled interrupts */
720  return csen->IF & ien;
721 }
722 
723 
724 /***************************************************************************/
735 __STATIC_INLINE void CSEN_IntSet(CSEN_TypeDef *csen, uint32_t flags)
736 {
737  csen->IFS = flags;
738 }
739 
740 
741 /***************************************************************************/
751 __STATIC_INLINE bool CSEN_IsBusy(CSEN_TypeDef *csen)
752 {
753  return (bool)(csen->STATUS & _CSEN_STATUS_CSENBUSY_MASK);
754 }
755 
756 
757 /***************************************************************************/
764 __STATIC_INLINE void CSEN_Start(CSEN_TypeDef *csen)
765 {
766  csen->CMD = CSEN_CMD_START;
767 }
768 
769 
773 #ifdef __cplusplus
774 }
775 #endif
776 
777 #endif /* defined(CSEN_COUNT) && (CSEN_COUNT > 0) */
778 #endif /* EM_CSEN_H */
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH15
CSEN_ResetPhaseSel_TypeDef
Definition: em_csen.h:213
#define _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_DEFAULT
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH17
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH16
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH12
#define _CSEN_CTRL_ACU_ACC8
CSEN_InputSel_TypeDef input0To7
Definition: em_csen.h:387
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH28
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH19
#define _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT3CH16TO23
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH5
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH2
#define _CSEN_EMACTRL_EMASAMPLE_W8
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH16
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH0
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH13
__STATIC_INLINE void CSEN_Start(CSEN_TypeDef *csen)
Start scan sequence and/or single conversion.
Definition: em_csen.h:764
#define _CSEN_EMACTRL_EMASAMPLE_W1
#define _CSEN_PRSSEL_PRSSEL_PRSCH10
#define _CSEN_PRSSEL_PRSSEL_PRSCH2
__STATIC_INLINE uint32_t CSEN_DataGet(CSEN_TypeDef *csen)
Get last conversion result.
Definition: em_csen.h:545
#define _CSEN_CTRL_EN_SHIFT
#define _CSEN_EMACTRL_EMASAMPLE_W4
__IOM uint32_t DATA
CSEN_GainSel_TypeDef gainSel
Definition: em_csen.h:496
RAM and peripheral bit-field set and clear API.
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH26
#define CSEN_CTRL_EMACMPEN
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH27
CSEN_InputSel_TypeDef
Definition: em_csen.h:273
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH6
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH25
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH1
#define _CSEN_CTRL_STM_START
#define _CSEN_TIMCTRL_PCPRESC_DIV32
CSEN_ConvSel_TypeDef convSel
Definition: em_csen.h:463
#define _CSEN_PRSSEL_PRSSEL_PRSCH4
CSEN_SingleSel_TypeDef
Definition: em_csen.h:288
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH24
CSEN_SingleSel_TypeDef singleSel
Definition: em_csen.h:445
CSEN_ResetPhaseSel_TypeDef resetPhase
Definition: em_csen.h:489
#define _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT1CH24TO31
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH11
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH10
#define CSEN_CTRL_CM_CONTSCAN
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH28
CSEN_SARRes_TypeDef
Definition: em_csen.h:165
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH1
#define CSEN_CTRL_CMPEN
__STATIC_INLINE void CSEN_IntDisable(CSEN_TypeDef *csen, uint32_t flags)
Disable one or more CSEN interrupts.
Definition: em_csen.h:644
uint8_t dmIterPerCycle
Definition: em_csen.h:473
#define CSEN_CTRL_CONVSEL_DM
#define _CSEN_CTRL_ACU_ACC32
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH30
#define CSEN_CTRL_CONVSEL_SAR
#define _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT3CH0TO7
__IOM uint32_t EMA
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH0
CSEN_CmpMode_TypeDef cmpMode
Definition: em_csen.h:439
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH4
CSEN_PRSSel_TypeDef
Definition: em_csen.h:255
CSEN_CmpMode_TypeDef
Definition: em_csen.h:86
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH22
#define _CSEN_CTRL_STM_TIMER
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH3
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH4
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH6
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH3
#define _CSEN_CTRL_SARCR_CLK12
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH7
#define _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT1CH0TO7
CSEN_SARRes_TypeDef sarRes
Definition: em_csen.h:466
#define _CSEN_CTRL_ACU_ACC4
__STATIC_INLINE bool CSEN_IsBusy(CSEN_TypeDef *csen)
Return CSEN conversion busy status.
Definition: em_csen.h:751
CSEN_TrigSel_TypeDef trigSel
Definition: em_csen.h:424
void CSEN_Init(CSEN_TypeDef *csen, const CSEN_Init_TypeDef *init)
Initialize CSEN.
Definition: em_csen.c:115
__IOM uint32_t IFC
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH8
#define _CSEN_PRSSEL_PRSSEL_PRSCH9
#define _CSEN_DMCFG_CRMODE_DM14
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH23
#define _CSEN_EMACTRL_EMASAMPLE_W2
#define _CSEN_PRSSEL_PRSSEL_PRSCH11
#define CSEN_CTRL_MCEN_ENABLE
#define CSEN_CTRL_CM_CONTSGL
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH31
CSEN_EMASample_TypeDef
Definition: em_csen.h:200
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH13
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH14
__STATIC_INLINE void CSEN_Enable(CSEN_TypeDef *csen)
Enables the CSEN.
Definition: em_csen.h:605
CSEN_EMASample_TypeDef emaSample
Definition: em_csen.h:436
#define _CSEN_TIMCTRL_PCPRESC_DIV1
#define _CSEN_CTRL_ACU_ACC2
__STATIC_INLINE uint32_t CSEN_EMAGet(CSEN_TypeDef *csen)
Get last exponential moving average.
Definition: em_csen.h:563
uint8_t warmUpCount
Definition: em_csen.h:375
#define _CSEN_TIMCTRL_PCPRESC_DIV4
#define _CSEN_EMACTRL_EMASAMPLE_W32
#define _CSEN_STATUS_CSENBUSY_MASK
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH27
#define _CSEN_TIMCTRL_PCPRESC_DIV8
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH18
CSEN_PCPrescale_TypeDef pcPrescale
Definition: em_csen.h:381
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH24
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH9
#define _CSEN_PRSSEL_PRSSEL_PRSCH8
CSEN_SampleMode_TypeDef
Definition: em_csen.h:120
CSEN_AccMode_TypeDef
Definition: em_csen.h:152
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH20
CSEN_DMRes_TypeDef dmRes
Definition: em_csen.h:469
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH2
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH26
#define _CSEN_DMCFG_CRMODE_DM16
#define _CSEN_PRSSEL_PRSSEL_PRSCH7
uint32_t inputMask1
Definition: em_csen.h:457
__IM uint32_t STATUS
void CSEN_DMBaselineSet(CSEN_TypeDef *csen, uint32_t up, uint32_t down)
Set the DM integrator initial value.
Definition: em_csen.c:88
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH23
__STATIC_INLINE void CSEN_IntEnable(CSEN_TypeDef *csen, uint32_t flags)
Enable one or more CSEN interrupts.
Definition: em_csen.h:666
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH12
CSEN_PCPrescale_TypeDef
Definition: em_csen.h:186
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH17
#define _CSEN_PRSSEL_PRSSEL_PRSCH1
CSEN_ConvSel_TypeDef
Definition: em_csen.h:103
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH11
#define _CSEN_TIMCTRL_PCPRESC_DIV2
#define CSEN_CTRL_CMPPOL_GT
#define _CSEN_DMCFG_CRMODE_DM12
#define CSEN_CTRL_CM_SGL
__STATIC_INLINE void CSEN_IntClear(CSEN_TypeDef *csen, uint32_t flags)
Clear one or more pending CSEN interrupts.
Definition: em_csen.h:627
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH29
#define _CSEN_PRSSEL_PRSSEL_PRSCH3
__STATIC_INLINE uint32_t CSEN_IntGetEnabled(CSEN_TypeDef *csen)
Get enabled and pending CSEN interrupt flags. Useful for handling more interrupt sources in the same ...
Definition: em_csen.h:711
#define _CSEN_CTRL_STM_PRS
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH30
__STATIC_INLINE void CSEN_IntSet(CSEN_TypeDef *csen, uint32_t flags)
Set one or more pending CSEN interrupts from SW.
Definition: em_csen.h:735
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH7
#define CSEN_CTRL_CHOPEN_ENABLE
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH14
CSEN_PRSSel_TypeDef prsSel
Definition: em_csen.h:384
#define _CSEN_EMACTRL_EMASAMPLE_W16
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH15
#define CSEN_CTRL_CMPPOL_LTE
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH21
#define _CSEN_CTRL_SARCR_CLK10
#define CSEN_CTRL_CM_SCAN
void CSEN_Reset(CSEN_TypeDef *csen)
Reset CSEN to same state as after a HW reset.
Definition: em_csen.c:267
__IOM uint32_t CMD
CSEN_AccMode_TypeDef accMode
Definition: em_csen.h:433
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH21
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3XCH20
#define _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT3CH8TO15
uint32_t inputMask0
Definition: em_csen.h:454
#define _CSEN_PRSSEL_PRSSEL_PRSCH6
__STATIC_INLINE uint32_t CSEN_IntGet(CSEN_TypeDef *csen)
Get pending CSEN interrupt flags.
Definition: em_csen.h:686
CSEN_GainSel_TypeDef
Definition: em_csen.h:241
#define CSEN_CMD_START
__IOM uint32_t IEN
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH31
#define _CSEN_TIMCTRL_PCPRESC_DIV16
#define _CSEN_SINGLECTRL_SINGLESEL_DEFAULT
#define _CSEN_PRSSEL_PRSSEL_PRSCH0
CSEN_SampleMode_TypeDef sampleMode
Definition: em_csen.h:421
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH19
#define _CSEN_CTRL_ACU_ACC1
uint8_t pcReload
Definition: em_csen.h:378
CSEN_TrigSel_TypeDef
Definition: em_csen.h:143
#define _CSEN_EMACTRL_EMASAMPLE_W64
#define _CSEN_PRSSEL_PRSSEL_PRSCH5
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH29
__STATIC_INLINE void BUS_RegBitWrite(volatile uint32_t *addr, unsigned int bit, unsigned int val)
Perform a single-bit write operation on a peripheral register.
Definition: em_bus.h:148
__IOM uint32_t IFS
#define _CSEN_CTRL_ACU_ACC64
__STATIC_INLINE void CSEN_EMASet(CSEN_TypeDef *csen, uint32_t ema)
Set exponential moving average initial value.
Definition: em_csen.h:581
CSEN_DriveSel_TypeDef
Definition: em_csen.h:227
void CSEN_InitMode(CSEN_TypeDef *csen, const CSEN_InitMode_TypeDef *init)
Initialize a CSEN measurement mode.
Definition: em_csen.c:186
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH10
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH22
__STATIC_INLINE void CSEN_Disable(CSEN_TypeDef *csen)
Disables the CSEN.
Definition: em_csen.h:593
#define _CSEN_DMCFG_CRMODE_DM10
#define _CSEN_TIMCTRL_PCPRESC_DIV128
#define _CSEN_CTRL_SARCR_CLK14
__IM uint32_t IF
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH8
#define _CSEN_TIMCTRL_PCPRESC_DIV64
#define _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT1CH16TO23
#define _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT3CH24TO31
CSEN_DMRes_TypeDef
Definition: em_csen.h:175
CSEN_DriveSel_TypeDef driveSel
Definition: em_csen.h:493
#define _CSEN_SCANINPUTSEL0_INPUT0TO7SEL_APORT1CH8TO15
#define _CSEN_EMA_EMA_MASK
#define _CSEN_CTRL_ACU_ACC16
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1XCH18
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH5
#define _CSEN_SINGLECTRL_SINGLESEL_APORT3YCH9
__IOM uint32_t CTRL
#define _CSEN_CTRL_SARCR_CLK16
#define _CSEN_SINGLECTRL_SINGLESEL_APORT1YCH25