|
| | ExpanderEncoderAdapter (uint8_t encoderPinA, uint8_t encoderPinB, GpioExpanderAdapter &expander, bool externalUpdate=false) |
| | Construct a ExpanderEncoderAdapter. More...
|
| |
| bool | begin () override |
| | For compatibility with the Arduino library convention. More...
|
| |
| virtual int32_t | getPosition () override |
| | Get the current position of the encoder. More...
|
| |
| virtual void | setPosition (int32_t pos) |
| | Set the a new position of the encoder. For some libraries this may only allow it to be set to 0. More...
|
| |
|
virtual void | update () |
| | Update position using the table.
|
| |
|
virtual | ~IEncoderAdapter ()=default |
| | Destructor to ensure predictable behavious if derived classes are destroyed.
|
| |
| virtual bool | begin (void)=0 |
| | For compatibility with the Arduino library convention. More...
|
| |
| virtual int32_t | getPosition (void)=0 |
| | Get the current position as reported by the encoder class. More...
|
| |
| virtual void | setPosition (int32_t pos)=0 |
| | Set the a new position of the encoder. For some libraries this may only allow it to be set to 0. More...
|
| |
|
| uint8_t | readPin (uint8_t pin) const override |
| | Concrete implementations must provide a method to read pin values. More...
|
| |
| virtual uint8_t | readPin (uint8_t pin) const =0 |
| | Concrete implementations must provide a method to read pin values. More...
|
| |
|
|
uint8_t | _pinA |
| |
|
uint8_t | _pinB |
| |
|
uint8_t | _prevState = 0 |
| |
|
int32_t | _position = 0 |
| |
|
bool | _externalUpdate = false |
| | Some implementations may allow the update via an interupt.
|
| |
| static constexpr int8_t | table [16] |
| |
◆ ExpanderEncoderAdapter()
| ExpanderEncoderAdapter::ExpanderEncoderAdapter |
( |
uint8_t |
encoderPinA, |
|
|
uint8_t |
encoderPinB, |
|
|
GpioExpanderAdapter & |
expander, |
|
|
bool |
externalUpdate = false |
|
) |
| |
|
inline |
◆ begin()
| bool ExpanderEncoderAdapter::begin |
( |
| ) |
|
|
inlineoverridevirtual |
For compatibility with the Arduino library convention.
Must be implemented (but can be empty) as some libraries require it. Can return a boolean to indicate if initialisation has failed.
- Returns
- true The initialisation was successful.
-
false The initialisation was failed.
Implements IEncoderAdapter.
◆ readPin()
| uint8_t ExpanderEncoderAdapter::readPin |
( |
uint8_t |
pin | ) |
const |
|
inlineoverrideprotectedvirtual |
Concrete implementations must provide a method to read pin values.
- Parameters
-
- Returns
- uint8_t
Implements BaseTableEncoderAdapter.
The documentation for this class was generated from the following file: