This logical device represents one 'Digital Input' subdevice of a Comedi device. More...
#include <ComediSubDeviceDIn.hpp>
Public Member Functions | |
ComediSubDeviceDIn (ComediDevice *cd, const std::string &name, unsigned int subdevice, bool configure_all_bits=true) | |
Create a new ComediSubDeviceDIn with a given ComediDevice, subdevice number and a name for this sub device. | |
ComediSubDeviceDIn (ComediDevice *cd, unsigned int subdevice, bool configure_all_bits=true) | |
bool | useBit (unsigned int bit) |
If configure_all_bits was false, use this method (for each bit) to specify which bits must be configured as input. | |
virtual bool | isOn (unsigned int bit=0) const |
virtual bool | isOff (unsigned int bit=0) const |
virtual bool | readBit (unsigned int bit=0) const |
virtual unsigned int | nbOfInputs () const |
virtual unsigned int | readSequence (unsigned int start_bit, unsigned int stop_bit) const |
Protected Member Functions | |
void | init (bool all_bits) |
Protected Attributes | |
ComediDevice * | myCard |
The output device to write to. | |
unsigned int | _subDevice |
The subdevice number of this instance in myCard. | |
bool | error |
This logical device represents one 'Digital Input' subdevice of a Comedi device.
The standard constructors assumes the whole subdevice is already configured for input. For DIO (reconfigurable IO devices) use the extra constructor argument to specify that this should not be assumed and use the useBit() method to indicate which bits should be used as input bits.
Definition at line 46 of file ComediSubDeviceDIn.hpp.
ComediSubDeviceDIn | ( | ComediDevice * | cd, | |
const std::string & | name, | |||
unsigned int | subdevice, | |||
bool | configure_all_bits = true | |||
) |
Create a new ComediSubDeviceDIn with a given ComediDevice, subdevice number and a name for this sub device.
cd | The ComediDevice to use for output | |
subdevice | The subdevice number for this comedi device | |
name | The name of this instance | |
configure_all_bits | Set to false to not configure all bits of this subdevice as inputs. |
Definition at line 36 of file ComediSubDeviceDIn.cpp.