Relative Rotary Encoder.
More...
#include <InputHardware.hpp>
|
| static bool | setPulseMultiplier (uint8_t multiplier) |
| | Set a time multiplier for "pulse" events.
|
| |
|
| uint64_t | mask = ~0ULL |
| | Input mask. For read-only.
|
| |
| void | addToMask (uint64_t bitmap) |
| | Add an input bitmap to the current mask.
|
| |
Relative Rotary Encoder.
Definition at line 103 of file InputHardware.hpp.
◆ RotaryEncoderInput()
Construct a new Rotary Encoder Input object.
- Parameters
-
| [in] | clkPin | GPIO pin attached to the "CLK" (or "A") pin of the encoder. |
| [in] | dtPin | GPIO pin attached to the "DT" (or "B") pin of the encoder. |
| [in] | cwButtonNumber | A number for the "virtual button" of a clockwise rotation event. |
| [in] | ccwButtonNumber | A number for the "virtual button" of a counter-clockwise rotation event. If not given, cwButtonNumber+1 is used. |
| [in] | useAlternateEncoding | Set 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.
◆ read()
| virtual uint64_t RotaryEncoderInput::read |
( |
uint64_t | lastState | ) |
|
|
overridevirtual |
Read the current state of the inputs (pressed or released)
- Warning
- This function must not set any bit outside of the input bitmask in the return value.
- Parameters
-
| lastState | State of the same inputs as recorded in the previous iteration. Whether the current state is unknown, lastState must be returned (properly masked). Must be set to zero at first call. |
- Returns
- uint64_t Current state of the inputs (a bit set to 1 means a pressed button).
Implements DigitalInput.
◆ setPulseMultiplier()
| static bool RotaryEncoderInput::setPulseMultiplier |
( |
uint8_t | multiplier | ) |
|
|
inlinestatic |
Set a time multiplier for "pulse" events.
- Parameters
-
| multiplier | A time multiplier between 1 and 6. Invalid values are ignored. |
- Returns
- true if the multiplier has changed.
-
false otherwise.
Definition at line 159 of file InputHardware.hpp.
◆ 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 130 of file InputHardware.hpp.
The documentation for this class was generated from the following file: