#include <encoders.h>
|
| Encoders (int32_t serial_number, int hub_port, bool is_hub_port_device, std::function< void(int, int, double, int)> position_change_handler) |
|
uint32_t | getDataInterval (int index) const |
|
bool | getEnabled (int index) const |
| Checks if an encoder is powered on and receiving events. More...
|
|
uint32_t | getEncoderCount () const |
| Gets the number of encoder input channels supported by this board. More...
|
|
int64_t | getIndexPosition (int index) const |
| Gets the position of an encoder the last time an index pulse occured. An index pulse in this context refers to an input from the encoder the pulses high once every revolution. More...
|
|
Phidget_EncoderIOMode | getIOMode (int index) const |
|
int64_t | getPosition (int index) const |
| Reads the current position of an encoder. More...
|
|
void | setDataInterval (int index, uint32_t data_interval_ms) const |
|
void | setEnabled (int index, bool enabled) const |
| Set the powered state of an encoder. If an encoder is not enabled, it will not be given power, and events and changes in position will not be captured. More...
|
|
void | setIOMode (int index, Phidget_EncoderIOMode io_mode) const |
|
void | setPosition (int index, int64_t position) const |
| Sets the offset of an encoder such that current position is the specified value. More...
|
|
| ~Encoders () |
|
Definition at line 42 of file encoders.h.
◆ Encoders()
phidgets::Encoders::Encoders |
( |
int32_t |
serial_number, |
|
|
int |
hub_port, |
|
|
bool |
is_hub_port_device, |
|
|
std::function< void(int, int, double, int)> |
position_change_handler |
|
) |
| |
|
explicit |
◆ ~Encoders()
phidgets::Encoders::~Encoders |
( |
| ) |
|
◆ getDataInterval()
uint32_t phidgets::Encoders::getDataInterval |
( |
int |
index | ) |
const |
◆ getEnabled()
bool phidgets::Encoders::getEnabled |
( |
int |
index | ) |
const |
Checks if an encoder is powered on and receiving events.
- Parameters
-
index | The index of the encoder to check |
Definition at line 105 of file encoders.cpp.
◆ getEncoderCount()
uint32_t phidgets::Encoders::getEncoderCount |
( |
| ) |
const |
Gets the number of encoder input channels supported by this board.
Definition at line 85 of file encoders.cpp.
◆ getIndexPosition()
int64_t phidgets::Encoders::getIndexPosition |
( |
int |
index | ) |
const |
Gets the position of an encoder the last time an index pulse occured. An index pulse in this context refers to an input from the encoder the pulses high once every revolution.
- Parameters
-
index | The index of the encoder to read |
Definition at line 100 of file encoders.cpp.
◆ getIOMode()
Phidget_EncoderIOMode phidgets::Encoders::getIOMode |
( |
int |
index | ) |
const |
◆ getPosition()
int64_t phidgets::Encoders::getPosition |
( |
int |
index | ) |
const |
Reads the current position of an encoder.
- Parameters
-
index | The index of the encoder to read |
Definition at line 90 of file encoders.cpp.
◆ setDataInterval()
void phidgets::Encoders::setDataInterval |
( |
int |
index, |
|
|
uint32_t |
data_interval_ms |
|
) |
| const |
◆ setEnabled()
void phidgets::Encoders::setEnabled |
( |
int |
index, |
|
|
bool |
enabled |
|
) |
| const |
Set the powered state of an encoder. If an encoder is not enabled, it will not be given power, and events and changes in position will not be captured.
- Parameters
-
index | The index of the encoder to change |
enabled | The new powered state of the encoder |
Definition at line 110 of file encoders.cpp.
◆ setIOMode()
void phidgets::Encoders::setIOMode |
( |
int |
index, |
|
|
Phidget_EncoderIOMode |
io_mode |
|
) |
| const |
◆ setPosition()
void phidgets::Encoders::setPosition |
( |
int |
index, |
|
|
int64_t |
position |
|
) |
| const |
Sets the offset of an encoder such that current position is the specified value.
- Parameters
-
index | The index of the encoder to set |
position | The new value that should be returned by 'getPosition(index)' at the current position of the encoder |
Definition at line 95 of file encoders.cpp.
◆ encoder_count_
uint32_t phidgets::Encoders::encoder_count_ |
|
private |
◆ encs_
std::vector<std::unique_ptr<Encoder> > phidgets::Encoders::encs_ |
|
private |
The documentation for this class was generated from the following files: