|
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
net.sf.jaer.hardwareinterface.usb.cypressfx2.CypressFX2MonitorSequencer
public class CypressFX2MonitorSequencer
Extends CypressFX2 to add functionality for sequencing and monitoring events.
Nested Class Summary | |
---|---|
class |
CypressFX2MonitorSequencer.AEWriter
AEWriter class, used to send events to the device |
class |
CypressFX2MonitorSequencer.MonSeqAEReader
This reader understands the format of raw USB data and translates to the AEPacketRaw |
Nested classes/interfaces inherited from class net.sf.jaer.hardwareinterface.usb.cypressfx2.CypressFX2 |
---|
CypressFX2.AEPacketRawPool, CypressFX2.AEReader, CypressFX2.AsyncStatusThread |
Field Summary | |
---|---|
protected CypressFX2MonitorSequencer.AEWriter |
aeWriter
|
static java.lang.String |
CPLD_FIRMWARE_MONSEQ
|
protected static java.util.logging.Logger |
log
|
static byte |
VR_DISABLE_AE
|
static byte |
VR_DISABLE_AE_OUT
|
static byte |
VR_ENABLE_AE
|
static byte |
VR_ENABLE_AE_OUT
|
static byte |
VR_ENABLE_MISSED_EVENTS
|
static byte |
VR_IS_TIMESTAMP_MASTER
|
static byte |
VR_MISSED_EVENTS
|
static byte |
VR_OPERATION_MODE
|
Fields inherited from interface net.sf.jaer.hardwareinterface.usb.USBInterface |
---|
PID_THESYCON_END, PID_THESYCON_START, VID_THESYCON |
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 |
Constructor Summary | |
---|---|
protected |
CypressFX2MonitorSequencer(int devNumber)
Creates a new instance of CypressFX2MonitorSequencer. |
Method Summary | |
---|---|
void |
close()
Closes the device. |
void |
disableEventSequencing()
disables event sequencing: stops AEWriter thread and sends vendor request to device |
void |
enableMissedEvents(boolean yes)
This method lets you configure how the USBAERmini2 handles events when the host computer is not fast enough to collect them. |
java.util.Collection<AEMapper> |
getAEMappers()
|
int |
getEstimatedOutEventRate()
returns the estimated out event rate |
int |
getNumEventsSent()
not yet implemented |
int |
getNumEventsToSend()
not yet implemented |
long |
getNumMissedEvents()
returns an estimation of the number of events that were missed due to full fifos |
float |
getOperationMode()
gets the timestamp mode from the device, prints out if slave or master mode and returns the tick |
float |
getTick()
returns a string containing the class name and the serial number (if the device has been opened) |
java.lang.String |
getTypeName()
get text name of interface, e.g. |
boolean |
isEventSequencingEnabled()
|
boolean |
isLoopedSequencingEnabled()
|
boolean |
isOutEndpointEnabled()
|
boolean |
isTimestampMaster()
is this device acting as timestamp master |
void |
offerPacketToSequencer(AEPacketRaw packet)
Pushes a packet to be sequenced to the sequencer output. |
void |
open()
Constructs a new USB connection and opens it. |
void |
resetTimestamps()
reset the timestamps to zero. |
void |
setLoopedSequencingEnabled(boolean set)
enables continuous sequencing, if enabled the AEWriter rewinds if it reaches the end of the packet and restarts sending from the beginning. |
void |
setOperationMode(int mode)
set the timestamp tick on the device |
void |
startAEReader()
Starts reader buffer pool thread and enables in endpoints for AEs. |
protected void |
startAEWriter(AEPacketRaw eventsToSend)
starts AEWriter Thread |
void |
startDevice()
sends vendor request to device to enable sequencing and monitoring, used if startMonitoringSequencing(AEPacketRaw eventsToSend, boolean startDevice) is called
with startDevice equal to false |
void |
startMonitoringSequencing(AEPacketRaw eventsToSend)
starts sequencing and monitoring of events, starts AEReader and AEWriter and sends vendor request to device |
void |
startMonitoringSequencing(AEPacketRaw eventsToSend,
boolean startDevice)
starts sequencing and monitoring of events, starts AEReader and AEWriter |
void |
startSequencing(AEPacketRaw eventsToSend)
starts sequencing of events, starts AEWriter. |
protected void |
stopAEWriter()
stops AEWriter thread and deletes the aeWriter instance |
AEPacketRaw |
stopMonitoringSequencing()
stops monitoring and sequencing of events, gets and returns the last events from the driver |
void |
stopSequencing()
stops sequencing of events from the driver |
void |
updateFirmware()
Updates the firmware by downloading to the board's EEPROM |
void |
writeMonitorSequencerFirmware()
writes USBAERmini2 firmware to EEPROM can for example be used from matlab |
void |
writeMonitorSequencerJTAGFirmware()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.jaer.aemonitor.AEMonitorInterface |
---|
acquireAvailableEventsFromDriver, addAEListener, getAEBufferSize, getChip, getEstimatedEventRate, getEvents, getMaxCapacity, getNumEventsAcquired, getTimestampTickUs, isEventAcquisitionEnabled, overrunOccurred, removeAEListener, setAEBufferSize, setChip, setEventAcquisitionEnabled |
Methods inherited from interface net.sf.jaer.aesequencer.AESequencerInterface |
---|
getMaxCapacity, getTimestampTickUs |
Methods inherited from interface net.sf.jaer.hardwareinterface.usb.USBInterface |
---|
getDID, getPID, getStringDescriptors, getVID, getVIDPID |
Methods inherited from interface net.sf.jaer.hardwareinterface.HardwareInterface |
---|
isOpen |
Field Detail |
---|
protected static java.util.logging.Logger log
public static final byte VR_ENABLE_AE_OUT
public static final byte VR_DISABLE_AE_OUT
public static final byte VR_OPERATION_MODE
public static final byte VR_ENABLE_AE
public static final byte VR_DISABLE_AE
public static final byte VR_IS_TIMESTAMP_MASTER
public static final byte VR_MISSED_EVENTS
public static final byte VR_ENABLE_MISSED_EVENTS
public static final java.lang.String CPLD_FIRMWARE_MONSEQ
protected CypressFX2MonitorSequencer.AEWriter aeWriter
Constructor Detail |
---|
protected CypressFX2MonitorSequencer(int devNumber)
devNumber
- the desired device number, in range returned by CypressFX2MonitorSequencerFactory.getNumInterfacesAvailableMethod Detail |
---|
public java.lang.String getTypeName()
HardwareInterface
getTypeName
in interface HardwareInterface
getTypeName
in class CypressFX2
public void close()
close
in interface HardwareInterface
close
in class CypressFX2
public void open() throws HardwareInterfaceException
CypressFX2
open
in interface HardwareInterface
open
in class CypressFX2
HardwareInterfaceException
- if there is an error opening deviceCypressFX2.setEventAcquisitionEnabled(boolean)
,
CypressFX2.openUsbIo_minimal()
public boolean isOutEndpointEnabled()
public float getTick()
public void disableEventSequencing() throws HardwareInterfaceException
HardwareInterfaceException
public int getEstimatedOutEventRate()
getEstimatedOutEventRate
in interface AESequencerInterface
public int getNumEventsSent()
getNumEventsSent
in interface AESequencerInterface
public int getNumEventsToSend()
getNumEventsToSend
in interface AESequencerInterface
public boolean isEventSequencingEnabled()
isEventSequencingEnabled
in interface AESequencerInterface
public void startMonitoringSequencing(AEPacketRaw eventsToSend) throws HardwareInterfaceException
startMonitoringSequencing
in interface AEMonitorSequencerInterface
eventsToSend
- the events that should be sequenced, timestamps are realtive to last event,
inter spike interval must not be bigger than 2^16
HardwareInterfaceException
public void startMonitoringSequencing(AEPacketRaw eventsToSend, boolean startDevice) throws HardwareInterfaceException
eventsToSend
- the events that should be sequenced, timestamps are realtive to last event,
inter spike interval must not be bigger than 2^16startDevice
- whether a vendor request should be sent to the device. usually this is set
to true or startMonitoringSequencing(AEPacketRaw eventsToSend)
is used, set to false only if multiple devices
should start synchronously, then it is better to start all AEReaders before sending the vendor requests.
HardwareInterfaceException
public void startDevice() throws HardwareInterfaceException
startMonitoringSequencing(AEPacketRaw eventsToSend, boolean startDevice)
is called
with startDevice equal to false
HardwareInterfaceException
protected void startAEWriter(AEPacketRaw eventsToSend) throws HardwareInterfaceException
HardwareInterfaceException
protected void stopAEWriter()
public AEPacketRaw stopMonitoringSequencing() throws HardwareInterfaceException
stopMonitoringSequencing
in interface AEMonitorSequencerInterface
HardwareInterfaceException
public void resetTimestamps()
CypressFX2
resetTimestamps
in interface AEMonitorInterface
resetTimestamps
in interface AESequencerInterface
resetTimestamps
in class CypressFX2
public void setOperationMode(int mode) throws HardwareInterfaceException
mode
- 0: Trigger: Host, Tick 1us;
1: Trigger: Host, Tick 33.3ns;
2: Trigger: Slave, Tick 1us;
3: Trigger: Slave, Tick 33.3ns;
HardwareInterfaceException
public void enableMissedEvents(boolean yes) throws HardwareInterfaceException
getNumMissedEvents()
will return an estimate of
the number of events discarded.
yes
- wheter missed events counting should be enabled to unblock chain
HardwareInterfaceException
public float getOperationMode() throws HardwareInterfaceException
HardwareInterfaceException
public boolean isTimestampMaster() throws HardwareInterfaceException
HardwareInterfaceException
public long getNumMissedEvents() throws HardwareInterfaceException
HardwareInterfaceException
public void setLoopedSequencingEnabled(boolean set)
setLoopedSequencingEnabled
in interface AESequencerInterface
set
- true to loop packet, false to sequence a single packetpublic boolean isLoopedSequencingEnabled()
isLoopedSequencingEnabled
in interface AESequencerInterface
public void writeMonitorSequencerFirmware()
public void updateFirmware() throws HardwareInterfaceException
updateFirmware
in interface HasUpdatableFirmware
HardwareInterfaceException
- if there is any error, including lack of support
or missing firmware file. The exception should detail the error as much as possible.public void writeMonitorSequencerJTAGFirmware()
public void offerPacketToSequencer(AEPacketRaw packet)
offerPacketToSequencer
in interface AESequencerInterface
packet
- the packet to add to the tail of the queue.public java.util.Collection<AEMapper> getAEMappers()
getAEMappers
in interface AESoftMapper
public void startAEReader() throws HardwareInterfaceException
startAEReader
in class CypressFX2
HardwareInterfaceException
public void startSequencing(AEPacketRaw eventsToSend) throws HardwareInterfaceException
AESequencerInterface
startSequencing
in interface AESequencerInterface
eventsToSend
- the events that should be sequenced, timestamps are realtive to last event,
inter spike interval must not be bigger than 2^16-1
HardwareInterfaceException
public void stopSequencing() throws HardwareInterfaceException
AESequencerInterface
stopSequencing
in interface AESequencerInterface
HardwareInterfaceException
|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |