![]() |
Open FFBoard
Open source force feedback firmware
|
#include <Encoder.h>
Public Member Functions | |
Encoder () | |
virtual | ~Encoder () |
const ClassIdentifier | getInfo () |
virtual EncoderType | getEncoderType () |
virtual int32_t | getPos () |
virtual float | getPos_f () |
virtual int32_t | getPosAbs () |
virtual float | getPosAbs_f () |
virtual void | setPos (int32_t pos) |
virtual uint32_t | getCpr () |
virtual const ClassType | getClassType () override |
returns the used classchooser selection id of this instance More... | |
![]() | |
virtual | ~ChoosableClass () |
uint16_t | getSelectionID () |
Static Public Attributes | |
static ClassIdentifier | info ={.name = "None" , .id=CLSID_ENCODER_NONE, .visibility = ClassVisibility::visible} |
static const std::vector< class_entry< Encoder > > | all_encoders |
![]() | |
static ClassIdentifier | info |
Protected Attributes | |
uint32_t | cpr = 0 |
![]() | |
uint16_t | selectionId |
Should only be written by ClassChooser during creation. More... | |
Additional Inherited Members | |
![]() | |
static bool | isCreatable () |
Encoder::Encoder | ( | ) |
Definition at line 18 of file Encoder.cpp.
|
virtual |
Definition at line 22 of file Encoder.cpp.
|
inlineoverridevirtual |
returns the used classchooser selection id of this instance
Type of this class. Mainclass, motordriver... Should be implemented by the parent class so it is not in the info struct
Reimplemented from ChoosableClass.
Reimplemented in TMC4671.
|
virtual |
Gets the amount of counts per full rotation of the encoder
Reimplemented in EncoderBissC, EncoderSSI, TMC4671, MotorSimplemotion, MtEncoderSPI, ODriveCAN, RmdMotorCAN, and VescCAN.
Definition at line 36 of file Encoder.cpp.
|
virtual |
Returns the type of the encoder. Must override this and NOT return NONE in other classes
Reimplemented in EncoderBissC, EncoderLocal, EncoderSSI, MtEncoderSPI, MotorSimplemotion, ODriveCAN, RmdMotorCAN, TMC4671, and VescCAN.
Definition at line 29 of file Encoder.cpp.
|
virtual |
Implements ChoosableClass.
Reimplemented in EncoderBissC, EncoderLocal, EncoderSSI, MotorSimplemotion1, MotorSimplemotion2, MtEncoderSPI, ODriveCAN1, ODriveCAN2, RmdMotorCAN1, RmdMotorCAN2, TMC4671, VESC_1, VESC_2, MotorSimplemotion, ODriveCAN, and RmdMotorCAN.
Definition at line 14 of file Encoder.cpp.
|
virtual |
Returns the encoder position as raw counts
Reimplemented in EncoderBissC, EncoderLocal, EncoderSSI, MotorSimplemotion, MtEncoderSPI, ODriveCAN, RmdMotorCAN, TMC4671, and VescCAN.
Definition at line 44 of file Encoder.cpp.
|
virtual |
Returns a float position in rotations
Reimplemented in ODriveCAN, and VescCAN.
Definition at line 67 of file Encoder.cpp.
|
virtual |
Returns absolute positions without offsets for absolute encoders. Otherwise it returns getPos
Reimplemented in EncoderBissC, EncoderSSI, MtEncoderSPI, and TMC4671.
Definition at line 59 of file Encoder.cpp.
|
virtual |
Definition at line 48 of file Encoder.cpp.
|
virtual |
Change the position of the encoder Can be used to reset the center
Reimplemented in EncoderBissC, EncoderLocal, EncoderSSI, MtEncoderSPI, MotorSimplemotion, ODriveCAN, RmdMotorCAN, TMC4671, and VescCAN.
Definition at line 78 of file Encoder.cpp.
|
static |
|
static |