jAER project on SourceForge

net.sf.jaer.hardwareinterface.usb.cypressfx2
Class CypressFX2Factory

java.lang.Object
  extended by net.sf.jaer.hardwareinterface.usb.cypressfx2.CypressFX2Factory
All Implemented Interfaces:
de.thesycon.usbio.PnPNotifyInterface, de.thesycon.usbio.UsbIoErrorCodes, HardwareInterfaceFactoryInterface

public class CypressFX2Factory
extends java.lang.Object
implements de.thesycon.usbio.UsbIoErrorCodes, de.thesycon.usbio.PnPNotifyInterface, HardwareInterfaceFactoryInterface

Manufactures CypressFX2-based objects. This class is used in HardwareInterfaceFactory or it can be directly accessed.

Author:
tobi/raphael
See Also:
HardwareInterfaceFactory

Field Summary
static java.lang.String GUID
          driver guid (Globally unique ID, for this USB driver instance
 
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
 
Method Summary
 USBInterface getFirstAvailableInterface()
          returns the first interface in the list
 int getGDevList()
          Handle used to refer to UsbIo's internal list of devices, built here on construction and for each add and remove
 USBInterface getInterface(int n)
          returns the n-th interface in the list, either Tmpdiff128Retina, USBAERmini2 or USB2AERmapper, DVS320, or MonitorSequencer depending on PID,
 int getNumInterfacesAvailable()
          Returns the number of available interfaces, i.e., the number of available hardware devices.
static HardwareInterfaceFactoryInterface instance()
           
 void listDevices()
          display all available CypressFX2 devices controlled by USBIO driver
 void onAdd()
           
 void onRemove()
           
 void setGDevList(int gDevList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GUID

public static final java.lang.String GUID
driver guid (Globally unique ID, for this USB driver instance

See Also:
Constant Field Values
Method Detail

instance

public static HardwareInterfaceFactoryInterface instance()
Returns:
singleton instance

onAdd

public void onAdd()
Specified by:
onAdd in interface de.thesycon.usbio.PnPNotifyInterface

onRemove

public void onRemove()
Specified by:
onRemove in interface de.thesycon.usbio.PnPNotifyInterface

getFirstAvailableInterface

public USBInterface getFirstAvailableInterface()
returns the first interface in the list

Specified by:
getFirstAvailableInterface in interface HardwareInterfaceFactoryInterface
Returns:
refernence to the first interface in the list

getInterface

public USBInterface getInterface(int n)
returns the n-th interface in the list, either Tmpdiff128Retina, USBAERmini2 or USB2AERmapper, DVS320, or MonitorSequencer depending on PID,

For unknown or blank device PID a bare CypressFX2 is returned which should be discarded after it is used to download to the device RAM some preferred default firmware. A new CypressFX2 should then be manufactured that will be correctly constructed here.

This method hardcodes the mapping from VID/PID and the HardwareInterface object that is contructed for it.

Specified by:
getInterface in interface HardwareInterfaceFactoryInterface
Parameters:
n - the number to instance (0 based)
Returns:
the HardwareInterface

getNumInterfacesAvailable

public int getNumInterfacesAvailable()
Description copied from interface: HardwareInterfaceFactoryInterface
Returns the number of available interfaces, i.e., the number of available hardware devices. If the driver only supports one interface, then 1 will always be returned.

Specified by:
getNumInterfacesAvailable in interface HardwareInterfaceFactoryInterface
Returns:
the number of compatible monitor/sequencer attached to the driver

listDevices

public void listDevices()
display all available CypressFX2 devices controlled by USBIO driver


getGDevList

public int getGDevList()
Handle used to refer to UsbIo's internal list of devices, built here on construction and for each add and remove

Returns:
the the handle

setGDevList

public void setGDevList(int gDevList)

jAER project on SourceForge