Initialization structure.
Public Attributes#
Mode to operate in.
Initial counter value (refer to reference manual for max value allowed).
Initial top value (refer to reference manual for max value allowed).
Polarity of incoming edge.
Counting direction, only applicable for pcntModeOvsSingle and pcntModeExtSingle modes.
Enable filter, only available in pcntModeOvsSingle* mode.
Enable/disable PCNT counting during debug halt.
Set to true to enable hysteresis.
Set to true to enable S1 to determine the direction of counting in OVSSINGLE or EXTCLKSINGLE modes.
Selects whether the regular counter responds to up-count events, down-count events, both, or none.
Selects whether the auxiliary counter responds to up-count events, down-count events, both, or none.
Select PRS channel as input to S0IN in PCNTx_INPUT register.
Select PRS channel as input to S1IN in PCNTx_INPUT register.
Public Attribute Documentation#
counter#
uint32_t PCNT_Init_TypeDef::counter
Initial counter value (refer to reference manual for max value allowed).
Only used for pcntModeOvsSingle (and possibly pcntModeDisable) modes. If using pcntModeExtSingle or pcntModeExtQuad modes, counter value is reset to HW reset value.
top#
uint32_t PCNT_Init_TypeDef::top
Initial top value (refer to reference manual for max value allowed).
Only used for pcntModeOvsSingle (and possibly pcntModeDisable) modes. If using pcntModeExtSingle or pcntModeExtQuad modes, top value is reset to HW reset value.
negEdge#
bool PCNT_Init_TypeDef::negEdge
Polarity of incoming edge.
pcntModeExtSingle mode - if false, positive edges are counted, otherwise negative edges.
pcntModeExtQuad mode - if true, counting direction is inverted.
countDown#
bool PCNT_Init_TypeDef::countDown
Counting direction, only applicable for pcntModeOvsSingle and pcntModeExtSingle modes.
debugHalt#
bool PCNT_Init_TypeDef::debugHalt
Enable/disable PCNT counting during debug halt.
Only in OVSSINGLE and OVSQUAD modes.
hyst#
bool PCNT_Init_TypeDef::hyst
Set to true to enable hysteresis.
When enabled, PCNT will always overflow and underflow to TOP/2.
s1CntDir#
bool PCNT_Init_TypeDef::s1CntDir
Set to true to enable S1 to determine the direction of counting in OVSSINGLE or EXTCLKSINGLE modes.
When S1 is high, the count direction is given by CNTDIR, and when S1 is low, the count direction is the opposite.
cntEvent#
PCNT_CntEvent_TypeDef PCNT_Init_TypeDef::cntEvent
Selects whether the regular counter responds to up-count events, down-count events, both, or none.
auxCntEvent#
PCNT_CntEvent_TypeDef PCNT_Init_TypeDef::auxCntEvent
Selects whether the auxiliary counter responds to up-count events, down-count events, both, or none.
s0PRS#
PCNT_PRSSel_TypeDef PCNT_Init_TypeDef::s0PRS
Select PRS channel as input to S0IN in PCNTx_INPUT register.
s1PRS#
PCNT_PRSSel_TypeDef PCNT_Init_TypeDef::s1PRS
Select PRS channel as input to S1IN in PCNTx_INPUT register.