Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RegisterEncoders< RegisterType, NumEnc, EncoderPositionType, InterruptSafe >::Encoder Class Reference

#include <AH/Hardware/RegisterEncoders.hpp>

Detailed Description

template<class RegisterType, uint8_t NumEnc, class EncoderPositionType = int32_t, bool InterruptSafe = false>
class AH::RegisterEncoders< RegisterType, NumEnc, EncoderPositionType, InterruptSafe >::Encoder

Proxy to access a single encoder of the encoders managed by RegisterEncoders.

Definition at line 195 of file RegisterEncoders.hpp.

+ Collaboration diagram for RegisterEncoders< RegisterType, NumEnc, EncoderPositionType, InterruptSafe >::Encoder:

Public Member Functions

EncoderPositionType read () const
 Read the position of the encoder.
 
EncoderPositionType readAndReset ()
 Read the position of the encoder and reset it to zero.
 
void write (EncoderPositionType pos)
 Set the position of the encoder.
 

Private Member Functions

 Encoder (EncoderPositionStorageType *position)
 

Private Attributes

EncoderPositionStorageTypeposition
 A pointer to the position value inside of the RegisterEncoders class.
 

Constructor & Destructor Documentation

◆ Encoder()

template<class RegisterType , uint8_t NumEnc, class EncoderPositionType = int32_t, bool InterruptSafe = false>
Encoder ( EncoderPositionStorageType * position)
inlineprivate

Definition at line 202 of file RegisterEncoders.hpp.

Member Function Documentation

◆ read()

template<class RegisterType , uint8_t NumEnc, class EncoderPositionType = int32_t, bool InterruptSafe = false>
EncoderPositionType read ( ) const
inline

Read the position of the encoder.

See also
RegisterEncoders::read

Definition at line 207 of file RegisterEncoders.hpp.

◆ readAndReset()

template<class RegisterType , uint8_t NumEnc, class EncoderPositionType = int32_t, bool InterruptSafe = false>
EncoderPositionType readAndReset ( )
inline

Read the position of the encoder and reset it to zero.

See also
RegisterEncoders::readAndReset

Definition at line 220 of file RegisterEncoders.hpp.

◆ write()

template<class RegisterType , uint8_t NumEnc, class EncoderPositionType = int32_t, bool InterruptSafe = false>
void write ( EncoderPositionType pos)
inline

Set the position of the encoder.

See also
RegisterEncoders::write

Definition at line 236 of file RegisterEncoders.hpp.

Member Data Documentation

◆ position

template<class RegisterType , uint8_t NumEnc, class EncoderPositionType = int32_t, bool InterruptSafe = false>
EncoderPositionStorageType* position
private

A pointer to the position value inside of the RegisterEncoders class.

Definition at line 200 of file RegisterEncoders.hpp.


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