|
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.cypressfx2.CypressFX2
public class CypressFX2
Devices that use the CypressFX2 and the USBIO driver, e.g. the DVS retinas, the USBAERmini2. This class should not normally be constructed but rather a subclass that overrides the AEReader should be used.
In this class, you can also set the size of the host buffer with setAEBufferSize(int)
, giving you more time between calls to process the events.
On the device, a timer sends all available events approximately every 10ms -- you don't need to wait for a fixed size buffer to be captured to be available to the host. But if events come quickly enough, new events can be available much faster than this.
You can also request at any time an early transfer of events with requestEarlyTransfer()
. This will send a vendor request to the device to immediately transfer
available events, but they won't be available to the host for a little while, depending on USBIOInterface and driver latency.
See the main() method for an example of use.
Fires PropertyChangeEvent on the following
Nested Class Summary | |
---|---|
class |
CypressFX2.AEPacketRawPool
Object that holds pool of AEPacketRaw that handles data interchange between capture and other (rendering) threads. |
class |
CypressFX2.AEReader
AE reader class. |
protected class |
CypressFX2.AsyncStatusThread
|
Field Summary | |
---|---|
static int |
AE_BUFFER_SIZE
default size of AE buffer for user processes. |
protected int |
aeBufferSize
this is the size of the AEPacketRaw that are part of AEPacketRawPool that double buffer the translated events between rendering and capture threads |
protected CypressFX2.AEPacketRawPool |
aePacketRawPool
The pool of raw AE packets, used for data transfer |
protected CypressFX2.AEReader |
aeReader
the event reader - a buffer pool thread from USBIO subclassing |
protected boolean |
arrayResetEnabled
|
protected CypressFX2.AsyncStatusThread |
asyncStatusThread
the thread that reads device status messages on EP1 |
protected de.thesycon.usbio.UsbIoBuf |
BufDesc
a USBIO buffer used for calls |
protected AEChip |
chip
|
protected de.thesycon.usbio.structs.USB_DEVICE_DESCRIPTOR |
deviceDescriptor
the USBIO device descriptor |
static short |
DID_STEREOBOARD
|
int |
EEPROM_SIZE
the size in bytes of the EEPROM atttached to the CypressFX2LP |
protected int |
eventCounter
The count of events acquired but not yet passed to user via acquireAvailableEventsFromDriver |
static java.lang.String |
FIRMWARE_FILENAME_COCHLEAAMS_BIX
|
static java.lang.String |
FIRMWARE_FILENAME_DVS128_IIC
|
static java.lang.String |
FIRMWARE_FILENAME_MAPPER_IIC
|
static java.lang.String |
FIRMWARE_FILENAME_MONITOR_SEQUENCER
filename of FX2 binary executable, generated by uVision project and associated script that runs hex2bix |
static java.lang.String |
FIRMWARE_FILENAME_MONITOR_SEQUENCER_HEX
filename of FX2 binary executable, generated by uVision project and associated script that runs hex2bix |
static java.lang.String |
FIRMWARE_FILENAME_MONITOR_SEQUENCER_IIC
filename of FX2 binary executable, generated by uVision project and associated script that runs hex2bix |
static java.lang.String |
FIRMWARE_FILENAME_MONITOR_SEQUENCER_JTAG_IIC
|
static java.lang.String |
FIRMWARE_FILENAME_STEREO_IIC
|
static java.lang.String |
FIRMWARE_FILENAME_TCVS320_BIX
|
static java.lang.String |
FIRMWARE_FILENAME_TCVS320_HEX
|
static java.lang.String |
FIRMWARE_FILENAME_TMPDIFF128_BIX
filename of FX2 binary executable, generated by uVision project and associated script that runs hex2bix |
static java.lang.String |
FIRMWARE_FILENAME_TMPDIFF128_HEX
filename of FX2 binary executable, generated by uVision project and associated script that runs hex2bix |
protected int |
gDevList
the devlist handle for USBIO |
static java.lang.String |
GUID
driver guid (Globally unique ID, for this USB driver instance |
protected de.thesycon.usbio.UsbIo |
gUsbIo
the UsbIo interface to the device. |
protected boolean |
inEndpointEnabled
|
protected int |
interfaceNumber
the device number, out of all potential compatible devices that could be opened |
protected boolean |
isOpened
device open status |
protected AEPacketRaw |
lastEventsAcquired
the last events from acquireAvailableEventsFromDriver() , This packet is reused. |
protected java.util.logging.Logger |
log
|
int |
MAX_CONTROL_XFER_SIZE
size of control transfer data packets. |
java.beans.PropertyChangeEvent |
NEW_EVENTS_PROPERTY_CHANGE
event supplied to listeners when new events are collected. |
static long |
NO_AE_REOPEN_TIMEOUT
timeout in ms to reopen driver (reloading firmware) if no events are received for this time. |
protected int |
numberOfStringDescriptors
The number of string desriptors - all devices have at least two (Vendor and Product strings) but some may have in addition a third serial number string. |
static short |
PID_BLANK
A blank Cypress FX2 has VID/PID of 0x04b4/0x8613. |
static short |
PID_COCHLEAAMS
For CochleaAMS devices |
static short |
PID_DVS128_REV0
|
static short |
PID_TCVS320_RETINA
|
static short |
PID_TMPDIFF128_RETINA
|
static short |
PID_USB2AERmapper
|
static short |
PID_USBAERmini2
|
static short |
PID_USBAERmini2_without_firmware
|
protected static java.util.prefs.Preferences |
prefs
Used to store preferences, e.g. |
protected de.thesycon.usbio.structs.USB_STRING_DESCRIPTOR |
stringDescriptor1
the first USB string descriptor (Vendor name) (if available) |
protected de.thesycon.usbio.structs.USB_STRING_DESCRIPTOR |
stringDescriptor2
the second USB string descriptor (Product name) (if available) |
protected de.thesycon.usbio.structs.USB_STRING_DESCRIPTOR |
stringDescriptor3
the third USB string descriptor (Serial number) (if available) |
short |
TICK_US
Time in us of each timestamp count here on host, could be different on board. |
byte |
VENDOR_REQUEST_DO_ARRAY_RESET
|
static byte |
VENDOR_REQUEST_EARLY_TRANFER
|
static byte |
VENDOR_REQUEST_FIRMWARE
|
byte |
VENDOR_REQUEST_FLASH_BIASES
|
byte |
VENDOR_REQUEST_POWERDOWN
|
byte |
VENDOR_REQUEST_RESET_TIMESTAMPS
|
static byte |
VENDOR_REQUEST_SEND_BIAS_BYTES
|
byte |
VENDOR_REQUEST_SET_ARRAY_RESET
|
byte |
VENDOR_REQUEST_SET_LED
|
static byte |
VENDOR_REQUEST_START_TRANSFER
|
static byte |
VENDOR_REQUEST_STOP_TRANSFER
|
static short |
VID
All the devices here have vendor ID VID which has been allocated to jAER by Thesycon |
static short |
VID_BLANK
A blank Cypress FX2 has VID/PID of 0x04b4/0x8613. |
static byte |
VR_DOWNLOAD_FIRMWARE
|
byte |
VR_EEPROM
|
byte |
VR_RAM
|
static byte |
VR_SET_DEVICE_NAME
|
Fields inherited from interface de.thesycon.usbio.UsbIoErrorCodes |
---|
USBIO_ERR_ADDITIONAL_EVENT_SIGNALLED, USBIO_ERR_ALREADY_BOUND, USBIO_ERR_ALREADY_CONFIGURED, USBIO_ERR_BABBLE_DETECTED, USBIO_ERR_BAD_START_FRAME, USBIO_ERR_BTSTUFF, USBIO_ERR_BUFFER_OVERRUN, USBIO_ERR_BUFFER_UNDERRUN, USBIO_ERR_BULK_RESTRICTION, USBIO_ERR_CANCELED, USBIO_ERR_CONTROL_NOT_SUPPORTED, USBIO_ERR_CONTROL_RESTRICTION, USBIO_ERR_CRC, USBIO_ERR_DATA_BUFFER_ERROR, USBIO_ERR_DATA_OVERRUN, USBIO_ERR_DATA_TOGGLE_MISMATCH, USBIO_ERR_DATA_UNDERRUN, USBIO_ERR_DEMO_EXPIRED, USBIO_ERR_DEV_NOT_RESPONDING, USBIO_ERR_DEVICE_GONE, USBIO_ERR_DEVICE_NOT_FOUND, USBIO_ERR_DEVICE_NOT_OPEN, USBIO_ERR_DEVICE_NOT_PRESENT, USBIO_ERR_ENDPOINT_HALTED, USBIO_ERR_EP0_RESTRICTION, USBIO_ERR_ERROR_BUSY, USBIO_ERR_ERROR_SHORT_TRANSFER, USBIO_ERR_FAILED, USBIO_ERR_FIFO, USBIO_ERR_FRAME_CONTROL_NOT_OWNED, USBIO_ERR_FRAME_CONTROL_OWNED, USBIO_ERR_INSUFFICIENT_RESOURCES, USBIO_ERR_INTERFACE_NOT_FOUND, USBIO_ERR_INTERNAL_HC_ERROR, USBIO_ERR_INTERRUPT_RESTRICTION, USBIO_ERR_INVALID_CONFIGURATION_DESCRIPTOR, USBIO_ERR_INVALID_DEVICE_STATE, USBIO_ERR_INVALID_DIRECTION, USBIO_ERR_INVALID_FUNCTION_PARAM, USBIO_ERR_INVALID_INBUFFER, USBIO_ERR_INVALID_IOCTL, USBIO_ERR_INVALID_ISO_PACKET, USBIO_ERR_INVALID_OUTBUFFER, USBIO_ERR_INVALID_PARAM, USBIO_ERR_INVALID_PARAMETER, USBIO_ERR_INVALID_PIPE_FLAGS, USBIO_ERR_INVALID_PIPE_HANDLE, USBIO_ERR_INVALID_POWER_STATE, USBIO_ERR_INVALID_RECIPIENT, USBIO_ERR_INVALID_TYPE, USBIO_ERR_INVALID_URB_FUNCTION, USBIO_ERR_ISO_NA_LATE_USBPORT, USBIO_ERR_ISO_NOT_ACCESSED_BY_HW, USBIO_ERR_ISO_NOT_ACCESSED_LATE, USBIO_ERR_ISO_RESTRICTION, USBIO_ERR_ISO_TD_ERROR, USBIO_ERR_ISOCH_REQUEST_FAILED, USBIO_ERR_LOAD_SETUP_API_FAILED, USBIO_ERR_NO_BANDWIDTH, USBIO_ERR_NO_MEMORY, USBIO_ERR_NO_SUCH_DEVICE_INSTANCE, USBIO_ERR_NOT_ACCESSED, USBIO_ERR_NOT_BOUND, USBIO_ERR_NOT_CONFIGURED, USBIO_ERR_NOT_SUPPORTED, USBIO_ERR_OPEN_PIPES, USBIO_ERR_OUT_OF_ADDRESS_SPACE, USBIO_ERR_OUT_OF_MEMORY, USBIO_ERR_PENDING_REQUESTS, USBIO_ERR_PID_CHECK_FAILURE, USBIO_ERR_PIPE_NOT_FOUND, USBIO_ERR_PIPE_RESTRICTION, USBIO_ERR_PIPE_SIZE_RESTRICTION, USBIO_ERR_POOL_EMPTY, USBIO_ERR_POWER_DOWN, USBIO_ERR_REQUEST_FAILED, USBIO_ERR_RESERVED1, USBIO_ERR_RESERVED2, USBIO_ERR_SET_CONFIG_FAILED, USBIO_ERR_SET_CONFIGURATION_FAILED, USBIO_ERR_STALL_PID, USBIO_ERR_STATUS_NOT_MAPPED, USBIO_ERR_SUCCESS, USBIO_ERR_TIMEOUT, USBIO_ERR_TOO_MUCH_ISO_PACKETS, USBIO_ERR_UNEXPECTED_PID, USBIO_ERR_USBD_BUFFER_TOO_SMALL, USBIO_ERR_USBD_INTERFACE_NOT_FOUND, USBIO_ERR_USBD_TIMEOUT, USBIO_ERR_VERSION_MISMATCH, USBIO_ERR_VID_RESTRICTION, USBIO_ERR_XACT_ERROR |
Fields inherited from interface net.sf.jaer.hardwareinterface.usb.USBInterface |
---|
PID_THESYCON_END, PID_THESYCON_START, VID_THESYCON |
Constructor Summary | |
---|---|
protected |
CypressFX2(int devNumber)
This constructor is protected because these instances should be constructed by the CypressFX2Factory. |
Method Summary | |
---|---|
AEPacketRaw |
acquireAvailableEventsFromDriver()
Gets available events from driver. |
void |
acquireDevice()
acquire a device for exclusive use, other processes can't open the device anymore used for example for continuous sequencing in matlab |
void |
addAEListener(AEListener listener)
adds a listener for new events captured from the device. |
protected void |
allocateAEBuffers()
Allocates internal memory for transferring data from reader to consumer, e.g. |
void |
close()
Closes the device. |
void |
cyclePort()
Cycles the port using USBIO cyclePort. |
protected void |
download8051RAM(int address,
byte[] FWBuffer)
Downloads to RAM on FX2 using built-in vendor request to CPUCS. |
void |
downloadFirmwareBinary(java.lang.String firmwareFilename)
downloads firmware to FX2 RAM. |
void |
downloadFirmwareHex(java.lang.String hexFileResourcePath)
downloads firmware to the FX2 RAM from a hex file. |
protected void |
eraseEEPROM()
erases the VID/PID/DID and device identifier strings |
int |
getAEBufferSize()
Returns the size of the host buffer. |
CypressFX2.AEReader |
getAeReader()
|
AEChip |
getChip()
Sets the AEChip that this interface is acquiring events for |
static java.lang.String |
getDefaultFirmwareBixFileForBlankDevice()
|
short |
getDID()
|
int |
getEstimatedEventRate()
Returns estimate of present event rate on this interface |
AEPacketRaw |
getEvents()
returns last events from acquireAvailableEventsFromDriver() |
int |
getFifoSize()
|
protected java.lang.String |
getFirmwareFilenameBinaryFromVIDPID()
Deprecated. not used anymore - user chooses firmware file via AEViewer/CypressFX2 menu item |
protected java.lang.String |
getFirmwareFilenameHexFromVIDPID()
|
int |
getMaxCapacity()
the max capacity of this USB2 bus interface is 24MB/sec/4 bytes/event |
int |
getNumberOfStringDescriptors()
returns number of string descriptors |
int |
getNumBuffers()
|
int |
getNumEventsAcquired()
Returns the number of events acquired by the last call to acquireAvailableEventsFromDriver() |
short |
getPID()
|
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()
|
int[] |
getVIDPID()
return the USB VID/PID of the interface |
protected boolean |
hasStringIdentifier()
checks if device has a string identifier that is a non-empty string |
boolean |
isEventAcquisitionEnabled()
|
boolean |
isInEndpointEnabled()
|
boolean |
isOpen()
reports if interface is open() . |
byte[] |
loadBinaryFirmwareFile(java.lang.String firmwareFilename)
Loads a binary firmware file into memory. |
byte[] |
loadBinaryFirmwareFileSystemFile(java.lang.String firmwareFilename)
Loads a binary firmware file into memory from a file system path (as opposed to resource path). |
void |
onAdd()
|
void |
onRemove()
|
void |
open()
Constructs a new USB connection and opens it. |
protected void |
openUsbIo_minimal()
Opens the device just enough to read the device descriptor but does not start the reader or writer thread. |
protected void |
openUsbIo()
This method does the hard work of opening the device, downloading the firmware, making sure everything is OK. |
boolean |
overrunOccurred()
Is true if an overrun occured in the driver (> AE_BUFFER_SIZE events) during the period before the last time acquireAvailableEventsFromDriver() was called. |
protected byte[] |
readEEPROM(int addr,
int length)
Read the EEPROM contents. |
void |
releaseDevice()
release the device from exclusive use |
void |
removeAEListener(AEListener listener)
remove a PropertyChangeListener for new events |
void |
requestEarlyTransfer()
sends vendor request to trigger an immediate commit of whatever is in the endpoint fifo immediately. |
void |
resetPixelArray()
Reset the entire pixel array. |
void |
resetTimestamps()
reset the timestamps to zero. |
void |
resetUSB()
Resets the USB device using USBIO resetDevice |
void |
sendVendorRequest(byte request)
sends a vender request without data, value and index are set to zero. |
void |
sendVendorRequest(byte request,
short value,
short index)
sends a vender request without any data packet but with request, value and index. |
void |
sendVendorRequest(byte request,
short value,
short index,
byte[] bytes)
Sends a vendor request with a given byte[]. |
void |
sendVendorRequest(byte request,
short value,
short index,
de.thesycon.usbio.structs.USBIO_DATA_BUFFER dataBuffer)
sends a vender request with data. |
protected void |
set8051Reset(boolean value)
sends vendor request to CPUCS register to set 8051 in CPU reset (or not) |
void |
setAEBufferSize(int size)
set the size of the raw event packet buffer. |
void |
setAeReader(CypressFX2.AEReader aeReader)
|
void |
setAEReaderFifoSize(int size)
sets the buffer size for the aereader thread. |
void |
setAEReaderNumBuffers(int num)
sets the number of buffers for the aereader thread. |
void |
setChip(AEChip chip)
Sets the AEChip that this interface is acquiring events for |
static void |
setDefaultFirmwareBixFileForBlankDevice(java.lang.String aDefaultFirmwareBixFileForBlankDevice)
|
void |
setEventAcquisitionEnabled(boolean enable)
start or stops the event acquisition. |
void |
setFifoSize(int fifoSize)
|
void |
setInEndpointEnabled(boolean inEndpointEnabled)
sends a vendor request to enable or disable in transfers of AEs |
void |
setLed(boolean value)
set the board LED state. |
void |
setNumBuffers(int numBuffers)
|
void |
setSerialNumber(java.lang.String name)
Writes the serial number string to the device EEPROM |
java.lang.String |
showFirmwareFilenameDialog()
Shows a dialog to let user choose a firmware file for download to the device |
void |
startAEReader()
starts reader buffer pool thread and enables in endpoints for AEs. |
void |
stopAEReader()
|
java.lang.String |
toString()
Returns string description of device including the USB vendor/project IDs. |
protected void |
unconfigureDevice()
unconfigure device in case it was still configured from a prior terminated process |
void |
writeC2Load(java.lang.String firmwareFilename,
short VID,
short PID,
short DID)
writes the Cypress "C2" load to the EEPROM that makes the Cypress have full EEPROM firmware, including VID, PID, DID. |
void |
writeCPLDfirmware(java.lang.String svfFile)
Writes the CPLD configuration from an SVF file. |
void |
writeEEPROM(int addr,
byte[] bytes)
This is a BLOCKING write call to write the Cypress EEPROM. |
void |
writeHexFileToEEPROM(java.lang.String hexFileResourcePath,
short VID,
short PID,
short DID)
writes the Cypress "C2" load to the EEPROM that makes the Cypress have EEPROM firmware, including VID, PID, DID. |
void |
writeVIDPIDDID(short VID,
short PID,
short DID)
writes the Cypress "C0" load to the EEPROM that makes the Cypress FX2 have a Vender, Product, and Device ID on powerup. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static java.util.prefs.Preferences prefs
protected java.util.logging.Logger log
protected AEChip chip
public static final java.lang.String FIRMWARE_FILENAME_TMPDIFF128_BIX
public static final java.lang.String FIRMWARE_FILENAME_TMPDIFF128_HEX
public static final java.lang.String FIRMWARE_FILENAME_MONITOR_SEQUENCER
public static final java.lang.String FIRMWARE_FILENAME_MONITOR_SEQUENCER_HEX
public static final java.lang.String FIRMWARE_FILENAME_MONITOR_SEQUENCER_IIC
public static final java.lang.String FIRMWARE_FILENAME_MONITOR_SEQUENCER_JTAG_IIC
public static final java.lang.String FIRMWARE_FILENAME_MAPPER_IIC
public static final java.lang.String FIRMWARE_FILENAME_STEREO_IIC
public static final java.lang.String FIRMWARE_FILENAME_TCVS320_HEX
public static final java.lang.String FIRMWARE_FILENAME_TCVS320_BIX
public static final java.lang.String FIRMWARE_FILENAME_DVS128_IIC
public static final java.lang.String FIRMWARE_FILENAME_COCHLEAAMS_BIX
public static final java.lang.String GUID
public static final short VID_BLANK
public static final short PID_BLANK
public static final short VID
public static final short PID_DVS128_REV0
public static final short PID_COCHLEAAMS
public static final short PID_TMPDIFF128_RETINA
public static final short PID_USBAERmini2
public static final short PID_USBAERmini2_without_firmware
public static final short PID_USB2AERmapper
public static final short DID_STEREOBOARD
public static final short PID_TCVS320_RETINA
public final java.beans.PropertyChangeEvent NEW_EVENTS_PROPERTY_CHANGE
public static final byte VENDOR_REQUEST_START_TRANSFER
public static final byte VENDOR_REQUEST_STOP_TRANSFER
public static final byte VENDOR_REQUEST_EARLY_TRANFER
public static final byte VENDOR_REQUEST_SEND_BIAS_BYTES
public final byte VENDOR_REQUEST_POWERDOWN
public final byte VENDOR_REQUEST_FLASH_BIASES
public final byte VENDOR_REQUEST_RESET_TIMESTAMPS
public final byte VENDOR_REQUEST_SET_ARRAY_RESET
public final byte VENDOR_REQUEST_DO_ARRAY_RESET
public final byte VENDOR_REQUEST_SET_LED
public static final byte VR_DOWNLOAD_FIRMWARE
public static final byte VR_SET_DEVICE_NAME
public final byte VR_EEPROM
public final byte VR_RAM
public static final byte VENDOR_REQUEST_FIRMWARE
public static long NO_AE_REOPEN_TIMEOUT
public final short TICK_US
public static final int AE_BUFFER_SIZE
acquireAvailableEventsFromDriver()
to another thread
acquireAvailableEventsFromDriver()
,
CypressFX2.AEReader
,
setAEBufferSize(int)
,
Constant Field Valuesprotected int aeBufferSize
protected CypressFX2.AEReader aeReader
protected CypressFX2.AsyncStatusThread asyncStatusThread
protected de.thesycon.usbio.UsbIoBuf BufDesc
protected CypressFX2.AEPacketRawPool aePacketRawPool
protected int eventCounter
protected AEPacketRaw lastEventsAcquired
acquireAvailableEventsFromDriver()
, This packet is reused.
protected boolean inEndpointEnabled
protected boolean isOpened
protected int interfaceNumber
public int EEPROM_SIZE
public final int MAX_CONTROL_XFER_SIZE
protected boolean arrayResetEnabled
protected de.thesycon.usbio.structs.USB_STRING_DESCRIPTOR stringDescriptor1
protected de.thesycon.usbio.structs.USB_STRING_DESCRIPTOR stringDescriptor2
protected de.thesycon.usbio.structs.USB_STRING_DESCRIPTOR stringDescriptor3
protected int numberOfStringDescriptors
protected de.thesycon.usbio.structs.USB_DEVICE_DESCRIPTOR deviceDescriptor
protected de.thesycon.usbio.UsbIo gUsbIo
protected int gDevList
Constructor Detail |
---|
protected CypressFX2(int devNumber)
devNumber
- the desired device number, in range returned by CypressFX2Factory.getNumInterfacesAvailableMethod Detail |
---|
public static java.lang.String getDefaultFirmwareBixFileForBlankDevice()
public static void setDefaultFirmwareBixFileForBlankDevice(java.lang.String aDefaultFirmwareBixFileForBlankDevice)
public void acquireDevice() throws HardwareInterfaceException
HardwareInterfaceException
public void releaseDevice() throws HardwareInterfaceException
HardwareInterfaceException
public java.beans.PropertyChangeSupport getSupport()
public java.lang.String toString()
toString
in class java.lang.Object
public void setSerialNumber(java.lang.String name) throws HardwareInterfaceException
name
- the string. This string has very limited length, e.g. 4 bytes.
HardwareInterfaceException
public void writeEEPROM(int addr, byte[] bytes) throws HardwareInterfaceException
EEPROM_SIZE
.
Thread-safe.
addr
- the starting addressbytes
- the bytes to write
HardwareInterfaceException
protected void eraseEEPROM() throws HardwareInterfaceException
HardwareInterfaceException
protected byte[] readEEPROM(int addr, int length) throws HardwareInterfaceException
addr
- the starting addresslength
- the number of bytes to read
HardwareInterfaceException
public void writeVIDPIDDID(short VID, short PID, short DID) throws HardwareInterfaceException
VID
- vendor IDPID
- product IDDID
- the 'device' ID, can be used to individualize devices. This is not the same as the serial number, which by convention is the third string ID.
HardwareInterfaceException
public void writeC2Load(java.lang.String firmwareFilename, short VID, short PID, short DID) throws HardwareInterfaceException
firmwareFilename
- a File containing the binary format .iic file
firmware as output from hex2bix. This is a flat firmware format that starts at address 0.
It does not include the VID/PID written for the C2 load.VID
- vendor IDPID
- product IDDID
- the 'device' ID, can be used to individualize devices
HardwareInterfaceException
public void writeHexFileToEEPROM(java.lang.String hexFileResourcePath, short VID, short PID, short DID) throws HardwareInterfaceException
VID
- PID
- DID
- the 'device' ID, can be used to individualize deviceshexFileResourcePath
- a full path pointing to a resource containing the firmware as output from compiler in Intel hex format. This resource is a file that is somewhere in the classpath, i.e. it is a file
that is included in the project jar. For example: "/net/sf/jaer/hardwareinterface/usb/cypressfx2/USBAER_FX2LP_Retina.hex"
HardwareInterfaceException
FIRMWARE_FILENAME_TMPDIFF128_HEX
,
FIRMWARE_FILENAME_MONITOR_SEQUENCER_HEX
public void downloadFirmwareHex(java.lang.String hexFileResourcePath) throws HardwareInterfaceException
hexFileResourcePath
- a full path pointing to a resource containing the firmware as output from compiler in Intel hex format. This resource is a file that is somewhere in the classpath, i.e. it is a file
that is included in the project jar. For example: "/net/sf/jaer/hardwareinterface/usb/cypressfx2/USBAER_FX2LP_Retina.hex"
HardwareInterfaceException
FIRMWARE_FILENAME_TMPDIFF128_HEX
,
FIRMWARE_FILENAME_MONITOR_SEQUENCER_HEX
public void addAEListener(AEListener listener)
addAEListener
in interface AEMonitorInterface
listener
- the listener. It is called with a PropertyChangeEvent when new events
are received by a call to acquireAvailableEventsFromDriver()
.
These events may be accessed by calling getEvents()
.public void removeAEListener(AEListener listener)
AEMonitorInterface
removeAEListener
in interface AEMonitorInterface
listener
- to removepublic void startAEReader() throws HardwareInterfaceException
HardwareInterfaceException
public AEPacketRaw acquireAvailableEventsFromDriver() throws HardwareInterfaceException
HardwareInterfaceException
is thrown if there is an error.
overrunOccurred()
will be reset after this call.
This method also starts event acquisition if it is not running already. Not thread safe but does use the thread-safe swap() method of AEPacketRawPool to swap data with the acquisition thread.
acquireAvailableEventsFromDriver
in interface AEMonitorInterface
HardwareInterfaceException
.
public int getMaxCapacity()
getMaxCapacity
in interface AEMonitorInterface
public int getEstimatedEventRate()
AEMonitorInterface
getEstimatedEventRate
in interface AEMonitorInterface
public int getNumEventsAcquired()
acquireAvailableEventsFromDriver()
getNumEventsAcquired
in interface AEMonitorInterface
public void resetTimestamps()
resetTimestamps
in interface AEMonitorInterface
public void resetPixelArray()
public void setLed(boolean value)
value
- true to turn it on, false to turn it off.public boolean overrunOccurred()
AE_BUFFER_SIZE
events) during the period before the last time acquireAvailableEventsFromDriver()
was called. This flag is cleared by acquireAvailableEventsFromDriver()
, so you need to
check it before you acquire the events.
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 void close()
close
in interface HardwareInterface
public void stopAEReader()
public void requestEarlyTransfer() throws HardwareInterfaceException
HardwareInterfaceException
public boolean isInEndpointEnabled()
public void setInEndpointEnabled(boolean inEndpointEnabled) throws HardwareInterfaceException
inEndpointEnabled
- true to send vendor request to enable, false to send request to disable
HardwareInterfaceException
public void setAEReaderFifoSize(int size)
public void setAEReaderNumBuffers(int num)
protected void allocateAEBuffers()
public int getAEBufferSize()
AEMonitorInterface
getAEBufferSize
in interface AEMonitorInterface
public void setAEBufferSize(int size)
This call discards collected events.
setAEBufferSize
in interface AEMonitorInterface
size
- of buffer in eventspublic void onAdd()
onAdd
in interface de.thesycon.usbio.PnPNotifyInterface
public void onRemove()
onRemove
in interface de.thesycon.usbio.PnPNotifyInterface
public void setEventAcquisitionEnabled(boolean enable) throws HardwareInterfaceException
setEventAcquisitionEnabled
in interface AEMonitorInterface
enable
- boolean to enable or disable event acquisition
HardwareInterfaceException
public boolean isEventAcquisitionEnabled()
isEventAcquisitionEnabled
in interface AEMonitorInterface
public java.lang.String getTypeName()
HardwareInterface
getTypeName
in interface HardwareInterface
public int getNumberOfStringDescriptors()
protected boolean hasStringIdentifier()
public void open() throws HardwareInterfaceException
open
in interface HardwareInterface
HardwareInterfaceException
- if there is an error opening devicesetEventAcquisitionEnabled(boolean)
,
openUsbIo_minimal()
protected void openUsbIo() throws HardwareInterfaceException
This method is synchronized to prevent multiple threads from trying to open at the same time, e.g. a GUI thread and the main thread.
Opening the device after it has already been opened has no effect.
HardwareInterfaceException
- if there is a problem. Diagnostics are printed to stderr.close()
protected void openUsbIo_minimal() throws HardwareInterfaceException
HardwareInterfaceException
open()
protected void unconfigureDevice() throws HardwareInterfaceException
HardwareInterfaceException
public java.lang.String[] getStringDescriptors()
getStringDescriptors
in interface USBInterface
public int[] getVIDPID()
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 boolean isOpen()
open()
.
isOpen
in interface HardwareInterface
public byte[] loadBinaryFirmwareFile(java.lang.String firmwareFilename) throws java.io.IOException
firmwareFilename
- the resource path
java.io.IOException
public byte[] loadBinaryFirmwareFileSystemFile(java.lang.String firmwareFilename) throws java.io.IOException
firmwareFilename
- the file path
java.io.IOException
public void downloadFirmwareBinary(java.lang.String firmwareFilename) throws HardwareInterfaceException
Firmware that is actually downloaded depends on discovered PID of device. If the PID is discovered to be a bare CypressFX2, then a dialog is shown that user can use to program the VID/PID of the device.
In addition, there is a problem if firmware is downloaded more than once to an FX2LP device between hard resets. Therefore if this method detects that the device has string identitifers, it assumes the firmware has already been downloaded. Firmware file is loaded as a resource from the jar archive.
HardwareInterfaceException
protected java.lang.String getFirmwareFilenameBinaryFromVIDPID()
public java.lang.String showFirmwareFilenameDialog()
protected java.lang.String getFirmwareFilenameHexFromVIDPID()
protected void download8051RAM(int address, byte[] FWBuffer) throws HardwareInterfaceException
address
- the starting address in the 8051 RAMFWBuffer
- the data
HardwareInterfaceException
set8051Reset(boolean)
protected void set8051Reset(boolean value) throws HardwareInterfaceException
value
- true to reset, false to run
HardwareInterfaceException
download8051RAM(int, byte[])
public final int getTimestampTickUs()
getTimestampTickUs
in interface AEMonitorInterface
public AEPacketRaw getEvents()
acquireAvailableEventsFromDriver()
getEvents
in interface AEMonitorInterface
public void sendVendorRequest(byte request) throws HardwareInterfaceException
request
- the vendor request byte, identifies the request on the device
HardwareInterfaceException
public void sendVendorRequest(byte request, short value, short index) throws HardwareInterfaceException
request
- the vendor request byte, identifies the request on the devicevalue
- the value of the request (bValue USB field)index
- the "index" of the request (bIndex USB field)
HardwareInterfaceException
public void sendVendorRequest(byte request, short value, short index, byte[] bytes) throws HardwareInterfaceException
request
- the vendor request byte, identifies the request on the devicevalue
- the value of the request (bValue USB field)index
- the "index" of the request (bIndex USB field)bytes
- the data which is to be transmitted to the device
HardwareInterfaceException
public void sendVendorRequest(byte request, short value, short index, de.thesycon.usbio.structs.USBIO_DATA_BUFFER dataBuffer) throws HardwareInterfaceException
request
- the vendor request byte, identifies the request on the devicevalue
- the value of the request (bValue USB field)index
- the "index" of the request (bIndex USB field)dataBuffer
- the data which is to be transmitted to the device
HardwareInterfaceException
public void writeCPLDfirmware(java.lang.String svfFile) throws HardwareInterfaceException
svfFile
-
HardwareInterfaceException
public CypressFX2.AEReader getAeReader()
public void setAeReader(CypressFX2.AEReader aeReader)
public int getFifoSize()
getFifoSize
in interface ReaderBufferControl
public void setFifoSize(int fifoSize)
setFifoSize
in interface ReaderBufferControl
public int getNumBuffers()
getNumBuffers
in interface ReaderBufferControl
public void setNumBuffers(int numBuffers)
setNumBuffers
in interface ReaderBufferControl
public void setChip(AEChip chip)
AEMonitorInterface
setChip
in interface AEMonitorInterface
chip
- the chippublic AEChip getChip()
AEMonitorInterface
getChip
in interface AEMonitorInterface
public void resetUSB()
public void cyclePort() throws HardwareInterfaceException
HardwareInterfaceException
|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |