Control Surface main
MIDI Control Surface library for Arduino
Public Member Functions | Private Types | Private Attributes | List of all members
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

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

Definition at line 13 of file EncoderState.hpp.

Constructor & Destructor Documentation

◆ EncoderState()

EncoderState ( int16_t  speedMultiply,
uint8_t  pulsesPerStep 
)
inline

Definition at line 20 of file EncoderState.hpp.

Member Function Documentation

◆ update()

int16_t update ( Enc_t  encval)
inline

Definition at line 23 of file EncoderState.hpp.

◆ setSpeedMultiply()

void setSpeedMultiply ( int16_t  speedMultiply)
inline

Definition at line 40 of file EncoderState.hpp.

◆ getSpeedMultiply()

int16_t getSpeedMultiply ( ) const
inline

Definition at line 45 of file EncoderState.hpp.

Member Data Documentation

◆ speedMultiply

int16_t speedMultiply
private

Definition at line 14 of file EncoderState.hpp.

◆ pulsesPerStep

uint8_t pulsesPerStep
private

Definition at line 15 of file EncoderState.hpp.

◆ remainder

int16_t remainder = 0
private

Definition at line 16 of file EncoderState.hpp.

◆ deltaOffset

Enc_t deltaOffset = 0
private

Definition at line 17 of file EncoderState.hpp.


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