#include <AnalogInputSubsystem.hpp>
Public Types | |
enum | { MAX_COUNTS = 65535 } |
Public Member Functions | |
AnalogInputSubsystem (USBDevice &parent) | |
virtual | ~AnalogInputSubsystem () |
virtual std::ostream & | print (std::ostream &out) |
int | getNumChannels () const |
int | getNumMUXChannels () const |
bool | isAutoCalPresent (bool force) |
bool | isDiscardFirstSample () const |
AnalogInputSubsystem & | setDiscardFirstSample (bool discard) |
int | getCalMode () const |
AnalogInputSubsystem & | setCalMode (int mode) |
int | getTriggerMode () const |
AnalogInputSubsystem & | setTriggerMode (int mode) |
int | getGainCode (int channel) const |
IntArray | getGainCode (int startChannel, int numChannels) const |
AnalogInputSubsystem & | setGainCode (int channel, int gainCode) |
AnalogInputSubsystem & | setGainCode (int startChannel, const IntArray &gainCode) |
bool | isDifferentialMode (int channel) const |
BoolArray | isDifferentialMode (int startChannel, int numChannels) const |
AnalogInputSubsystem & | setDifferentialMode (int channel, bool differentialMode) |
AnalogInputSubsystem & | setDifferentialMode (int startChannel, const BoolArray &differentialMode) |
AnalogInputSubsystem & | setGainCodeAndDiffMode (int channel, int gainCode, bool differentialMode) |
AnalogInputSubsystem & | setGainCodeAndDiffMode (int startChannel, const IntArray &gainCode, const BoolArray &differentialMode) |
AnalogInputSubsystem & | setGainCodeAndDiffMode (int gainCode, bool differentialMode) |
int | getOversample () const |
AnalogInputSubsystem & | setOversample (int oversample) |
AnalogInputSubsystem & | setCalibrationTable (const std::string &fileName) |
AnalogInputSubsystem & | setCalibrationTable (const UShortArray &calTable) |
AnalogInputSubsystem & | setStreamingBlockSize (int blockSize) |
AnalogInputSubsystem & | setClock (double clockHz) |
UShortArray | calibrate (bool autoCal, bool returnCalTable, const std::string &saveFileName) |
UShortArray | calibrate (const DoubleArray &points, bool returnCalTable, const std::string &saveFileName) |
unsigned short | read (int channel) |
UShortArray | read (int startChannel, int numChannels) |
double | readVolts (int channel) |
DoubleArray | readVolts (int startChannel, int numChannels) |
AnalogInputSubsystem & | readBulkStart (int startChannel, int numChannels, int numSamples) |
int | readBulkSamplesAvailable () |
UShortArray | readBulkNext (int numSamples) |
AnalogInputSubsystem & | clearFIFO (int method) |
double | countsToVolts (int channel, unsigned short counts) const |
DoubleArray | countsToVolts (int startChannel, const UShortArray &counts) const |
unsigned short | voltsToCounts (int channel, double volts) const |
UShortArray | voltsToCounts (int startChannel, const DoubleArray &volts) const |
Protected Types | |
enum | { NUM_CONFIG_REGISTERS = 20, NUM_MUX_CONFIG_REGISTERS = 21, GAIN_CODE_VALID_MASK = 7, MAX_OVERSAMPLE = 0xff, AUTO_CAL_UNKNOWN = 0, AUTO_CAL_NOT_PRESENT = 1, AUTO_CAL_PRESENT = 2 } |
Protected Member Functions | |
void | validateConfigBlock () const |
AnalogInputSubsystem & | writeConfig (bool force) |
int | getStartChannel () const |
int | getEndChannel () const |
AnalogInputSubsystem & | setScanRange (int startChannel, int numChannels) |
Protected Attributes | |
int | numChannels |
int | numMUXChannels |
int | autoCalFeature |
UCharArray | configBlock |
UCharArray | prevConfigBlock |
unsigned short * | readBulkBuffer |
int | readBulkSamplesRequested |
int | readBulkSamplesRetrieved |
anonymous enum [protected] |
AIOUSB::AnalogInputSubsystem::AnalogInputSubsystem | ( | USBDevice & | parent | ) |
AIOUSB::AnalogInputSubsystem::~AnalogInputSubsystem | ( | ) | [virtual] |
void AIOUSB::AnalogInputSubsystem::validateConfigBlock | ( | ) | const [protected] |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::writeConfig | ( | bool | force | ) | [protected] |
int AIOUSB::AnalogInputSubsystem::getStartChannel | ( | ) | const [protected] |
int AIOUSB::AnalogInputSubsystem::getEndChannel | ( | ) | const [protected] |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setScanRange | ( | int | startChannel, | |
int | numChannels | |||
) | [protected] |
virtual std::ostream& AIOUSB::AnalogInputSubsystem::print | ( | std::ostream & | out | ) | [virtual] |
Implements AIOUSB::DeviceSubsystem.
int AIOUSB::AnalogInputSubsystem::getNumChannels | ( | ) | const [inline] |
int AIOUSB::AnalogInputSubsystem::getNumMUXChannels | ( | ) | const [inline] |
bool AIOUSB::AnalogInputSubsystem::isAutoCalPresent | ( | bool | force | ) |
bool AIOUSB::AnalogInputSubsystem::isDiscardFirstSample | ( | ) | const |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setDiscardFirstSample | ( | bool | discard | ) |
int AIOUSB::AnalogInputSubsystem::getCalMode | ( | ) | const |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setCalMode | ( | int | mode | ) |
int AIOUSB::AnalogInputSubsystem::getTriggerMode | ( | ) | const |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setTriggerMode | ( | int | mode | ) |
int AIOUSB::AnalogInputSubsystem::getGainCode | ( | int | channel | ) | const |
IntArray AIOUSB::AnalogInputSubsystem::getGainCode | ( | int | startChannel, | |
int | numChannels | |||
) | const |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setGainCode | ( | int | channel, | |
int | gainCode | |||
) |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setGainCode | ( | int | startChannel, | |
const IntArray & | gainCode | |||
) |
bool AIOUSB::AnalogInputSubsystem::isDifferentialMode | ( | int | channel | ) | const |
BoolArray AIOUSB::AnalogInputSubsystem::isDifferentialMode | ( | int | startChannel, | |
int | numChannels | |||
) | const |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setDifferentialMode | ( | int | channel, | |
bool | differentialMode | |||
) |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setDifferentialMode | ( | int | startChannel, | |
const BoolArray & | differentialMode | |||
) |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setGainCodeAndDiffMode | ( | int | channel, | |
int | gainCode, | |||
bool | differentialMode | |||
) |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setGainCodeAndDiffMode | ( | int | startChannel, | |
const IntArray & | gainCode, | |||
const BoolArray & | differentialMode | |||
) |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setGainCodeAndDiffMode | ( | int | gainCode, | |
bool | differentialMode | |||
) |
int AIOUSB::AnalogInputSubsystem::getOversample | ( | ) | const |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setOversample | ( | int | oversample | ) |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setCalibrationTable | ( | const std::string & | fileName | ) |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setCalibrationTable | ( | const UShortArray & | calTable | ) |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setStreamingBlockSize | ( | int | blockSize | ) |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::setClock | ( | double | clockHz | ) |
UShortArray AIOUSB::AnalogInputSubsystem::calibrate | ( | bool | autoCal, | |
bool | returnCalTable, | |||
const std::string & | saveFileName | |||
) |
UShortArray AIOUSB::AnalogInputSubsystem::calibrate | ( | const DoubleArray & | points, | |
bool | returnCalTable, | |||
const std::string & | saveFileName | |||
) |
unsigned short AIOUSB::AnalogInputSubsystem::read | ( | int | channel | ) |
UShortArray AIOUSB::AnalogInputSubsystem::read | ( | int | startChannel, | |
int | numChannels | |||
) |
double AIOUSB::AnalogInputSubsystem::readVolts | ( | int | channel | ) |
DoubleArray AIOUSB::AnalogInputSubsystem::readVolts | ( | int | startChannel, | |
int | numChannels | |||
) |
AnalogInputSubsystem & AIOUSB::AnalogInputSubsystem::readBulkStart | ( | int | startChannel, | |
int | numChannels, | |||
int | numSamples | |||
) |
int AIOUSB::AnalogInputSubsystem::readBulkSamplesAvailable | ( | ) |
UShortArray AIOUSB::AnalogInputSubsystem::readBulkNext | ( | int | numSamples | ) |
AnalogInputSubsystem& AIOUSB::AnalogInputSubsystem::clearFIFO | ( | int | method | ) | [inline] |
double AIOUSB::AnalogInputSubsystem::countsToVolts | ( | int | channel, | |
unsigned short | counts | |||
) | const |
DoubleArray AIOUSB::AnalogInputSubsystem::countsToVolts | ( | int | startChannel, | |
const UShortArray & | counts | |||
) | const |
unsigned short AIOUSB::AnalogInputSubsystem::voltsToCounts | ( | int | channel, | |
double | volts | |||
) | const |
UShortArray AIOUSB::AnalogInputSubsystem::voltsToCounts | ( | int | startChannel, | |
const DoubleArray & | volts | |||
) | const |
int AIOUSB::AnalogInputSubsystem::numChannels [protected] |
int AIOUSB::AnalogInputSubsystem::numMUXChannels [protected] |
int AIOUSB::AnalogInputSubsystem::autoCalFeature [protected] |
UCharArray AIOUSB::AnalogInputSubsystem::configBlock [protected] |
unsigned short* AIOUSB::AnalogInputSubsystem::readBulkBuffer [protected] |
int AIOUSB::AnalogInputSubsystem::readBulkSamplesRequested [protected] |
int AIOUSB::AnalogInputSubsystem::readBulkSamplesRetrieved [protected] |