A ThreadScope implementatation for Comedi Digital Outputs. More...
#include <ComediThreadScope.hpp>
Public Types | |
typedef unsigned int | Data |
Public Member Functions | |
ComediThreadScope (const std::string &name) | |
Data | getMaxData (unsigned int subd) |
Returns the maximum valid data value for channel chan of subdevice subdevice belonging to this device. | |
int | read (unsigned int subd, unsigned int chanNr, unsigned int range, unsigned int aref, Data &value) |
Read a single sample on the channel specified by the subdevice subdevice, and the channel channel. | |
int | write (unsigned int subd, unsigned int chanNr, unsigned int range, unsigned int aref, const ComediDevice::Data &value) |
int | getSubDeviceType (unsigned int subd) |
Returns an integer describing the type of subdevice that belongs to this comedi device and has the index subdevice. | |
DeviceInfo * | getDevice () |
Return a pointer to a comedi device info. | |
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 void | switchOn (unsigned int bit) |
virtual void | switchOff (unsigned int bit) |
virtual void | setBit (unsigned int bit, bool value) |
virtual void | setSequence (unsigned int start_bit, unsigned int stop_bit, unsigned int value) |
virtual bool | checkBit (unsigned int bit) const |
virtual unsigned int | checkSequence (unsigned int start_bit, unsigned int stop_bit) const |
virtual unsigned int | nbOfOutputs () const |
Protected Member Functions | |
void | init (bool all_bits) |
Protected Attributes | |
boost::shared_ptr< DeviceInfo > | d |
ComediDevice * | myCard |
The output device to write to. | |
unsigned int | subDevice |
The subdevice number of this instance in myCard. | |
unsigned int | channels |
A ThreadScope implementatation for Comedi Digital Outputs.
Enable the Comedi Thread Scope in the configtool to use a comedi device as a thread monitoring scope.
Definition at line 44 of file ComediThreadScope.hpp.
ComediDevice::DeviceInfo * getDevice | ( | ) | [inherited] |
Return a pointer to a comedi device info.
This may be null if the device could not be found.
Definition at line 95 of file ComediDevice.cpp.
Referenced by ComediSubDeviceAIn::ComediSubDeviceAIn(), ComediSubDeviceAOut::ComediSubDeviceAOut(), and ComediSubDeviceDOut::ComediSubDeviceDOut().
Data getMaxData | ( | unsigned int | subd | ) | [inherited] |
Returns the maximum valid data value for channel chan of subdevice subdevice belonging to this device.
This function returns 0 on error.
subdevice | : the number of the subdevice to interrogate |
Definition at line 52 of file ComediDevice.cpp.
Referenced by ComediSubDeviceAIn::ComediSubDeviceAIn(), and ComediSubDeviceAOut::ComediSubDeviceAOut().
int getSubDeviceType | ( | unsigned int | subd | ) | [inherited] |
Returns an integer describing the type of subdevice that belongs to this comedi device and has the index subdevice.
subd | : the number of the subdevice of which the type has to be retrieved |
Definition at line 60 of file ComediDevice.cpp.
Referenced by ComediSubDeviceAIn::ComediSubDeviceAIn(), ComediSubDeviceAOut::ComediSubDeviceAOut(), and ComediSubDeviceDOut::ComediSubDeviceDOut().
int read | ( | unsigned int | subd, | |
unsigned int | chanNr, | |||
unsigned int | range, | |||
unsigned int | aref, | |||
ComediDevice::Data & | value | |||
) | [inherited] |
Read a single sample on the channel specified by the subdevice subdevice, and the channel channel.
For the A/D conversion (if appropriate), the device is configured to use range specification range and (if appropriate) analog reference type aref. Analog reference types that are not supported by the device are silently ignored. The function reads one data value from the specified channel and places the data value in the location pointed to by data.
Data values returned by this function are unsigned integers less than or equal to the maximum sample value of the channel, which can be determined using the function getMaxData().
subd | : the number of the subdevice to read on | |
chanNr | : the number of the channel of subdevice subdevice to read on | |
value | : the data | |
range | : number between 0 and get_num_ranges(), |
aref | : possible options (see comedi doc) AREF_GROUND, AREF_COMMON, AREF_DIFF, AREF_OTHER |
Definition at line 67 of file ComediDevice.cpp.
Referenced by ComediSubDeviceAIn::ComediSubDeviceAIn(), and ComediSubDeviceAOut::ComediSubDeviceAOut().