73#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
136 void* _context =
nullptr;
static constexpr gpio nc()
Returns a GPIO representing "not connected".
Incremental rotary encoder driver.
rotary_encoder & operator=(const rotary_encoder &)=delete
void enable_acceleration(uint16_t coeff)
Enables acceleration on the encoder.
void disable_acceleration()
Disables acceleration on the encoder.
~rotary_encoder()
Destroys the encoder.
static result< rotary_encoder > make(config cfg)
Creates a rotary encoder and begins tracking.
rotary_encoder(const rotary_encoder &)=delete
rotary_encoder & operator=(rotary_encoder &&other) noexcept
rotary_encoder(config cfg)
Creates a rotary encoder and begins tracking.
rotary_encoder(rotary_encoder &&other) noexcept
std::expected< T, std::error_code > result
result type wrapping a value or error code.
Rotary encoder configuration.
std::move_only_function< void(int32_t)> callback
Event callback (required)
std::optional< gpio::pull_mode > encoder_pins_pull_mode
Pull mode for encoder pins A and B, or std::nullopt to leave unchanged.
std::chrono::microseconds polling_interval
GPIO polling interval.
std::chrono::milliseconds acceleration_cap
Minimum interval (limits max acceleration)
idfxx::gpio pin_a
Encoder pin A (required)
std::chrono::milliseconds acceleration_threshold
Acceleration starts below this interval.
idfxx::gpio pin_b
Encoder pin B (required)