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.

Functions

uint32_t PCNT_CounterGet (PCNT_TypeDef *pcnt)
Default configuration for PCNT initialization structure.
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.
void PCNT_Init (PCNT_TypeDef *pcnt, const PCNT_Init_TypeDef *init)
Initialize the pulse counter.
void PCNT_PRSInputEnable (PCNT_TypeDef *pcnt, PCNT_PRSInput_TypeDef prsInput, bool enable)
Enable/disable the selected PRS input of PCNT.
void PCNT_IntClear (PCNT_TypeDef *pcnt, uint32_t flags)
Clear one or more pending PCNT interrupts.
void PCNT_IntDisable (PCNT_TypeDef *pcnt, uint32_t flags)
Disable one or more PCNT interrupts.
void PCNT_IntEnable (PCNT_TypeDef *pcnt, uint32_t flags)
Enable one or more PCNT interrupts.
uint32_t PCNT_IntGet (PCNT_TypeDef *pcnt)
Get pending PCNT interrupt flags.
uint32_t PCNT_IntGetEnabled (PCNT_TypeDef *pcnt)
Get enabled and pending PCNT interrupt flags.
void PCNT_IntSet (PCNT_TypeDef *pcnt, uint32_t flags)
Set one or more pending PCNT interrupts from SW.
void PCNT_Reset (PCNT_TypeDef *pcnt)
Reset PCNT to the same state that it was in after a hardware reset.
uint32_t PCNT_TopBufferGet (PCNT_TypeDef *pcnt)
Get pulse counter top buffer value.
void PCNT_TopBufferSet (PCNT_TypeDef *pcnt, uint32_t val)
Set top buffer value.
uint32_t PCNT_TopGet (PCNT_TypeDef *pcnt)
Get pulse counter top value.
void PCNT_TopSet (PCNT_TypeDef *pcnt, uint32_t val)
Set the top value.
void PCNT_Sync (PCNT_TypeDef *pcnt, uint32_t mask)
Wait for an ongoing sync of register(s) to low-frequency domain to complete.