Chapter 2. API Reference
pcnt_ctrl_mode_t lctrl_mode
PCNT low control mode
pcnt_ctrl_mode_t hctrl_mode
PCNT high control mode
pcnt_count_mode_t pos_mode
PCNT positive edge count mode
pcnt_count_mode_t neg_mode
PCNT negative edge count mode
int16_t counter_h_lim
Maximum counter value
int16_t counter_l_lim
Minimum counter value
pcnt_unit_t unit
PCNT unit number
pcnt_channel_t channel
the PCNT channel
Macros
PCNT_PIN_NOT_USED
When selected for a pin, this pin will not be used
PCNT_MODE_KEEP
Control mode: won’t change counter mode
PCNT_MODE_REVERSE
Control mode: invert counter mode(increase -> decrease, decrease -> increase)
PCNT_MODE_DISABLE
Control mode: Inhibit counter(counter value will not change in this condition)
PCNT_MODE_MAX
PCNT_COUNT_DIS
Counter mode: Inhibit counter(counter value will not change in this condition)
PCNT_COUNT_INC
Counter mode: Increase counter value
PCNT_COUNT_DEC
Counter mode: Decrease counter value
PCNT_COUNT_MAX
Type Definitions
typedef intr_handle_t pcnt_isr_handle_t
typedef pcnt_channel_level_action_t pcnt_ctrl_mode_t
Selection of available modes that determine the counter’s action depending on the state of the control signal’
s input GPIO.
Note Configuration covers two actions, one for high, and one for low level on the control input
typedef pcnt_channel_edge_action_t pcnt_count_mode_t
Selection of available modes that determine the counter’s action on the edge of the pulse signal’s input GPIO.
Note Configuration covers two actions, one for positive, and one for negative edge on the pulse input
Espressif Systems 336
Submit Document Feedback
Release v4.4