OpenSourceSimWheelESP32
Open-source wireless steering wheel/button box for ESP32 boards
Loading...
Searching...
No Matches
RotaryEncoderInput Class Reference

Relative Rotary Encoder. More...

#include <InputHardware.hpp>

Public Member Functions

 RotaryEncoderInput (InputGPIO clkPin, InputGPIO dtPin, InputNumber cwButtonNumber, InputNumber ccwButtonNumber, bool useAlternateEncoding=false)
 Construct a new Rotary Encoder Input object.
 
virtual void read (uint128_t &state) override
 Read the current state of the inputs (pressed or released)
 
- Public Member Functions inherited from DigitalInput

Static Public Member Functions

static bool setPulseMultiplier (uint8_t multiplier)
 Set a time multiplier for "pulse" events.
 

Static Public Attributes

static uint8_t pulseMultiplier = 1
 Pulse multiplier for rotary encoders.
 

Detailed Description

Relative Rotary Encoder.

Definition at line 88 of file InputHardware.hpp.

Constructor & Destructor Documentation

◆ RotaryEncoderInput()

RotaryEncoderInput::RotaryEncoderInput ( InputGPIO clkPin,
InputGPIO dtPin,
InputNumber cwButtonNumber,
InputNumber ccwButtonNumber,
bool useAlternateEncoding = false )

Construct a new Rotary Encoder Input object.

Parameters
[in]clkPinGPIO pin attached to the "CLK" (or "A") pin of the encoder.
[in]dtPinGPIO pin attached to the "DT" (or "B") pin of the encoder.
[in]cwButtonNumberAn input number for the clockwise rotation event.
[in]ccwButtonNumberAn input number for the counter-clockwise rotation event.
[in]useAlternateEncodingSet to true in order to use the signal encoding of ALPS RKJX series of rotary encoders, and the alike.
Note
Internal pullup resistors will be enabled when available.

Member Function Documentation

◆ read()

virtual void RotaryEncoderInput::read ( uint128_t & state)
overridevirtual

Read the current state of the inputs (pressed or released)

Warning
This function must not set or clear any bit outside of the input bitmask in the return value.
Parameters
[in,out]stateAt call, state of all inputs as recorded in the previous iteration. Whether the current state is unknown, state must be kept untouched. At return, new state of the inputs.

Implements DigitalInput.

◆ setPulseMultiplier()

static bool RotaryEncoderInput::setPulseMultiplier ( uint8_t multiplier)
inlinestatic

Set a time multiplier for "pulse" events.

Parameters
multiplierA time multiplier between 1 and 6. Invalid values are ignored.
Returns
true if the multiplier has changed.
false otherwise.

Definition at line 149 of file InputHardware.hpp.

Member Data Documentation

◆ pulseMultiplier

uint8_t RotaryEncoderInput::pulseMultiplier = 1
inlinestatic

Pulse multiplier for rotary encoders.

Note
For read only. Do not overwrite. Always greater than zero.

Definition at line 116 of file InputHardware.hpp.


The documentation for this class was generated from the following file: