|
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.linux.CypressFX2RetinaLinux
public class CypressFX2RetinaLinux
The Tmpdiff128 retina under linux using the JSR-80 linux java USB library (JSR-80 project).
Nested Class Summary | |
---|---|
class |
CypressFX2RetinaLinux.AEReader
Class to listen to aer events |
Field Summary | |
---|---|
static int |
AE_BUFFER_SIZE
|
protected net.sf.jaer.hardwareinterface.usb.linux.CypressFX2RetinaLinux.AEPacketRawPool |
aePacketRawPool
The pool of raw AE packets, used for data transfer |
protected CypressFX2RetinaLinux.AEReader |
aeReader
the event reader - a buffer pool thread from USBIO subclassing |
protected AEChip |
chip
|
protected java.lang.String |
devicName
|
protected boolean |
inEndpointEnabled
|
protected boolean |
isOpened
device open status |
protected AEPacketRaw |
lastEventsAcquired
|
static int |
MAX_BYTES_PER_BIAS
max number of bytes used for each bias. |
java.beans.PropertyChangeEvent |
NEW_EVENTS_PROPERTY_CHANGE
event supplied to listeners when new events are collected. |
protected java.util.prefs.Preferences |
prefs
|
protected java.io.FileInputStream |
retina
|
protected java.io.FileOutputStream |
retinaVendor
|
static byte |
VENDOR_DEVICE_OUT_REQUEST
|
Fields inherited from interface net.sf.jaer.hardwareinterface.usb.USBInterface |
---|
PID_THESYCON_END, PID_THESYCON_START, VID_THESYCON |
Constructor Summary | |
---|---|
CypressFX2RetinaLinux(java.lang.String deviceName)
This instance is typically constructint interfaceNumbered by the factory instance (HardwareInterfaceFactoryLinux) |
Method Summary | |
---|---|
AEPacketRaw |
acquireAvailableEventsFromDriver()
Gets available events from driver. |
void |
addAEListener(AEListener listener)
add a PropertyChangeListener for new events |
void |
claimInterface()
Claim this interface for exclusive access. |
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()
Returns the size of the host buffer. |
CypressFX2RetinaLinux.AEReader |
getAeReader()
|
AEChip |
getChip()
Sets the AEChip that this interface is acquiring events for |
short |
getDID()
|
int |
getEstimatedEventRate()
Returns estimate of present event rate on this interface |
AEPacketRaw |
getEvents()
returns the last events acquired by AEMonitorInterface.acquireAvailableEventsFromDriver() |
int |
getMaxCapacity()
the max capacity of this USB2 bus interface is 24MB/sec/4 bytes/event |
int |
getNumEventsAcquired()
Returns the number of events acquired by the last call to AEMonitorInterface.acquireAvailableEventsFromDriver() |
short |
getPID()
|
java.lang.String[] |
getStringDescriptors()
return the string USB descriptors for the device. |
int |
getTimestampTickUs()
|
java.lang.String |
getTypeName()
get text name of interface, e.g. |
short |
getVID()
|
int[] |
getVIDPID()
return the USB VID/PID of the interface |
boolean |
isEventAcquisitionEnabled()
|
boolean |
isOpen()
|
void |
open()
Opens the device driver and gets a handle to the device which is internally maintained. |
boolean |
overrunOccurred()
Is true if an overrun occured in the driver the last time AEMonitorInterface.acquireAvailableEventsFromDriver() was called. |
void |
releaseInterface()
Release this interface from exclusive access. |
void |
removeAEListener(AEListener listener)
remove a PropertyChangeListener for new events |
void |
resetPixelArray()
momentarily reset the entire pixel array |
void |
resetTimestamps()
Sends a vendor request to reset the retina timestamps to zero |
void |
sendConfiguration(Biasgen biasgen)
Sends a vendor request with the new bias values |
void |
setAEBufferSize(int size)
Sets the size in events of the host buffer. |
void |
setAeReader(CypressFX2RetinaLinux.AEReader aeReader)
|
void |
setArrayReset(boolean value)
Returns the array reset flag. |
void |
setChip(AEChip chip)
Sets the AEChip that this interface is acquiring events for |
void |
setEventAcquisitionEnabled(boolean enable)
Enables event acquisition, e.g. |
boolean |
setLed(boolean value)
Set LED on board. |
void |
setPowerDown(boolean powerDown)
sends the powerdown vendor request to power down the chip. |
boolean |
startAer()
Start AER data from IN endpoint 3 |
void |
startAEReader()
|
boolean |
stopAer()
Start AER data from IN endpoint 3 |
void |
stopAEReader()
|
protected void |
translateEvents_code(byte[] b,
int bytesSent)
Method that translates the UsbIoBuffer when a board that has a CPLD to timetamp events and that uses the CypressFX2 in slave FIFO mode, such as the USBAERmini2 board or StereoRetinaBoard, is used. |
boolean |
vendorRequest(byte request,
short value,
short index,
byte[] data)
Submit Vendor Request |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected AEChip chip
protected boolean inEndpointEnabled
protected java.util.prefs.Preferences prefs
public static final int MAX_BYTES_PER_BIAS
public static final byte VENDOR_DEVICE_OUT_REQUEST
protected java.lang.String devicName
protected java.io.FileInputStream retina
protected java.io.FileOutputStream retinaVendor
protected net.sf.jaer.hardwareinterface.usb.linux.CypressFX2RetinaLinux.AEPacketRawPool aePacketRawPool
public static final int AE_BUFFER_SIZE
protected AEPacketRaw lastEventsAcquired
protected CypressFX2RetinaLinux.AEReader aeReader
public final java.beans.PropertyChangeEvent NEW_EVENTS_PROPERTY_CHANGE
protected boolean isOpened
Constructor Detail |
---|
public CypressFX2RetinaLinux(java.lang.String deviceName) throws java.io.FileNotFoundException
java.io.FileNotFoundException
Method Detail |
---|
public AEPacketRaw acquireAvailableEventsFromDriver() throws HardwareInterfaceException
AEMonitorInterface
HardwareInterfaceException
is thrown if there is an error.
acquireAvailableEventsFromDriver
in interface AEMonitorInterface
HardwareInterfaceException
- .public int getNumEventsAcquired()
AEMonitorInterface
AEMonitorInterface.acquireAvailableEventsFromDriver()
getNumEventsAcquired
in interface AEMonitorInterface
public AEPacketRaw getEvents()
AEMonitorInterface
AEMonitorInterface.acquireAvailableEventsFromDriver()
getEvents
in interface AEMonitorInterface
public void resetTimestamps()
resetTimestamps
in interface AEMonitorInterface
public void resetPixelArray()
resetPixelArray
in interface HasResettablePixelArray
public boolean overrunOccurred()
AEMonitorInterface
AEMonitorInterface.acquireAvailableEventsFromDriver()
was called. This flag is cleared by the next AEMonitorInterface.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 AEMonitorInterface
public int getAEBufferSize()
AEMonitorInterface
getAEBufferSize
in interface AEMonitorInterface
public void setAEBufferSize(int size)
AEMonitorInterface
This call discards collected events.
setAEBufferSize
in interface AEMonitorInterface
size
- size of buffer in eventspublic void setEventAcquisitionEnabled(boolean enable) throws HardwareInterfaceException
AEMonitorInterface
setEventAcquisitionEnabled
in interface AEMonitorInterface
enable
- true to start, false to stop
HardwareInterfaceException
public boolean isEventAcquisitionEnabled()
isEventAcquisitionEnabled
in interface AEMonitorInterface
public void addAEListener(AEListener listener)
AEMonitorInterface
addAEListener
in interface AEMonitorInterface
listener
- will be called after each AEMonitorInterface.acquireAvailableEventsFromDriver()
callpublic void removeAEListener(AEListener listener)
AEMonitorInterface
removeAEListener
in interface AEMonitorInterface
listener
- to removepublic int getMaxCapacity()
getMaxCapacity
in interface AEMonitorInterface
public int getEstimatedEventRate()
AEMonitorInterface
getEstimatedEventRate
in interface AEMonitorInterface
public final int getTimestampTickUs()
getTimestampTickUs
in interface AEMonitorInterface
public void setChip(AEChip chip)
AEMonitorInterface
setChip
in interface AEMonitorInterface
chip
- the chippublic AEChip getChip()
AEMonitorInterface
getChip
in interface AEMonitorInterface
public java.lang.String[] getStringDescriptors()
USBInterface
getStringDescriptors
in interface USBInterface
public int[] getVIDPID()
USBInterface
getVIDPID
in interface USBInterface
public short getVID()
getVID
in interface USBInterface
public short getPID()
getPID
in interface USBInterface
public short getDID()
getDID
in interface USBInterface
public java.lang.String getTypeName()
HardwareInterface
getTypeName
in interface HardwareInterface
public void close()
HardwareInterface
close
in interface HardwareInterface
public void open() throws HardwareInterfaceException
HardwareInterface
open
in interface HardwareInterface
HardwareInterfaceException
- if there is a problem. Diagnostics are printeds.public boolean isOpen()
isOpen
in interface HardwareInterface
public void setPowerDown(boolean powerDown) throws HardwareInterfaceException
BiasgenHardwareInterface
Typically this method toggles the powerDown pin correctly to ensure on-chip biasgen is powered up. Chip may have been plugged in without being powered up. If powerdown is true, simply sets powerdown high. If powerdown is false, powerdown is toggled high and then low, to make sure a nagative transistion occurs. This transistion is necessary to ensure the startup circuit starts up the masterbias again.
setPowerDown
in interface BiasgenHardwareInterface
powerDown
- true to power OFF the biasgen, false to power on
HardwareInterfaceException
public void sendConfiguration(Biasgen biasgen) throws HardwareInterfaceException
sendConfiguration
in interface BiasgenHardwareInterface
biasgen
- the object that holds the configuration.
HardwareInterfaceException
public void flashConfiguration(Biasgen biasgen) throws HardwareInterfaceException
BiasgenHardwareInterface
flashConfiguration
in interface BiasgenHardwareInterface
biasgen
- holds the configuration values
HardwareInterfaceException
public void claimInterface()
public void releaseInterface()
public boolean setLed(boolean value)
value
- true to turn on
public boolean startAer()
public boolean stopAer()
public boolean vendorRequest(byte request, short value, short index, byte[] data)
request
- the request numbervalue
- the request valueindex
- the index of the requestdata
- the request data byte array
public CypressFX2RetinaLinux.AEReader getAeReader()
public void setAeReader(CypressFX2RetinaLinux.AEReader aeReader)
public void startAEReader()
public void stopAEReader()
public void setArrayReset(boolean value)
HasResettablePixelArray
setArrayReset
in interface HasResettablePixelArray
value
- true to reset the pixels, false to let them run normallyprotected void translateEvents_code(byte[] b, int bytesSent)
On these boards, the msb of the timestamp is used to signal a wrap (the actual timestamp is only 14 bits). The timestamp is also used to signal a timestamp reset The wrapAdd is incremented when an emtpy event is received which has the timestamp bit 15 set to one. The timestamp is reset when an event is received which has the timestamp bit 14 set.
Therefore for a valid event only 14 bits of the 16 transmitted timestamp bits are valid, bits 14 and 15 are the status bits. overflow happens every 16 ms. This way, no roll overs go by undetected, and the problem of invalid wraps doesn't arise.
b
- the data bufferpublic byte[] formatConfigurationBytes(Biasgen biasgen)
BiasgenHardwareInterface
formatConfigurationBytes
in interface BiasgenHardwareInterface
biasgen
- 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 |