Comedi Relacs Plugins
0.9.8
|
#include <comedidigitalio.h>
Public Member Functions | |
ComediDigitalIO (void) | |
ComediDigitalIO (const string &device, const Options &opts) | |
virtual | ~ComediDigitalIO (void) |
virtual int | open (const string &device) override |
virtual bool | isOpen (void) const |
virtual void | close (void) |
virtual int | lines (void) const |
virtual int | configureLine (unsigned int line, bool output) |
virtual int | configureLines (unsigned int lines, unsigned int output) |
virtual int | write (unsigned int line, bool val) |
virtual int | read (unsigned int line, bool &val) |
virtual int | writeLines (unsigned int lines, unsigned int val) |
virtual int | readLines (unsigned int lines, unsigned int &val) |
int | comediSubdevice (void) const |
Public Member Functions inherited from DigitalIO | |
DigitalIO (const string &deviceclass) | |
virtual | ~DigitalIO (void) |
virtual int | open (Device &device) override |
virtual const Options & | settings (void) const |
int | allocateLines (unsigned int lines) |
int | allocateLine (unsigned int line) |
int | allocateLine (unsigned int line, int id) |
void | freeLines (int id) |
bool | allocatedLines (unsigned int lines, int id) |
bool | allocatedLines (unsigned int lines) |
bool | allocatedLine (unsigned int line, int id) |
bool | allocatedLine (unsigned int line) |
bool | lineConfiguration (unsigned int line) const |
virtual int | setSyncPulse (int modemask, int modebits, unsigned int line, double duration, int mode=0) |
virtual int | clearSyncPulse (int modemask, int modebits) |
Protected Member Functions | |
virtual void | initOptions () override |
Protected Member Functions inherited from DigitalIO | |
void | freeLines (void) |
void | setInfo (void) |
Additional Inherited Members | |
Static Protected Attributes inherited from DigitalIO | |
static const unsigned int | MaxDIOLines |
[DigitalIO] Interface for accessing digital I/O lines of a daq-board via comedi.
subdevice:
the subdevice id of the digital I/O (check with comedi_test -t info).startsubdevice:
start searching for a digital I/O subdevice at the subdevice with the specified id. ComediDigitalIO | ( | void | ) |
Create a new ComediDigitalIO without opening a device.
References ComediDigitalIO::initOptions().
ComediDigitalIO | ( | const string & | device, |
const Options & | opts | ||
) |
Open the digital I/O driver specified by its device file device.
References ComediDigitalIO::open().
|
virtual |
Close the daq driver.
References ComediDigitalIO::close().
|
overridevirtual |
Open a digital I/O device on the device device. The digital I/O subdevice can be specified by the "subdevice" option in opts. Alternatively, the first digital I/O subdevice is taken. The search for the digital I/O subdevice starts at the subdevice specified by the "startsubdevice" option in opts (defaults to "0"). Returns zero on success, or InvalidDevice (or any other negative number indicating the error).
Reimplemented from DigitalIO.
References ComediDigitalIO::isOpen(), and DigitalIO::setInfo().
Referenced by ComediDigitalIO::ComediDigitalIO().
|
virtual |
Returns true if the device is open.
Implements DigitalIO.
Referenced by ComediDigitalIO::close(), ComediDigitalIO::comediSubdevice(), ComediDigitalIO::lines(), and ComediDigitalIO::open().
|
virtual |
Close the device.
Implements DigitalIO.
References ComediDigitalIO::isOpen().
Referenced by ComediDigitalIO::~ComediDigitalIO().
|
virtual |
Implements DigitalIO.
References ComediDigitalIO::isOpen().
Referenced by ComediDigitalIO::readLines().
|
virtual |
Configure digital I/O line line for input (output = false
) or output (output = true
).
Reimplemented from DigitalIO.
|
virtual |
Configure digital I/O lines specified by lines for input (0) or output (1) according to output.
[in] | lines | a bit mask of the digital lines to be configured. |
[in] | output | a bitmask for tha digital I/O lines that should be configured for output. |
Reimplemented from DigitalIO.
|
virtual |
|
virtual |
Read from digital I/O line line and return value in val.
[in] | line | the digital line (not its bitmask!) |
[out] | val | the value that was read from to the digital input line (true: high, false: low). |
Implements DigitalIO.
|
virtual |
Write val to the digital I/O lines defined in lines.
[in] | lines | a bit mask selecting the digital lines to be written. |
[in] | val | a bit mask indicating what should be written to the digital output lines (1 : high, 0 : low). |
Implements DigitalIO.
|
virtual |
Read digital I/O lines and return them in val.
[in] | lines | a bit mask selecting the digital lines from which to read. |
[out] | val | a bit field returning the values read from to the digital input lines (1 : high, 0 : low). |
Implements DigitalIO.
References ComediDigitalIO::lines().
int comediSubdevice | ( | void | ) | const |
Comedi internal index of analog input subdevice.
References ComediDigitalIO::isOpen().
|
overrideprotectedvirtual |
Referenced by ComediDigitalIO::ComediDigitalIO().