Utility functions to decode signals from a 2-bit rotary encoder.
More...
|
struct | rotenc |
| Rotary encoder click counts and state tracking. More...
|
|
Utility functions to decode signals from a 2-bit rotary encoder.
#define ROTENC_VAR_INIT { 0 } |
Static initializer for a rotary encoder.
Definition at line 39 of file rotenc.h.
Rotary encoder click counts and state tracking.
Read a 14-bit count of the current knob position.
Suitable for higher resolution devices.
Definition at line 45 of file rotenc.c.
void rotenc_decode |
( |
rotenc_t * |
r, |
|
|
uint8_t |
state |
|
) |
| |
Handle a state update.
It is safe to call this function when there has not actually been a change of state, this allows it to be used as a polling function.
No external debounce is required.
Definition at line 16 of file rotenc.c.