ClearCore Library
|
ClearCore Position Sensor Decoder.
Provides position and velocity information from external quadrature and index signals. Use the Encoder Input Adapter Board (PN: CL-ENCDR-DFIN) to wire an external encoder to ClearCore.
ClearCore Position Sensor Decoder. More...
#include <EncoderInput.h>
Public Member Functions | |
int32_t | Position () |
Read the current position of the encoder. | |
int32_t | Position (int32_t newPosn) |
Set the current position of the encoder. | |
void | AddToPosition (int32_t posnAdjust) |
Adjust the current position of the encoder. | |
int32_t | IndexPosition () |
Read the last index position of the encoder. | |
void | Enable (bool isEnabled) |
Set whether the encoder input should be active or not. | |
void | SwapDirection (bool isSwapped) |
Swap the sense of positive and negative encoder directions. | |
volatile const int32_t & | Velocity () |
Read the velocity of the encoder input (counts per second) | |
volatile const bool & | IndexDetected () |
Check if there was an index pulse in the last sample time. | |
void | IndexInverted (bool invert) |
Invert the edge that the index detection triggers on. | |
bool | QuadratureError () |
Query for a quadrature error. | |
void | ClearQuadratureError () |
Clear a quadrature error. | |
volatile const int16_t & | StepsLastSample () |
Get the number of encoder steps received in the last sample time. | |
void ClearCore::EncoderInput::AddToPosition | ( | int32_t | posnAdjust | ) |
Adjust the current position of the encoder.
void ClearCore::EncoderInput::ClearQuadratureError | ( | ) |
Clear a quadrature error.
void ClearCore::EncoderInput::Enable | ( | bool | isEnabled | ) |
Set whether the encoder input should be active or not.
|
inline |
Check if there was an index pulse in the last sample time.
void ClearCore::EncoderInput::IndexInverted | ( | bool | invert | ) |
Invert the edge that the index detection triggers on.
The index nominally triggers when the digital input value rises. This setting allows the index to trigger on the falling edge.
int32_t ClearCore::EncoderInput::IndexPosition | ( | ) |
Read the last index position of the encoder.
int32_t ClearCore::EncoderInput::Position | ( | ) |
Read the current position of the encoder.
int32_t ClearCore::EncoderInput::Position | ( | int32_t | newPosn | ) |
bool ClearCore::EncoderInput::QuadratureError | ( | ) |
Query for a quadrature error.
|
inline |
Get the number of encoder steps received in the last sample time.
void ClearCore::EncoderInput::SwapDirection | ( | bool | isSwapped | ) |
Swap the sense of positive and negative encoder directions.
|
inline |
Read the velocity of the encoder input (counts per second)