|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.acces.aiousb.Counter
public class Counter
Class Counter represents a single counter/timer. One accesses a counter through its
CounterSubsystem
parent object (see getCounter()
).
Field Summary | |
---|---|
static int |
MODE_HW_TRIGGERED
Mode 5: hardware triggered strobe (retriggerable). |
static int |
MODE_ONE_SHOT
Mode 1: hardware retriggerable one-shot. |
static int |
MODE_RATE_GENERATOR
Mode 2: rate generator. |
static int |
MODE_SQUARE_WAVE
Mode 3: square wave mode. |
static int |
MODE_SW_TRIGGERED
Mode 4: software triggered mode. |
static int |
MODE_TERMINAL_COUNT
Mode 0: interrupt on terminal count. |
Constructor Summary | |
---|---|
Counter(CounterSubsystem parent,
int counterIndex)
Constructor for counter/timer. |
Method Summary | |
---|---|
int |
getDeviceIndex()
Gets the index of the parent device on the USB bus. |
char |
readCount()
Reads a counter's current count value. |
char |
readCountAndSetModeAndCount(int mode,
char count)
Reads a counter's current count value, then sets a new mode and loads a new count value into the counter. |
char[] |
readCountAndStatus()
Reads a counter's current count value and status. |
Counter |
setCount(char count)
Loads a count value into the counter. |
Counter |
setMode(int mode)
Sets the counter's mode. |
Counter |
setModeAndCount(int mode,
char count)
Sets a counter mode and loads a count value into the counter. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MODE_TERMINAL_COUNT
public static final int MODE_ONE_SHOT
public static final int MODE_RATE_GENERATOR
public static final int MODE_SQUARE_WAVE
public static final int MODE_SW_TRIGGERED
public static final int MODE_HW_TRIGGERED
Constructor Detail |
---|
public Counter(CounterSubsystem parent, int counterIndex)
parent
- the parent counter/timer subsystem object that this counter is a part of.counterIndex
- the counter index (using 0-based counter addressing)Method Detail |
---|
public int getDeviceIndex()
public Counter setMode(int mode)
mode
- the counter mode. May be one of:MODE_TERMINAL_COUNT
MODE_ONE_SHOT
MODE_RATE_GENERATOR
MODE_SQUARE_WAVE
MODE_SW_TRIGGERED
MODE_HW_TRIGGERED
java.lang.IllegalArgumentException
OperationFailedException
public Counter setCount(char count)
count
- the count value (0-65,535) to load into the counter.
OperationFailedException
public Counter setModeAndCount(int mode, char count)
mode
- the counter mode (see setMode()
).count
- the count value (0-65,535) to load into the counter.
java.lang.IllegalArgumentException
OperationFailedException
public char readCount()
OperationFailedException
public char[] readCountAndStatus()
OperationFailedException
public char readCountAndSetModeAndCount(int mode, char count)
mode
- the counter mode (see setMode()
).count
- the count value (0-65,535) to load into the counter.
java.lang.IllegalArgumentException
OperationFailedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |