#include <Counter.hpp>
Public Member Functions | |
int | getDeviceIndex () const |
Counter & | setMode (int mode) |
Counter & | setCount (unsigned short count) |
Counter & | setModeAndCount (int mode, unsigned short count) |
unsigned short | readCount () |
UShortArray | readCountAndStatus () |
unsigned short | readCountAndSetModeAndCount (int mode, unsigned short count) |
Static Public Attributes | |
static const int | MODE_TERMINAL_COUNT = 0 |
static const int | MODE_ONE_SHOT = 1 |
static const int | MODE_RATE_GENERATOR = 2 |
static const int | MODE_SQUARE_WAVE = 3 |
static const int | MODE_SW_TRIGGERED = 4 |
static const int | MODE_HW_TRIGGERED = 5 |
Protected Member Functions | |
Counter (CounterSubsystem *parent, int counterIndex) | |
Protected Attributes | |
CounterSubsystem * | parent |
int | counterIndex |
Friends | |
class | CounterSubsystem |
AIOUSB::Counter::Counter | ( | CounterSubsystem * | parent, | |
int | counterIndex | |||
) | [protected] |
int AIOUSB::Counter::getDeviceIndex | ( | ) | const |
Gets the index of the parent device on the USB bus. Used internally in calls to the underlying API.
unsigned short AIOUSB::Counter::readCount | ( | ) |
Reads a counter's current count value.
OperationFailedException |
unsigned short AIOUSB::Counter::readCountAndSetModeAndCount | ( | int | mode, | |
unsigned short | count | |||
) |
Reads a counter's current count value, then sets a new mode and loads a new count value into the counter.
mode | the counter mode (see setMode( int mode )). | |
count | the count value (0-65,535) to load into the counter. |
IllegalArgumentException | ||
OperationFailedException |
UShortArray AIOUSB::Counter::readCountAndStatus | ( | ) |
Reads a counter's current count value and status.
OperationFailedException |
Counter & AIOUSB::Counter::setCount | ( | unsigned short | count | ) |
Loads a count value into the counter.
count | the count value (0-65,535) to load into the counter. |
OperationFailedException |
Counter & AIOUSB::Counter::setMode | ( | int | mode | ) |
Sets the counter's mode.
mode | the counter mode. May be one of: Counter::MODE_TERMINAL_COUNT Counter::MODE_ONE_SHOT Counter::MODE_RATE_GENERATOR Counter::MODE_SQUARE_WAVE Counter::MODE_SW_TRIGGERED Counter::MODE_HW_TRIGGERED |
IllegalArgumentException | ||
OperationFailedException |
Counter & AIOUSB::Counter::setModeAndCount | ( | int | mode, | |
unsigned short | count | |||
) |
Sets a counter mode and loads a count value into the counter.
mode | the counter mode (see setMode( int mode )). | |
count | the count value (0-65,535) to load into the counter. |
IllegalArgumentException | ||
OperationFailedException |
friend class CounterSubsystem [friend] |
int AIOUSB::Counter::counterIndex [protected] |
const int AIOUSB::Counter::MODE_HW_TRIGGERED = 5 [static] |
Mode 5: hardware triggered strobe (retriggerable) (see setMode( int mode )).
const int AIOUSB::Counter::MODE_ONE_SHOT = 1 [static] |
Mode 1: hardware retriggerable one-shot (see setMode( int mode )).
const int AIOUSB::Counter::MODE_RATE_GENERATOR = 2 [static] |
Mode 2: rate generator (see setMode( int mode )).
const int AIOUSB::Counter::MODE_SQUARE_WAVE = 3 [static] |
Mode 3: square wave mode (see setMode( int mode )).
const int AIOUSB::Counter::MODE_SW_TRIGGERED = 4 [static] |
Mode 4: software triggered mode (see setMode( int mode )).
const int AIOUSB::Counter::MODE_TERMINAL_COUNT = 0 [static] |
Mode 0: interrupt on terminal count (see setMode( int mode )).
CounterSubsystem* AIOUSB::Counter::parent [protected] |