37 #if defined(PCNT_COUNT) && (PCNT_COUNT > 0)
59 #if defined(_EFM32_GECKO_FAMILY)
60 #define PCNT0_CNT_SIZE (8)
62 #define PCNT0_CNT_SIZE (16)
67 #define PCNT1_CNT_SIZE (8)
72 #define PCNT2_CNT_SIZE (8)
95 #if defined(_PCNT_CTRL_MODE_OVSQUAD1X)
97 pcntModeOvsQuad1 = _PCNT_CTRL_MODE_OVSQUAD1X,
100 pcntModeOvsQuad2 = _PCNT_CTRL_MODE_OVSQUAD2X,
103 pcntModeOvsQuad4 = _PCNT_CTRL_MODE_OVSQUAD4X,
108 #if defined(_PCNT_CTRL_CNTEV_MASK)
129 #if defined(_PCNT_INPUT_MASK)
137 #if defined(PCNT_INPUT_S0PRSSEL_PRSCH4)
140 #if defined(PCNT_INPUT_S0PRSSEL_PRSCH5)
143 #if defined(PCNT_INPUT_S0PRSSEL_PRSCH6)
146 #if defined(PCNT_INPUT_S0PRSSEL_PRSCH7)
149 #if defined(PCNT_INPUT_S0PRSSEL_PRSCH8)
152 #if defined(PCNT_INPUT_S0PRSSEL_PRSCH9)
155 #if defined(PCNT_INPUT_S0PRSSEL_PRSCH10)
158 #if defined(PCNT_INPUT_S0PRSSEL_PRSCH11)
208 #if defined(PCNT_CTRL_HYST)
235 #if !defined(PCNT_CTRL_HYST)
237 #define PCNT_INIT_DEFAULT \
240 _PCNT_CNT_RESETVALUE, \
241 _PCNT_TOP_RESETVALUE, \
248 #define PCNT_INIT_DEFAULT \
251 _PCNT_CNT_RESETVALUE, \
252 _PCNT_TOP_RESETVALUE, \
265 #if defined(PCNT_OVSCFG_FILTLEN_DEFAULT)
276 } PCNT_Filter_TypeDef;
280 #if defined(PCNT_OVSCFG_FILTLEN_DEFAULT)
281 #define PCNT_FILTER_DEFAULT \
288 #if defined(PCNT_CTRL_TCCMODE_DEFAULT)
294 tccModeDisabled = _PCNT_CTRL_TCCMODE_DISABLED,
297 tccModeLFA = _PCNT_CTRL_TCCMODE_LFA,
300 tccModePRS = _PCNT_CTRL_TCCMODE_PRS
301 } PCNT_TCCMode_TypeDef;
307 tccPrescDiv1 = _PCNT_CTRL_TCCPRESC_DIV1,
310 tccPrescDiv2 = _PCNT_CTRL_TCCPRESC_DIV2,
313 tccPrescDiv4 = _PCNT_CTRL_TCCPRESC_DIV4,
316 tccPrescDiv8 = _PCNT_CTRL_TCCPRESC_DIV8
317 } PCNT_TCCPresc_Typedef;
323 tccCompLTOE = _PCNT_CTRL_TCCCOMP_LTOE,
326 tccCompGTOE = _PCNT_CTRL_TCCCOMP_GTOE,
330 tccCompRange = _PCNT_CTRL_TCCCOMP_RANGE
331 } PCNT_TCCComp_Typedef;
337 PCNT_TCCMode_TypeDef mode;
340 PCNT_TCCPresc_Typedef prescaler;
343 PCNT_TCCComp_Typedef compare;
358 #define PCNT_TCC_DEFAULT \
390 #if defined(_PCNT_AUXCNT_MASK)
440 #if defined(PCNT_OVSCFG_FILTLEN_DEFAULT)
441 void PCNT_FilterConfiguration(
PCNT_TypeDef *pcnt,
const PCNT_Filter_TypeDef *config,
bool enable);
444 #if defined(_PCNT_INPUT_MASK)
450 #if defined(PCNT_CTRL_TCCMODE_DEFAULT)
451 void PCNT_TCCConfiguration(
PCNT_TypeDef *pcnt,
const PCNT_TCC_TypeDef *config);
556 return pcnt->
IF & ien;
#define _PCNT_CTRL_MODE_OVSSINGLE
__STATIC_INLINE uint32_t PCNT_TopBufferGet(PCNT_TypeDef *pcnt)
Get pulse counter top buffer value.
__STATIC_INLINE void PCNT_CounterSet(PCNT_TypeDef *pcnt, uint32_t count)
Set counter value.
void PCNT_CounterTopSet(PCNT_TypeDef *pcnt, uint32_t count, uint32_t top)
Set counter and top values.
void PCNT_Enable(PCNT_TypeDef *pcnt, PCNT_Mode_TypeDef mode)
Set PCNT operational mode.
__STATIC_INLINE void PCNT_IntEnable(PCNT_TypeDef *pcnt, uint32_t flags)
Enable one or more PCNT interrupts.
void PCNT_TopSet(PCNT_TypeDef *pcnt, uint32_t val)
Set top value.
#define _PCNT_CTRL_CNTEV_BOTH
void PCNT_PRSInputEnable(PCNT_TypeDef *pcnt, PCNT_PRSInput_TypeDef prsInput, bool enable)
Enable/disable the selected PRS input of PCNT.
__STATIC_INLINE void PCNT_IntClear(PCNT_TypeDef *pcnt, uint32_t flags)
Clear one or more pending PCNT interrupts.
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
#define _PCNT_CTRL_MODE_EXTCLKSINGLE
PCNT_CntEvent_TypeDef cntEvent
#define _PCNT_CTRL_MODE_DISABLE
#define _PCNT_CTRL_MODE_EXTCLKQUAD
__STATIC_INLINE void PCNT_IntDisable(PCNT_TypeDef *pcnt, uint32_t flags)
Disable one or more PCNT interrupts.
__STATIC_INLINE uint32_t PCNT_CounterGet(PCNT_TypeDef *pcnt)
Get pulse counter value.
PCNT_CntEvent_TypeDef auxCntEvent
__STATIC_INLINE void PCNT_IntSet(PCNT_TypeDef *pcnt, uint32_t flags)
Set one or more pending PCNT interrupts from SW.
#define _PCNT_CTRL_CNTEV_DOWN
#define _PCNT_CTRL_CNTEV_UP
__STATIC_INLINE uint32_t PCNT_IntGetEnabled(PCNT_TypeDef *pcnt)
Get enabled and pending PCNT interrupt flags.
void PCNT_CounterReset(PCNT_TypeDef *pcnt)
Reset PCNT counters and TOP register.
void PCNT_Init(PCNT_TypeDef *pcnt, const PCNT_Init_TypeDef *init)
Init pulse counter.
PCNT_PRSSel_TypeDef s1PRS
PCNT_PRSSel_TypeDef s0PRS
void PCNT_TopBufferSet(PCNT_TypeDef *pcnt, uint32_t val)
Set top buffer value.
__STATIC_INLINE uint32_t PCNT_TopGet(PCNT_TypeDef *pcnt)
Get pulse counter top value.
__STATIC_INLINE uint32_t PCNT_IntGet(PCNT_TypeDef *pcnt)
Get pending PCNT interrupt flags.
#define _PCNT_CTRL_CNTEV_NONE
__STATIC_INLINE uint32_t PCNT_AuxCounterGet(PCNT_TypeDef *pcnt)
Get auxiliary counter value.
void PCNT_FreezeEnable(PCNT_TypeDef *pcnt, bool enable)
PCNT register synchronization freeze control.
void PCNT_Reset(PCNT_TypeDef *pcnt)
Reset PCNT to same state as after a HW reset.