PCNT - Pulse Counter

Description

Pulse Counter (PCNT) Peripheral API.

This module contains functions to control the PCNT peripheral of Silicon Labs 32-bit MCUs and SoCs. The PCNT decodes incoming pulses. The module has a quadrature mode which may be used to decode the speed and direction of a mechanical shaft.

Data Structures

struct PCNT_Init_TypeDef
Initialization structure.
struct PCNT_Filter_TypeDef
Filter initialization structure.
struct PCNT_TCC_TypeDef
TCC initialization structure.

Functions

uint32_t PCNT_CounterGet (PCNT_TypeDef *pcnt)
Get pulse counter value.
uint32_t PCNT_AuxCounterGet (PCNT_TypeDef *pcnt)
Get auxiliary counter value.
void PCNT_CounterReset (PCNT_TypeDef *pcnt)
Reset PCNT counters and TOP register.
void PCNT_CounterTopSet (PCNT_TypeDef *pcnt, uint32_t count, uint32_t top)
Set the counter and top values.
void PCNT_CounterSet (PCNT_TypeDef *pcnt, uint32_t count)
Set counter value.
void PCNT_Enable (PCNT_TypeDef *pcnt, PCNT_Mode_TypeDef mode)
Set PCNT operational mode.
bool PCNT_IsEnabled (PCNT_TypeDef *pcnt)
Returns if the PCNT module is enabled or not.
void PCNT_FreezeEnable (PCNT_TypeDef *pcnt, bool enable)
PCNT register synchronization freeze control.