|
jAER project on SourceForge | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jaer.hardwareinterface.usb.silabs.SiLabsC8051F320
public class SiLabsC8051F320
Acquires data from the UNI-USE 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 USB1AEMonitor,
then open() it. Each time you want to capture available events,
call acquireAvailableEventsFromDriver(), which returns the packet of events.
overrunOccurred() can be used to see if there was a driver overrun.
NOTE: only supports a single device at a time now. (JNI limitations).
| Field Summary | |
|---|---|
protected AEChip |
chip
|
boolean |
eventAcquisitionEnabled
|
static int |
MAX_BYTES_PER_BIAS
|
static java.lang.String |
NATIVE_DLL_FILENAME
|
java.beans.PropertyChangeEvent |
newEventPropertyChange
event supplied to listeners when new events are collected. |
static java.lang.String |
USBXPRESS_DLL_FILENAME
|
| Fields inherited from interface net.sf.jaer.hardwareinterface.usb.USBInterface |
|---|
PID_THESYCON_END, PID_THESYCON_START, VID_THESYCON |
| Constructor Summary | |
|---|---|
SiLabsC8051F320()
Creates a new instance of USB1AEMonitor. |
|
| Method Summary | |
|---|---|
AEPacketRaw |
acquireAvailableEventsFromDriver()
Gets available events from driver and return them in a new AEPacketRaw. |
void |
addAEListener(AEListener listener)
adds a listener for new events captured from the device |
void |
close()
Closes the device and frees the internal device handle. |
void |
flashConfiguration(Biasgen biasgen)
flashes the configuration in non-volatile storage so they will be reloaded on reset or powerup. |
byte[] |
formatConfigurationBytes(Biasgen biasgen)
Formats and returns the bytes that should be sent to set a particular configuration. |
int |
getAEBufferSize()
The buffer size is fixed at 16k events on this USBXPress device |
AEChip |
getChip()
Sets the AEChip that this interface is acquiring events for |
short |
getDID()
not implmented for SiLabs devices |
int |
getEstimatedEventRate()
Only valid after acquireAvailableEventsFromDriver(). |
AEPacketRaw |
getEvents()
returns the last events acquired by AEMonitorInterface.acquireAvailableEventsFromDriver() |
int |
getMaxCapacity()
the max capacity of this USB1 bus interface with SiLabs overhead is ~1 Mb/sec/4 bytes/event/2 ~ 150keps |
int |
getNumEventsAcquired()
Returns the number of events acquired by the last call to acquireAvailableEventsFromDriver() |
short |
getPID()
not implmented for SiLabs devices |
java.lang.String[] |
getStringDescriptors()
return the string USB descriptors for the device. |
java.beans.PropertyChangeSupport |
getSupport()
|
int |
getTimestampTickUs()
|
java.lang.String |
getTypeName()
get text name of interface, e.g. |
short |
getVID()
not implmented for SiLabs devices |
int[] |
getVIDPID()
not implmented for SiLabs devices |
boolean |
isEventAcquisitionEnabled()
returns state of event acquisition flag. |
boolean |
isOpen()
|
int |
nativeResetTimestamps()
|
void |
open()
Opens the device driver and starts acquiring events. |
boolean |
overrunOccurred()
Is true if an overrun occured in the driver (>16k events) the last time acquireAvailableEventsFromDriver() was called. |
void |
removeAEListener(AEListener listener)
remove a PropertyChangeListener for new events |
void |
resetTimestamps()
resets the timestamps to zero |
void |
sendConfiguration(Biasgen biasgen)
Sends the configuration values to the hardware. |
void |
setAEBufferSize(int AEBufferSize)
on this USBXPress device you cannot set the buffer size, so this call generates a warning print |
void |
setChip(AEChip chip)
Sets the AEChip that this interface is acquiring events for |
void |
setEventAcquisitionEnabled(boolean eventAcquisitionEnabled)
Enables event acquisition, e.g. |
void |
setPowerDown(boolean powerDown)
toggles the powerDown pin correctly to ensure on-chip biasgen is powered up. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected AEChip chip
public static final java.lang.String NATIVE_DLL_FILENAME
public static final java.lang.String USBXPRESS_DLL_FILENAME
public boolean eventAcquisitionEnabled
public static final int MAX_BYTES_PER_BIAS
public final java.beans.PropertyChangeEvent newEventPropertyChange
| Constructor Detail |
|---|
public SiLabsC8051F320()
| Method Detail |
|---|
public void setChip(AEChip chip)
AEMonitorInterface
setChip in interface AEMonitorInterfacechip - the chippublic AEChip getChip()
AEMonitorInterface
getChip in interface AEMonitorInterfacepublic int nativeResetTimestamps()
public void open()
throws HardwareInterfaceException
open in interface HardwareInterfaceUSBAEMonitorException - if there is a problem. Diagnostics are printed to stdout in the native code.
HardwareInterfaceException - if there is a problem. Diagnostics are printeds.close()public java.lang.String toString()
toString in class java.lang.Object
public AEPacketRaw acquireAvailableEventsFromDriver()
throws HardwareInterfaceException
overrunOccurred() will be true if these was an overrun of the host USBXPress driver buffers (>16k events).
AEListeners are called if new events have been collected.
acquireAvailableEventsFromDriver in interface AEMonitorInterfaceUSBAEMonitorException
HardwareInterfaceException - ..public int getNumEventsAcquired()
acquireAvailableEventsFromDriver()
getNumEventsAcquired in interface AEMonitorInterfacepublic void resetTimestamps()
resetTimestamps in interface AEMonitorInterfacepublic void close()
close in interface HardwareInterfacepublic int getAEBufferSize()
getAEBufferSize in interface AEMonitorInterfacepublic boolean overrunOccurred()
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.
overrunOccurred in interface AEMonitorInterfacepublic void setAEBufferSize(int AEBufferSize)
setAEBufferSize in interface AEMonitorInterfaceAEBufferSize - size of buffer in eventspublic java.lang.String[] getStringDescriptors()
USBInterface
getStringDescriptors in interface USBInterfacepublic java.beans.PropertyChangeSupport getSupport()
public void addAEListener(AEListener listener)
addAEListener in interface AEMonitorInterfacelistener - the listener. It is called with a PropertyChangeEvent when new events
are received by a call to acquireAvailableEventsFromDriver().acquireAvailableEventsFromDriver()public void removeAEListener(AEListener listener)
AEMonitorInterface
removeAEListener in interface AEMonitorInterfacelistener - to removepublic int[] getVIDPID()
getVIDPID in interface USBInterfacepublic boolean isOpen()
isOpen in interface HardwareInterface
public void flashConfiguration(Biasgen biasgen)
throws HardwareInterfaceException
BiasgenHardwareInterface
flashConfiguration in interface BiasgenHardwareInterfacebiasgen - holds the configuration values
HardwareInterfaceException
public void sendConfiguration(Biasgen biasgen)
throws HardwareInterfaceException
BiasgenHardwareInterface
sendConfiguration in interface BiasgenHardwareInterfacebiasgen - the object that holds the configuration.
HardwareInterfaceException
public void setPowerDown(boolean powerDown)
throws HardwareInterfaceException
setPowerDown in interface BiasgenHardwareInterfacepowerDown - true to power OFF the biasgen, false to power on
HardwareInterfaceExceptionpublic boolean isEventAcquisitionEnabled()
isEventAcquisitionEnabled in interface AEMonitorInterface
public void setEventAcquisitionEnabled(boolean eventAcquisitionEnabled)
throws HardwareInterfaceException
AEMonitorInterface
setEventAcquisitionEnabled in interface AEMonitorInterfaceeventAcquisitionEnabled - true to enable sending events from device
HardwareInterfaceExceptionpublic java.lang.String getTypeName()
HardwareInterface
getTypeName in interface HardwareInterfacepublic int getMaxCapacity()
getMaxCapacity in interface AEMonitorInterfacepublic int getEstimatedEventRate()
acquireAvailableEventsFromDriver().
getEstimatedEventRate in interface AEMonitorInterfacepublic final int getTimestampTickUs()
getTimestampTickUs in interface AEMonitorInterfacepublic AEPacketRaw getEvents()
AEMonitorInterfaceAEMonitorInterface.acquireAvailableEventsFromDriver()
getEvents in interface AEMonitorInterfacepublic short getDID()
getDID in interface USBInterfacepublic short getPID()
getPID in interface USBInterfacepublic short getVID()
getVID in interface USBInterfacepublic byte[] formatConfigurationBytes(Biasgen biasgen)
BiasgenHardwareInterface
formatConfigurationBytes in interface BiasgenHardwareInterfacebiasgen - the source of the configuration.
|
jAER project on SourceForge | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||