Chapter 2. API Reference
LEDC_TIMER_7_BIT
LEDC PWM duty resolution of 7 bits
LEDC_TIMER_8_BIT
LEDC PWM duty resolution of 8 bits
LEDC_TIMER_9_BIT
LEDC PWM duty resolution of 9 bits
LEDC_TIMER_10_BIT
LEDC PWM duty resolution of 10 bits
LEDC_TIMER_11_BIT
LEDC PWM duty resolution of 11 bits
LEDC_TIMER_12_BIT
LEDC PWM duty resolution of 12 bits
LEDC_TIMER_13_BIT
LEDC PWM duty resolution of 13 bits
LEDC_TIMER_14_BIT
LEDC PWM duty resolution of 14 bits
LEDC_TIMER_BIT_MAX
enum ledc_fade_mode_t
Values:
LEDC_FADE_NO_WAIT = 0
LEDC fade function will return immediately
LEDC_FADE_WAIT_DONE
LEDC fade function will block until fading to the target duty
LEDC_FADE_MAX
2.2.12 Pulse Counter (PCNT)
Introduction
The PCNT (Pulse Counter) module is designed to count the number of rising and/or falling edges of an input signal.
Each pulse counter unit has a 16-bit signed counter register and two channels that can be configured to either increment
or decrement the counter. Each channel has a signal input that accepts signal edges to be detected, as well as a control
input that can be used to enable or disable the signal input. The inputs have optional filters that can be used to discard
unwanted glitches in the signal.
Functionality Overview
Description of functionality of this API has been broken down into four sections:
•
Configuration
- describes counter's configuration parameters and how to setup the counter.
•
Operating the Counter
•
Filtering Pulses
- describes options to filtering pulses and the counter control signals.
•
Using Interrupts
- presents how to trigger interrupts on specific states of the counter.
Configuration
The PCNT module has 4 independent counting "units"numbered from 0 to 3. In the API they are referred
to using pcnt_unit_t. Each unit has two independent channels numbered as 0 and 1 and specified with
pcnt_channel_t.
The configuration is provided separately per unit's channel using
Espressif Systems
- provides information on control functions to pause, measure and clear the counter.
Submit Document Feedback
pcnt_config_t
329
and covers:
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?