Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
EncoderState< Enc_t > Class Template Reference

#include <MIDI_Outputs/Abstract/EncoderState.hpp>

Detailed Description

template<class Enc_t>
class EncoderState< Enc_t >

Class to keep track of relative position changes of rotary encoders.

Definition at line 11 of file EncoderState.hpp.

Collaboration diagram for EncoderState< Enc_t >:

Public Member Functions

 EncoderState (int16_t speedMultiply, uint8_t pulsesPerStep)
int16_t update (Enc_t encval)
void setSpeedMultiply (int16_t speedMultiply)
int16_t getSpeedMultiply () const

Private Types

using SignedEnc_t = typename std::make_signed<Enc_t>::type

Private Attributes

int16_t speedMultiply
uint8_t pulsesPerStep
int16_t remainder = 0
Enc_t deltaOffset = 0

Member Typedef Documentation

◆ SignedEnc_t

template<class Enc_t>
using SignedEnc_t = typename std::make_signed<Enc_t>::type
private

Definition at line 13 of file EncoderState.hpp.

Constructor & Destructor Documentation

◆ EncoderState()

template<class Enc_t>
EncoderState ( int16_t speedMultiply,
uint8_t pulsesPerStep )
inline

Definition at line 20 of file EncoderState.hpp.

Member Function Documentation

◆ update()

template<class Enc_t>
int16_t update ( Enc_t encval)
inline

Definition at line 23 of file EncoderState.hpp.

◆ setSpeedMultiply()

template<class Enc_t>
void setSpeedMultiply ( int16_t speedMultiply)
inline

Definition at line 40 of file EncoderState.hpp.

◆ getSpeedMultiply()

template<class Enc_t>
int16_t getSpeedMultiply ( ) const
inline

Definition at line 45 of file EncoderState.hpp.

Member Data Documentation

◆ speedMultiply

template<class Enc_t>
int16_t speedMultiply
private

Definition at line 14 of file EncoderState.hpp.

◆ pulsesPerStep

template<class Enc_t>
uint8_t pulsesPerStep
private

Definition at line 15 of file EncoderState.hpp.

◆ remainder

template<class Enc_t>
int16_t remainder = 0
private

Definition at line 16 of file EncoderState.hpp.

◆ deltaOffset

template<class Enc_t>
Enc_t deltaOffset = 0
private

Definition at line 17 of file EncoderState.hpp.


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