|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.acces.aiousb.DigitalIOSubsystem
public class DigitalIOSubsystem
Class DigitalIOSubsystem represents the digital I/O subsystem of a device. One accesses
this analog output subsystem through its parent object, typically through a method such as
dio() (see USB_AI16_Family.dio()
).
Field Summary | |
---|---|
static int |
BITS_PER_BYTE
Number of bits in one byte. |
Method Summary | |
---|---|
DigitalIOSubsystem |
configure(boolean[] tristates,
boolean[] outputs,
boolean[] values)
Configures the digital I/O ports. |
DigitalIOSubsystem |
configure(boolean tristate,
boolean[] outputs,
boolean[] values)
Configures the digital I/O ports. |
DigitalIOSubsystem |
getConfiguration(boolean[] tristates,
boolean[] outputs)
Gets the current configuration of the digital I/O ports. |
int |
getNumChannels()
Gets the number of digital I/O channels (bits). |
int |
getNumPorts()
Gets the number of digital I/O ports (bytes). |
int |
getNumTristateChannels()
Gets the number of tristate channels (bits). |
int |
getNumTristateGroups()
Gets the number of tristate groups (bytes). |
USBDevice |
getParent()
Gets the parent device that this subsystem is part of. |
java.io.PrintStream |
print(java.io.PrintStream stream)
Prints the properties of this subsystem. |
boolean |
read(int channel)
Reads a single digital input channel. |
boolean[] |
read(int startChannel,
int numChannels)
Reads multiple digital input channels. |
DigitalIOSubsystem |
write(int channel,
boolean value)
Writes a single digital output channel. |
DigitalIOSubsystem |
write(int startChannel,
boolean[] values)
Writes multiple digital output channels. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BITS_PER_BYTE
Method Detail |
---|
public java.io.PrintStream print(java.io.PrintStream stream)
stream
- the print stream where properties will be printed.
public int getNumPorts()
public int getNumChannels()
public int getNumTristateGroups()
public int getNumTristateChannels()
public DigitalIOSubsystem configure(boolean tristate, boolean[] outputs, boolean[] values)
tristate
- true causes all bits on the device to enter tristate (high-impedance) mode;
false removes tristate mode. All devices with this feature power up in tristate mode, and tristate
mode is changed after the remainder of the configuration has occurred.outputs
- an array of boolean values, one per digital I/O port. Each true value in the array
configures the entire corresponding I/O port as an output port; each false value configures the entire
corresponding I/O port as an input port.values
- an array of boolean values, one per digital I/O bit, starting with bit 0 of the device (that is,
the least significant bit on the lowest numbered port). Each true value in the array sets the corresponding
output bit to a "1"; each false value sets the corresponding output bit to a "0." The values are written to
the digital output ports before the ports are taken out of tristate mode.
java.lang.IllegalArgumentException
OperationFailedException
public DigitalIOSubsystem configure(boolean[] tristates, boolean[] outputs, boolean[] values)
configure( boolean tristate, ...)
should be used instead, otherwise an exception will be thrown.
tristates
- an array of boolean values, one per tristate group. Each true value in the array
puts the entire corresponding I/O port into tristate (high-impedance) mode; each false value takes
the entire corresponding I/O port out of tristate mode. All devices with this feature power up in tristate
mode, and tristate mode is changed after the remainder of the configuration has occurred.outputs
- an array of boolean values, one per digital I/O port. Each true value in the array
configures the entire corresponding I/O port as an output port; each false value configures the entire
corresponding I/O port as an input port.values
- an array of boolean values, one per digital I/O bit, starting with bit 0 of the device (that is,
the least significant bit on the lowest numbered port). Each true value in the array sets the corresponding
output bit to a "1"; each false value sets the corresponding output bit to a "0." The values are written to
the digital output ports before the ports are taken out of tristate mode.
java.lang.IllegalArgumentException
OperationFailedException
public DigitalIOSubsystem getConfiguration(boolean[] tristates, boolean[] outputs)
tristates
- an array of boolean values, one per tristate group, which will receive the current tristate
mode of each tristate group. Each true value returned in the array indicates that the entire corresponding
I/O port is in tristate (high-impedance) mode; each false value indicates that the entire corresponding I/O
port is not in tristate mode. If this parameter is null, then the tristate configuration is not returned.outputs
- an array of boolean values, one per digital I/O port, which will receive the current output
mode of each I/O port. Each true value returned in the array indicates that the entire corresponding I/O
port is configured as an output port; each false value indicates that the entire corresponding I/O port is
configured as an input port. If this parameter is null, then the output configuration is not returned.
java.lang.IllegalArgumentException
OperationFailedException
public boolean read(int channel)
channel
- the channel to read.
java.lang.IllegalArgumentException
OperationFailedException
public boolean[] read(int startChannel, int numChannels)
startChannel
- the first channel to read.numChannels
- the number of channels to read.
java.lang.IllegalArgumentException
OperationFailedException
public DigitalIOSubsystem write(int channel, boolean value)
channel
- the channel to write.value
- the value to write to the specified channel. True sets the output bit to a "1" and
false clears the output bit to a "0".
public DigitalIOSubsystem write(int startChannel, boolean[] values)
startChannel
- the first channel to write.values
- an array containing the values to write to the specified channels. For each channel,
true sets the output bit to a "1" and false clears the output bit to a "0".
java.lang.IllegalArgumentException
OperationFailedException
public USBDevice getParent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |