ESP32Encoder
|
#include <ESP32Encoder.h>
Public Member Functions | |
ESP32Encoder () | |
~ESP32Encoder () | |
void | attachHalfQuad (int aPintNumber, int bPinNumber) |
void | attachFullQuad (int aPintNumber, int bPinNumber) |
void | attachSingleEdge (int aPintNumber, int bPinNumber) |
int64_t | getCount () |
int64_t | clearCount () |
int64_t | pauseCount () |
int64_t | resumeCount () |
boolean | isAttached () |
void | setCount (int64_t value) |
void | setFilter (uint16_t value) |
Data Fields | |
gpio_num_t | aPinNumber |
gpio_num_t | bPinNumber |
pcnt_unit_t | unit |
bool | fullQuad =false |
int | countsMode = 2 |
volatile int64_t | count =0 |
pcnt_config_t | r_enc_config |
Static Public Attributes | |
static ESP32Encoder * | encoders [MAX_ESP32_ENCODERS] |
static enum puType | useInternalWeakPullResistors |
Private Member Functions | |
void | attach (int aPintNumber, int bPinNumber, enum encType et) |
int64_t | getCountRaw () |
Private Attributes | |
boolean | attached =false |
bool | direction |
bool | working |
Static Private Attributes | |
static pcnt_isr_handle_t | user_isr_handle = NULL |
static bool | attachedInterrupt =false |
Definition at line 19 of file ESP32Encoder.h.
ESP32Encoder::ESP32Encoder | ( | ) |
Definition at line 21 of file ESP32Encoder.cpp.
References aPinNumber, attached, bPinNumber, direction, unit, and working.
ESP32Encoder::~ESP32Encoder | ( | ) |
Definition at line 30 of file ESP32Encoder.cpp.
|
private |
Definition at line 63 of file ESP32Encoder.cpp.
References _INT16_MAX, _INT16_MIN, aPinNumber, attached, attachedInterrupt, bPinNumber, DOWN, encoders, full, fullQuad, MAX_ESP32_ENCODERS, pcnt_example_intr_handler(), r_enc_config, setFilter(), single, unit, UP, useInternalWeakPullResistors, and user_isr_handle.
Referenced by attachFullQuad(), attachHalfQuad(), and attachSingleEdge().
void ESP32Encoder::attachFullQuad | ( | int | aPintNumber, |
int | bPinNumber | ||
) |
Definition at line 185 of file ESP32Encoder.cpp.
References attach(), and full.
void ESP32Encoder::attachHalfQuad | ( | int | aPintNumber, |
int | bPinNumber | ||
) |
Definition at line 178 of file ESP32Encoder.cpp.
References attach(), and half.
Referenced by setup().
void ESP32Encoder::attachSingleEdge | ( | int | aPintNumber, |
int | bPinNumber | ||
) |
Definition at line 182 of file ESP32Encoder.cpp.
References attach(), and single.
int64_t ESP32Encoder::clearCount | ( | ) |
int64_t ESP32Encoder::getCount | ( | ) |
Definition at line 197 of file ESP32Encoder.cpp.
References count, and getCountRaw().
Referenced by loop(), and setup().
|
private |
Definition at line 192 of file ESP32Encoder.cpp.
References unit.
Referenced by getCount(), and setCount().
|
inline |
Definition at line 42 of file ESP32Encoder.h.
References attached, setCount(), and setFilter().
int64_t ESP32Encoder::pauseCount | ( | ) |
int64_t ESP32Encoder::resumeCount | ( | ) |
void ESP32Encoder::setCount | ( | int64_t | value | ) |
Definition at line 189 of file ESP32Encoder.cpp.
References count, and getCountRaw().
Referenced by isAttached(), and setup().
void ESP32Encoder::setFilter | ( | uint16_t | value | ) |
Definition at line 214 of file ESP32Encoder.cpp.
References unit.
Referenced by attach(), and isAttached().
gpio_num_t ESP32Encoder::aPinNumber |
Definition at line 46 of file ESP32Encoder.h.
Referenced by attach(), and ESP32Encoder().
|
private |
Definition at line 22 of file ESP32Encoder.h.
Referenced by attach(), ESP32Encoder(), and isAttached().
|
staticprivate |
Definition at line 29 of file ESP32Encoder.h.
Referenced by attach().
gpio_num_t ESP32Encoder::bPinNumber |
Definition at line 47 of file ESP32Encoder.h.
Referenced by attach(), and ESP32Encoder().
volatile int64_t ESP32Encoder::count =0 |
Definition at line 51 of file ESP32Encoder.h.
Referenced by clearCount(), getCount(), pcnt_example_intr_handler(), and setCount().
int ESP32Encoder::countsMode = 2 |
Definition at line 50 of file ESP32Encoder.h.
|
private |
Definition at line 26 of file ESP32Encoder.h.
Referenced by ESP32Encoder().
|
static |
Definition at line 45 of file ESP32Encoder.h.
Referenced by attach().
bool ESP32Encoder::fullQuad =false |
Definition at line 49 of file ESP32Encoder.h.
Referenced by attach().
pcnt_config_t ESP32Encoder::r_enc_config |
Definition at line 52 of file ESP32Encoder.h.
Referenced by attach(), and pcnt_example_intr_handler().
pcnt_unit_t ESP32Encoder::unit |
Definition at line 48 of file ESP32Encoder.h.
Referenced by attach(), clearCount(), ESP32Encoder(), getCountRaw(), pauseCount(), resumeCount(), and setFilter().
|
static |
Definition at line 53 of file ESP32Encoder.h.
|
staticprivate |
Definition at line 25 of file ESP32Encoder.h.
Referenced by attach().
|
private |
Definition at line 27 of file ESP32Encoder.h.
Referenced by ESP32Encoder().