|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.unizh.ini.caviar.usbaemonitor.USBAEMonitor
public class USBAEMonitor
Acquires data from Anton Civit's Group's simple USB AER board that uses Silicon Labs (http://www.silabs.com) C8051F320 controller and SiLabs USBXPress device and host driver firmware and software.
The DLL's USBAEMonitor.dll and SiUSBXp.dll must be accessible for windows programs. Generally, this means they must be
somewhere on the PATH, for example, in WINNT\system32
, or they can be in the directory the program is started.
It is generally simplest to just put the folders on the PATH variable.
Events are captured as 16 bit addresses and 32 bit timestamps with 1us tick. To use this class, construct an instance of USBAEMonitor
,
then open()
it. Each time you want to capture available events, call acquireAvailableEventsFromDriver()
, which returns the number of
events grabbed. Access these events with getAddresses()
and getTimestamps()
, which each create new java arrays of the captured
data. overrunOccured()
can be used to see if there was a driver overrun.
See the main() method for an example of use.
Constructor Summary | |
---|---|
USBAEMonitor()
Creates a new instance of USBAEMon |
Method Summary | |
---|---|
int |
acquireAvailableEventsFromDriver()
Gets available events from driver. |
int |
close()
Closes the device and frees the internal device handle. |
short[] |
getAddresses()
Returns a newly constructed array of addresses |
int |
getNumEventsAcquired()
Returns the number of events acquired by the last call to acquireAvailableEventsFromDriver() |
int[] |
getTimestamps()
Returns a newly constructed array of timestamps that have a 1us tick |
static void |
main(java.lang.String[] args)
Tests event acquisition. |
int |
open()
Opens the device driver and gets a handle to the device which is internally maintained. |
boolean |
overrunOccured()
Is true if an overrun occured in the driver (>16k events) the last time acquireAvailableEventsFromDriver() was called. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public USBAEMonitor()
Method Detail |
---|
public int open() throws USBAEMonitorException
close()
and reopen the device.
USBAEMonitorException
- if there is a problem.close()
public int acquireAvailableEventsFromDriver() throws USBAEMonitorException
getAddresses()
or getTimestamps()
. USBAEMonitorException
is thrown if there is an error.
overrunOccured()
will be true if these was an overrun of the host USBXPress driver buffers (>16k events).
USBAEMonitorException
- .public int getNumEventsAcquired()
acquireAvailableEventsFromDriver()
public short[] getAddresses()
public int[] getTimestamps()
public boolean overrunOccured()
acquireAvailableEventsFromDriver()
was called. This flag is cleared by the next acquireAvailableEventsFromDriver()
.
If there is an overrun, the events grabbed are the most ancient; events after the overrun are discarded. The timestamps continue on but will
probably be lagged behind what they should be.
public int close()
public static void main(java.lang.String[] args)
args
- the command line arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |