Arduino Helpers master
Utility library for Arduino
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 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. More...
 
EncoderPositionType readAndReset ()
 Read the position of the encoder and reset it to zero. More...
 
void write (EncoderPositionType pos)
 Set the position of the encoder. More...
 

Private Member Functions

 Encoder (EncoderPositionStorageType *position)
 

Private Attributes

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

Constructor & Destructor Documentation

◆ Encoder()

Encoder ( EncoderPositionStorageType position)
inlineprivate

Definition at line 202 of file RegisterEncoders.hpp.

Member Function Documentation

◆ read()

EncoderPositionType read ( ) const
inline

Read the position of the encoder.

See also
RegisterEncoders::read

Definition at line 207 of file RegisterEncoders.hpp.

◆ readAndReset()

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()

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

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: