|
Data Structures |
struct | USBDevice |
| USBDevice. More...
|
struct | USBSetupPacket |
| Standard USB Setup packet components, see the USB Specification 1.1. More...
|
Defines |
#define | IX_USB_MBLK |
| Memory buffer.
|
#define | IX_USB_MBLK_DATA(buf) |
| Return pointer to the data in the mbuf.
|
#define | IX_USB_MBLK_LEN(buf) |
| Return pointer to the data length.
|
#define | IX_USB_MBLK_FREE(buf) |
| Returns a buffer to the buffer pool.
|
#define | IX_USB_MBLK_PKT_LEN(buf) |
| Return pointer to the total length of all the data in the mbuf chain for this packet.
|
#define | IX_USB_HAS_GET_ERROR_STRING |
| define to enable ixUSBErrorStringGet()
|
#define | IX_USB_HAS_ENDPOINT_INFO_SHOW |
| define to enable ixUSBEndpointInfoShow()
|
#define | IX_USB_HAS_STATISTICS_SHOW |
| define to enable ixUSBStatisticsShow()
|
#define | IX_USB_STATS_SHOW_PER_ENDPOINT_INFO |
| define to enable per-endpoint information in ixUSBStatisticsShow()
|
#define | IX_USB_HAS_VERBOSE_WARN_TRACE_MACRO |
| define to enable verbose warning tracing
|
#define | IX_USB_HAS_CRITICAL_DATA_LOCKS |
| define to enable critical data sections locking
|
#define | IX_USB_HAS_ASSERT_MACRO |
| define to enable assertion macro
|
#define | IX_USB_HAS_CT_ASSERT_MACRO |
| define to enable compile-time assertion macro
|
#define | IX_USB_HAS_INT_BIND_MACRO |
| define to enable interrupt handler binding for VxWorks
|
#define | logMsg |
#define | UDC_REGISTERS_BASE |
| Base I/O address.
|
#define | UDC_IRQ |
| IRQ.
|
#define | NUM_ENDPOINTS |
| Number of endpoints.
|
#define | SETUP_PACKET_SIZE |
| SETUP packet size.
|
#define | CONTROL_FIFO_SIZE |
| CONTROL endpoint FIFO depth.
|
#define | CONTROL_PACKET_SIZE |
| CONTROL endpoint packet size.
|
#define | INTERRUPT_FIFO_SIZE |
| INTERRUPT endpoint FIFO depth.
|
#define | INTERRUPT_PACKET_SIZE |
| INTERRUPT endpoint packet size.
|
#define | BULK_FIFO_SIZE |
| BULK endpoint FIFO depth.
|
#define | BULK_PACKET_SIZE |
| BULK endpoint packet size.
|
#define | ISOCHRONOUS_FIFO_SIZE |
| ISOCHRONOUS endpoint FIFO depth.
|
#define | ISOCHRONOUS_PACKET_SIZE |
| ISOCHRONOUS endpoint packet size.
|
#define | MAX_TRANSFER_SIZE |
| Maximum data size for one transaction in bytes (bulk or control).
|
#define | MAX_QUEUE_SIZE |
| Maximum outgoing queue size per endpoint, in elements Uses MAX_QUEUE_SIZE * (sizeof(void *)) bytes.
|
#define | MEM_POOL_SIZE |
| Memory pool for data transactions.
|
#define | TRANSACTION_TIMEOUT_RX |
| Maximum acceptable delay in transactions (timestamp ticks), Rx, 0 disables.
|
#define | TRANSACTION_TIMEOUT_TX |
| Maximum acceptable delay in transactions (timestamp ticks), Tx, 0 disables.
|
#define | IX_USB_ERROR_BASE |
| USB error base.
|
#define | IX_USB_ERROR |
| error due to unknown reasons
|
#define | IX_USB_INVALID_DEVICE |
| invalid USBDevice structure passed as parameter or no device present
|
#define | IX_USB_NO_PERMISSION |
| no permission for attempted operation
|
#define | IX_USB_REDUNDANT |
| redundant operation
|
#define | IX_USB_SEND_QUEUE_FULL |
| send queue full
|
#define | IX_USB_NO_ENDPOINT |
| invalid endpoint
|
#define | IX_USB_NO_IN_CAPABILITY |
| no IN capability on endpoint
|
#define | IX_USB_NO_OUT_CAPABILITY |
| no OUT capability on endpoint
|
#define | IX_USB_NO_TRANSFER_CAPABILITY |
| transfer type incompatible with endpoint
|
#define | IX_USB_ENDPOINT_STALLED |
| endpoint stalled
|
#define | IX_USB_INVALID_PARMS |
| invalid parameter(s)
|
#define | IX_USB_DEVICE_DISABLED |
| device is disabled
|
#define | IX_USB_NO_STALL_CAPABILITY |
| no STALL capability
|
#define | EP_DIRECTION(x) |
| Macro used to extract the endpoint direction from an EPDescriptorTable[] entry.
|
#define | EP_TYPE(x) |
| Macro used to extract the endpoint type from an EPDescriptorTable[] entry.
|
#define | MIN(a, b) |
| Compares two values and returns the minimum.
|
#define | MAX(a, b) |
| Compares two values and returns the maximum.
|
#define | QUEUE_WRAP(tail) |
| Ajusts the tail of a queue implemented in a circular buffer by wrapping at the buffer boundary.
|
#define | SWAP_USB_WORD(wPtr) |
| USB byte swapping routine for a little endian platform.
|
#define | REG_GET(reg_ptr) |
| read generic register access via register pointers
|
#define | REG_SET(reg_ptr, val) |
| write generic register access via register pointers
|
#define | DREG_GET(reg_ptr) |
| generic data register read access via register pointers
|
#define | DREG_SET(reg_ptr, val) |
| generic data register write access via register pointers
|
#define | CONTEXT(device) |
| get context from device pointer
|
#define | REGISTERS(device) |
| get registers from device pointer
|
#define | EP0CONTROL(device) |
| get endpoint 0 control data from device pointer
|
#define | EVENTS(device) |
| get event processor from device pointer
|
#define | COUNTERS(device) |
| get device counters
|
#define | OPERATION(device) |
| get device operation
|
#define | EPSTATUS(device, endpointNumber) |
| get endpoint status from device pointer and endpoint number
|
#define | EPQUEUE(device, endpointNumber) |
| get endpoint queue from device pointer and endpoint number
|
#define | EPCOUNTERS(device, endpointNumber) |
| get endpoint counters from device pointer and endpoint number
|
#define | RETURN_OK(device) |
| set IX_SUCCESS on device and return IX_SUCCESS
|
#define | RETURN_ERROR(device) |
| set IX_USB_ERROR on device and return IX_FAIL
|
#define | RETURN_INVALID_PARMS(device) |
| set IX_USB_INVALID_PARAMS on device and return IX_FAIL
|
#define | RETURN_REDUNDANT(device) |
| set IX_USB_REDUNDANT on device and return IX_FAIL
|
#define | RETURN_INVALID_DEVICE(device) |
| set IX_USB_INVALID_PARAMS on device and return IX_FAIL
|
#define | RETURN_NO_ENDPOINT(device) |
| set IX_USB_INVALID_PARAMS on device and return IX_FAIL
|
#define | RETURN_ENDPOINT_STALLED(device) |
| set IX_USB_ENDPOINT_STALLED on device and return IX_FAIL
|
#define | RETURN_SEND_QUEUE_FULL(device) |
| set IX_USB_SEND_QUEUE_FULL on device and return IX_FAIL
|
#define | RETURN_NO_IN_CAPABILITY(device) |
| set IX_USB_NO_IN_CAPABILITY on device and return IX_FAIL
|
#define | RETURN_NO_STALL_CAPABILITY(device) |
| set IX_USB_NO_STALL_CAPABILITY on device and return IX_FAIL
|
#define | RETURN_NO_PERMISSION(device) |
| set IX_USB_NO_PERMISSION on device and return IX_FAIL
|
#define | CHECK_DEVICE(device) |
| sanity checks for device existence
|
#define | CHECK_DEVICE_ENABLED(device) |
| sanity checks for device enable status
|
#define | CHECK_ENDPOINT(device, endpointNumber) |
| sanity check for endpoint existence
|
#define | CHECK_ENDPOINT_STALL(device, endpointNumber) |
| sanity check for endpoint stall
|
#define | CHECK_EVENT_MASK(device, eventMask) |
| sanity check for event masks
|
#define | CHECK_ENDPOINT_QUEUE(epData) |
| sanity check for endpoint queue size
|
#define | CHECK_ENDPOINT_IN_CAPABILITY(epData, device) |
| sanity check for endpoint IN capability
|
#define | IX_USB_TRACE |
| no trace macro
|
#define | IX_USB_LOCK |
| dummy critial data section lock
|
#define | IX_USB_UNLOCK(state) |
| dummy critial data section unlock
|
#define | IX_USB_IRQ_LOCK |
| dummy irq lock
|
#define | IX_USB_IRQ_UNLOCK(state) |
| dummy irq unlock
|
#define | USB_CONTEXT_SIZE |
| USB context size.
|
Typedefs |
typedef UINT16 | USBEventSet |
typedef void(* | USBEventCallback )(USBDevice *device, USBEventSet events) |
typedef void(* | USBSetupCallback )(USBDevice *device, const char *packet) |
typedef void(* | USBReceiveCallback )(USBDevice *device, UINT16 sourceEndpoint, IX_USB_MBLK *receiveBuffer) |
Enumerations |
enum | USBEndpointDirection {
USB_NO_DATA,
USB_IN,
USB_OUT,
USB_IN_OUT
} |
| USB endpoint direction. More...
|
enum | USBEndpointType {
USB_CONTROL,
USB_BULK,
USB_INTERRUPT,
USB_ISOCHRONOUS
} |
| Note: the values are set for compatibility with USBEndpointDirection. More...
|
enum | USBEventMap {
USB_NO_EVENT,
USB_RESET,
USB_SUSPEND,
USB_RESUME,
USB_SOF,
USB_DEVICE_EVENTS,
USB_BUS_EVENTS,
USB_ALL_EVENTS
} |
| USB Event Map. More...
|
enum | USBDeviceFlags {
ENABLE_RX_SEQ,
ENABLE_TX_SEQ
} |
| USB Device Flags. More...
|
enum | USBEndpointNumber {
ENDPOINT_0,
ENDPOINT_1,
ENDPOINT_2,
ENDPOINT_3,
ENDPOINT_4,
ENDPOINT_5,
ENDPOINT_6,
ENDPOINT_7,
ENDPOINT_8,
ENDPOINT_9,
ENDPOINT_10,
ENDPOINT_11,
ENDPOINT_12,
ENDPOINT_13,
ENDPOINT_14,
ENDPOINT_15
} |
| USB endpoint number. More...
|
enum | USBStdRequestType {
GET_STATUS_REQUEST,
CLEAR_FEATURE_REQUEST,
SET_FEATURE_REQUEST,
SET_ADDRESS_REQUEST,
GET_DESCRIPTOR_REQUEST,
SET_DESCRIPTOR_REQUEST,
GET_CONFIGURATION_REQUEST,
SET_CONFIGURATION_REQUEST,
GET_INTERFACE_REQUEST,
SET_INTERFACE_REQUEST,
SYNCH_FRAME_REQUEST
} |
| Standard USB request types. More...
|
enum | USBStdDescriptorType {
USB_DEVICE_DESCRIPTOR,
USB_CONFIGURATION_DESCRIPTOR,
USB_STRING_DESCRIPTOR,
USB_INTERFACE_DESCRIPTOR,
USB_ENDPOINT_DESCRIPTOR
} |
| Standard USB descriptor types. More...
|
enum | USBStdFeatureSelector {
ENDPOINT_STALL,
DEVICE_REMOTE_WAKEUP
} |
| Standard USB SET/CLEAR_FEATURE feature selector. More...
|
enum | USBStdLanguageId { USB_ENGLISH_LANGUAGE
} |
| Standard language IDs used by USB. More...
|
enum | USBStdEndpointType {
USB_CONTROL_ENDPOINT,
USB_ISOCHRONOUS_ENDPOINT,
USB_BULK_ENDPOINT,
USB_INTERRUPT_ENDPOINT
} |
| Standard USB endpoint types. More...
|
enum | USBStdEndpointDirection {
USB_ENDPOINT_OUT,
USB_ENDPOINT_IN
} |
| Standard USB directions. More...
|
Functions |
PUBLIC IX_STATUS | ixUSBDriverInit (USBDevice *device) |
| Initialize driver and USB Device Controller.
|
PUBLIC IX_STATUS | ixUSBDeviceEnable (USBDevice *device, BOOL enableDevice) |
| Enable or disable the device.
|
PUBLIC IX_STATUS | ixUSBEndpointStall (USBDevice *device, UINT16 endpointNumber, BOOL stallFlag) |
| Enable or disable endpoint stall (or halt feature).
|
PUBLIC IX_STATUS | ixUSBEndpointClear (USBDevice *device, UINT16 endpointNumber) |
| Free all Rx/Tx buffers associated with an endpoint.
|
PUBLIC IX_STATUS | ixUSBSignalResume (USBDevice *device) |
| Trigger signal resuming on the bus.
|
PUBLIC IX_STATUS | ixUSBFrameCounterGet (USBDevice *device, UINT16 *counter) |
| Retrieve the 11-bit frame counter.
|
PUBLIC IX_STATUS | ixUSBReceiveCallbackRegister (USBDevice *device, USBReceiveCallback callbackFunction) |
| Register a data receive callback.
|
PUBLIC IX_STATUS | ixUSBSetupCallbackRegister (USBDevice *device, USBSetupCallback callbackFunction) |
| Register a setup receive callback.
|
PUBLIC IX_STATUS | ixUSBBufferSubmit (USBDevice *device, UINT16 destinationEndpoint, IX_USB_MBLK *sendBuffer) |
| Submit a buffer for transmit.
|
PUBLIC IX_STATUS | ixUSBBufferCancel (USBDevice *device, UINT16 destinationEndpoint, IX_USB_MBLK *sendBuffer) |
| Cancel a buffer previously submitted for transmitting.
|
PUBLIC IX_STATUS | ixUSBEventCallbackRegister (USBDevice *device, USBEventCallback eventCallback, USBEventMap eventMap) |
| Register an event callback.
|
PUBLIC IX_STATUS | ixUSBIsEndpointStalled (USBDevice *device, UINT16 endpointNumber, BOOL *stallState) |
| Retrieve an endpoint's stall status.
|
PUBLIC IX_STATUS | ixUSBStatisticsShow (USBDevice *device) |
| Display device state and statistics.
|
PUBLIC const char * | ixUSBErrorStringGet (UINT32 errorCode) |
| Convert an error code into a human-readable string error message.
|
PUBLIC IX_STATUS | ixUSBEndpointInfoShow (USBDevice *device) |
| Display endpoint information table.
|
int | logMsg (char *fmt,...) |