libyggdrasil
v1.0.0
|
Timer encoder implementation for Midgard. More...
#include <timer.hpp>
Public Types | |
enum | Direction : u8 { Direction::Clockwise, Direction::CounterClockwise } |
Last known turning direction of the encoder. More... | |
enum | Mode : u8 { Mode::_48StepsPerTurn, Mode::_96StepsPerTurn } |
Modes for the encoder, 48 odr 96 steps per turn are possible. More... | |
Public Member Functions | |
ALWAYS_INLINE bool | enable () const noexcept |
Enable the encoder mode. More... | |
ALWAYS_INLINE bool | disable () const noexcept |
Disable the encoder mode. More... | |
ALWAYS_INLINE Size | getCount () const noexcept |
Get the counter value. More... | |
ALWAYS_INLINE void | setCount (Size cnt) const noexcept |
Set the encoder counter value. More... | |
ALWAYS_INLINE Direction | getDirection () const noexcept |
Get the direction of the last rotation. More... | |
ALWAYS_INLINE void | setMode (Mode mode) const noexcept |
Set the mode of the encoder (48 or 96 counts per turn) More... | |
ALWAYS_INLINE bool | init () const noexcept |
Initialization function for the encoder. More... | |
Timer encoder implementation for Midgard.
|
strong |
|
strong |
|
inlinenoexcept |
Disable the encoder mode.
|
inlinenoexcept |
Enable the encoder mode.
|
inlinenoexcept |
Get the counter value.
|
inlinenoexcept |
Get the direction of the last rotation.
|
inlinenoexcept |
Initialization function for the encoder.
|
inlinenoexcept |
Set the encoder counter value.
cnt | New counter value |
|
inlinenoexcept |
Set the mode of the encoder (48 or 96 counts per turn)
mode | Mode selection |