Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
pcnt_esp32.h File Reference

ESP32 PCNT driver public extensions. More...

Go to the source code of this file.

Macros

#define SENSOR_CHAN_PCNT_ESP32_UNIT(n)
 Produce a sensor_channel value selecting PCNT unit n.

Enumerations

enum  sensor_attribute_pcnt_esp32 { SENSOR_ATTR_PCNT_ESP32_RESET = SENSOR_ATTR_PRIV_START }
 PCNT-specific sensor attributes. More...

Detailed Description

ESP32 PCNT driver public extensions.

Helpers for addressing a specific PCNT unit through the legacy sensor_attr_set()/sensor_attr_get()/sensor_trigger_set() APIs, which do not natively carry a channel index. Multi-unit access through the Read-and-Decode API uses sensor_chan_spec.chan_idx directly and does not need these helpers.

Macro Definition Documentation

◆ SENSOR_CHAN_PCNT_ESP32_UNIT

#define SENSOR_CHAN_PCNT_ESP32_UNIT ( n)
Value:
sensor_channel
Sensor channels.
Definition sensor.h:66
@ SENSOR_CHAN_PRIV_START
This and higher values are sensor specific.
Definition sensor.h:253

Produce a sensor_channel value selecting PCNT unit n.

Pass as the chan argument of sensor_attr_set/attr_get or the chan field of struct sensor_trigger to target unit n. Unit 0 may also be addressed with SENSOR_CHAN_ROTATION or SENSOR_CHAN_ENCODER_COUNT.

Enumeration Type Documentation

◆ sensor_attribute_pcnt_esp32

PCNT-specific sensor attributes.

Enumerator
SENSOR_ATTR_PCNT_ESP32_RESET 

Clear the hardware counter of the addressed unit and reset the cached value to zero.

The val argument is ignored.