A class for reading an encoder using the comedi hardware abstraction layer. More...
#include <ComediEncoder.hpp>
Public Member Functions | |
ComediEncoder (ComediDevice *cd, unsigned int subd, const std::string &name) | |
Create a nameserved encoder. | |
ComediEncoder (ComediDevice *cd, unsigned int subd) | |
Create an encoder. | |
virtual int | positionGet () const |
virtual int | turnGet () const |
virtual void | positionSet (int p) |
virtual void | turnSet (int t) |
virtual int | resolution () const |
virtual bool | upcounting () const |
Protected Member Functions | |
void | init () |
Protected Attributes | |
ComediDevice * | _myCard |
unsigned int | _subDevice |
int | _turn |
int | _resolution |
bool | _upcounting |
A class for reading an encoder using the comedi hardware abstraction layer.
Tested with the NI660X card.
Currently this wrapper does not support all functionality. It always uses X4 encoding (maximum resolution), you cannot choose when to take into account the indexpulse or reset the counter when the index pulse arrives. Also see the Comedi gpct_encoder.c demo program
subdevice locking
Definition at line 44 of file ComediEncoder.hpp.
ComediEncoder | ( | ComediDevice * | cd, | |
unsigned int | subd, | |||
const std::string & | name | |||
) |
Create a nameserved encoder.
cd | The comedi device your are using | |
subd | The comedi subdevice where the COUNTER is situated. |
Definition at line 23 of file ComediEncoder.cpp.
ComediEncoder | ( | ComediDevice * | cd, | |
unsigned int | subd | |||
) |
Create an encoder.
cd | The comedi device your are using | |
subd | The comedi subdevice where the COUNTER is situated. |
Definition at line 31 of file ComediEncoder.cpp.