EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #345 background imageLoading...
Page #345 background image
Chapter 2. API Reference
pulse_io: Pulse signal input GPIO
ctrl_io: Control signal input GPIO
esp_err_t pcnt_filter_enable(pcnt_unit_t unit)
Enable PCNT input filter.
Return
ESP_OK Success
ESP_ERR_INVALID_STATE pcnt driver has not been initialized
ESP_ERR_INVALID_ARG Parameter error
Parameters
unit: PCNT unit number
esp_err_t pcnt_filter_disable(pcnt_unit_t unit)
Disable PCNT input filter.
Return
ESP_OK Success
ESP_ERR_INVALID_STATE pcnt driver has not been initialized
ESP_ERR_INVALID_ARG Parameter error
Parameters
unit: PCNT unit number
esp_err_t pcnt_set_filter_value(pcnt_unit_t unit, uint16_t filter_val)
Set PCNT filter value.
Note filter_val is a 10-bit value, so the maximum filter_val should be limited to 1023.
Return
ESP_OK Success
ESP_ERR_INVALID_STATE pcnt driver has not been initialized
ESP_ERR_INVALID_ARG Parameter error
Parameters
unit: PCNT unit number
filter_val: PCNT signal filter value, counter in APB_CLK cycles. Any pulses lasting shorter
than this will be ignored when the filter is enabled.
esp_err_t pcnt_get_filter_value(pcnt_unit_t unit, uint16_t *filter_val)
Get PCNT filter value.
Return
ESP_OK Success
ESP_ERR_INVALID_STATE pcnt driver has not been initialized
ESP_ERR_INVALID_ARG Parameter error
Parameters
unit: PCNT unit number
filter_val: Pointer to accept PCNT filter value.
esp_err_t pcnt_set_mode(pcnt_unit_t unit, pcnt_channel_t channel, pcnt_count_mode_t
pos_mode, pcnt_count_mode_t neg_mode, pcnt_ctrl_mode_t hctrl_mode,
pcnt_ctrl_mode_t lctrl_mode)
Set PCNT counter mode.
Return
ESP_OK Success
ESP_ERR_INVALID_STATE pcnt driver has not been initialized
ESP_ERR_INVALID_ARG Parameter error
Parameters
unit: PCNT unit number
channel: PCNT channel number
pos_mode: Counter mode when detecting positive edge
neg_mode: Counter mode when detecting negative edge
hctrl_mode: Counter mode when control signal is high level
lctrl_mode: Counter mode when control signal is low level
Espressif Systems 334
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish