47 #ifndef MAX_USB_DEVICES 48 #define MAX_USB_DEVICES 5 57 #define USBLIB_NUM_EP 8 // Number of supported endpoints. 88 #if defined(__TI_ARM__) || \ 90 defined(__GNUC__) || \ 91 defined(__CC_ARM) || \ 92 defined(__ARMCC_VERSION) || \ 94 #define PACKED __attribute__ ((packed)) 95 #elif defined(__ICCARM__) 98 #error Unrecognized COMPILER! 106 #define USB_LANG_CHINESE_PRC 0x0804 // Chinese (PRC) 107 #define USB_LANG_CHINESE_TAIWAN 0x0404 // Chinese (Taiwan) 108 #define USB_LANG_EN_US 0x0409 // English (United States) 109 #define USB_LANG_EN_UK 0x0809 // English (United Kingdom) 110 #define USB_LANG_EN_AUS 0x0C09 // English (Australia) 111 #define USB_LANG_EN_CA 0x1009 // English (Canada) 112 #define USB_LANG_EN_NZ 0x1409 // English (New Zealand) 113 #define USB_LANG_FRENCH 0x040C // French (Standard) 114 #define USB_LANG_GERMAN 0x0407 // German (Standard) 115 #define USB_LANG_HINDI 0x0439 // Hindi 116 #define USB_LANG_ITALIAN 0x0410 // Italian (Standard) 117 #define USB_LANG_JAPANESE 0x0411 // Japanese 118 #define USB_LANG_KOREAN 0x0412 // Korean 119 #define USB_LANG_ES_TRAD 0x040A // Spanish (Traditional) 120 #define USB_LANG_ES_MODERN 0x0C0A // Spanish (Modern) 121 #define USB_LANG_SWAHILI 0x0441 // Swahili (Kenya) 122 #define USB_LANG_URDU_IN 0x0820 // Urdu (India) 123 #define USB_LANG_URDU_PK 0x0420 // Urdu (Pakistan) 211 #define USB_RTYPE_DIR_IN 0x80 212 #define USB_RTYPE_DIR_OUT 0x00 214 #define USB_RTYPE_TYPE_M 0x60 215 #define USB_RTYPE_VENDOR 0x40 216 #define USB_RTYPE_CLASS 0x20 217 #define USB_RTYPE_STANDARD 0x00 219 #define USB_RTYPE_RECIPIENT_M 0x1f 220 #define USB_RTYPE_OTHER 0x03 221 #define USB_RTYPE_ENDPOINT 0x02 222 #define USB_RTYPE_INTERFACE 0x01 223 #define USB_RTYPE_DEVICE 0x00 230 #define USBREQ_GET_STATUS 0x00 231 #define USBREQ_CLEAR_FEATURE 0x01 232 #define USBREQ_SET_FEATURE 0x03 233 #define USBREQ_SET_ADDRESS 0x05 234 #define USBREQ_GET_DESCRIPTOR 0x06 235 #define USBREQ_SET_DESCRIPTOR 0x07 236 #define USBREQ_GET_CONFIG 0x08 237 #define USBREQ_SET_CONFIG 0x09 238 #define USBREQ_GET_INTERFACE 0x0a 239 #define USBREQ_SET_INTERFACE 0x0b 240 #define USBREQ_SYNC_FRAME 0x0c 247 #define USB_STATUS_SELF_PWR 0x0001 // Currently self powered. 248 #define USB_STATUS_BUS_PWR 0x0000 // Currently bus-powered. 249 #define USB_STATUS_PWR_M 0x0001 // Mask for power mode. 250 #define USB_STATUS_REMOTE_WAKE 0x0002 // Remote wake-up is currently enabled. 258 #define USB_FEATURE_EP_HALT 0x0000 // Endpoint halt feature. 259 #define USB_FEATURE_REMOTE_WAKE 0x0001 // Remote wake feature, device only. 260 #define USB_FEATURE_TEST_MODE 0x0002 // Test mode 268 #define USB_REQ_EP_NUM_M 0x007F 269 #define USB_REQ_EP_DIR_M 0x0080 270 #define USB_REQ_EP_DIR_IN 0x0080 271 #define USB_REQ_EP_DIR_OUT 0x0000 280 #define USB_DTYPE_DEVICE 1 281 #define USB_DTYPE_CONFIGURATION 2 282 #define USB_DTYPE_STRING 3 283 #define USB_DTYPE_INTERFACE 4 284 #define USB_DTYPE_ENDPOINT 5 285 #define USB_DTYPE_DEVICE_QUAL 6 286 #define USB_DTYPE_OSPEED_CONF 7 287 #define USB_DTYPE_INTERFACE_PWR 8 288 #define USB_DTYPE_OTG 9 289 #define USB_DTYPE_INTERFACE_ASC 11 290 #define USB_DTYPE_CS_INTERFACE 36 291 #define USB_DTYPE_HUB 41 319 uint8_t bDescriptorType;
341 uint8_t bDescriptorType;
419 #define USB_CLASS_DEVICE 0x00 420 #define USB_CLASS_AUDIO 0x01 421 #define USB_CLASS_CDC 0x02 422 #define USB_CLASS_HID 0x03 423 #define USB_CLASS_PHYSICAL 0x05 424 #define USB_CLASS_IMAGE 0x06 425 #define USB_CLASS_PRINTER 0x07 426 #define USB_CLASS_MASS_STORAGE 0x08 427 #define USB_CLASS_HUB 0x09 428 #define USB_CLASS_CDC_DATA 0x0a 429 #define USB_CLASS_SMART_CARD 0x0b 430 #define USB_CLASS_SECURITY 0x0d 431 #define USB_CLASS_VIDEO 0x0e 432 #define USB_CLASS_HEALTHCARE 0x0f 433 #define USB_CLASS_DIAG_DEVICE 0xdc 434 #define USB_CLASS_WIRELESS 0xe0 435 #define USB_CLASS_MISC 0xef 436 #define USB_CLASS_APP_SPECIFIC 0xfe 437 #define USB_CLASS_VEND_SPECIFIC 0xff 438 #define USB_CLASS_EVENTS 0xffffffff 445 #define USB_SUBCLASS_UNDEFINED 0x00 446 #define USB_PROTOCOL_UNDEFINED 0x00 453 #define USB_MISC_SUBCLASS_SYNC 0x01 454 #define USB_MISC_SUBCLASS_COMMON \ 462 #define USB_MISC_PROTOCOL_IAD 0x01 469 #define USB_HUB_PROTOCOL_FS 0x00 470 #define USB_HUB_PROTOCOL_SINGLE 0x01 471 #define USB_HUB_PROTOCOL_MULTI 0x02 491 uint8_t bDescriptorType;
502 uint8_t bDeviceClass;
508 uint8_t bDeviceSubClass;
514 uint8_t bDeviceProtocol;
520 uint8_t bMaxPacketSize0;
525 uint8_t bNumConfigurations;
532 PACKED tDeviceQualifierDescriptor;
553 uint8_t bDescriptorType;
600 #define USB_CONF_ATTR_PWR_M 0xC0 602 #define USB_CONF_ATTR_SELF_PWR 0xC0 603 #define USB_CONF_ATTR_BUS_PWR 0x80 604 #define USB_CONF_ATTR_RWAKE 0xA0 624 uint8_t bDescriptorType;
664 PACKED tInterfaceDescriptor;
684 uint8_t bDescriptorType;
698 uint8_t bmAttributes;
714 PACKED tEndpointDescriptor;
722 #define USB_EP_DESC_OUT 0x00 723 #define USB_EP_DESC_IN 0x80 724 #define USB_EP_DESC_NUM_M 0x0f 732 #define USB_EP_MAX_PACKET_COUNT_M \ 740 #define USB_EP_ATTR_CONTROL 0x00 741 #define USB_EP_ATTR_ISOC 0x01 742 #define USB_EP_ATTR_BULK 0x02 743 #define USB_EP_ATTR_INT 0x03 744 #define USB_EP_ATTR_TYPE_M 0x03 746 #define USB_EP_ATTR_ISOC_M 0x0c 747 #define USB_EP_ATTR_ISOC_NOSYNC 0x00 748 #define USB_EP_ATTR_ISOC_ASYNC 0x04 749 #define USB_EP_ATTR_ISOC_ADAPT 0x08 750 #define USB_EP_ATTR_ISOC_SYNC 0x0c 751 #define USB_EP_ATTR_USAGE_M 0x30 752 #define USB_EP_ATTR_USAGE_DATA 0x00 753 #define USB_EP_ATTR_USAGE_FEEDBACK \ 755 #define USB_EP_ATTR_USAGE_IMPFEEDBACK \ 778 uint8_t bDescriptorType;
788 PACKED tString0Descriptor;
809 uint8_t bDescriptorType;
834 #define USBShort(ui16Value) (ui16Value & 0xff), (ui16Value >> 8) 850 #define USB3Byte(ui32Value) (ui32Value & 0xff), \ 851 ((ui32Value >> 8) & 0xff), \ 852 ((ui32Value >> 16) & 0xff) 868 #define USBLong(ui32Value) (ui32Value & 0xff), \ 869 ((ui32Value >> 8) & 0xff), \ 870 ((ui32Value >> 16) & 0xff), \ 871 ((ui32Value >> 24) & 0xff) 887 #define NEXT_USB_DESCRIPTOR(ptr) \ 888 (tDescriptorHeader *)(((uint8_t *)(ptr)) + \ 919 typedef void (*
tStdRequest)(
void *pvInstance, tUSBRequest *pUSBRequest);
935 uint8_t ui8AlternateSetting);
958 void *pvRequestData);
1127 #define USB_DESC_ANY 0xFFFFFFFF 1129 extern uint32_t
USBDescGetNum(tDescriptorHeader *psDesc, uint32_t ui32Size,
1131 extern tDescriptorHeader *
USBDescGet(tDescriptorHeader *psDesc,
1132 uint32_t ui32Size, uint32_t ui32Type,
1133 uint32_t ui32Index);
1136 uint8_t ui8InterfaceNumber);
1139 uint32_t ui32AltCfg);
1140 extern tEndpointDescriptor *
1142 uint32_t ui32Index, uint32_t ui32Size);
1221 uint32_t ui32MsgParam,
void *pvMsgData);
1232 #define USBERR_HOST_IN_PID_ERROR \ 1238 #define USBERR_HOST_IN_NOT_COMP 0x00100000 1243 #define USBERR_HOST_IN_STALL 0x00400000 1248 #define USBERR_HOST_IN_DATA_ERROR \ 1255 #define USBERR_HOST_IN_NAK_TO 0x00080000 1260 #define USBERR_HOST_IN_ERROR 0x00040000 1265 #define USBERR_HOST_IN_FIFO_FULL \ 1271 #define USBERR_HOST_OUT_NAK_TO 0x00000080 1276 #define USBERR_HOST_OUT_NOT_COMP \ 1282 #define USBERR_HOST_OUT_STALL 0x00000020 1287 #define USBERR_HOST_OUT_ERROR 0x00000004 1293 #define USBERR_HOST_EP0_NAK_TO 0x00000080 1298 #define USBERR_HOST_EP0_ERROR 0x00000010 1303 #define USBERR_DEV_RX_DATA_ERROR \ 1310 #define USBERR_DEV_RX_OVERRUN 0x00040000 1315 #define USBERR_DEV_RX_FIFO_FULL 0x00020000 1365 #define USB_EVENT_BASE 0x0000 1366 #define USB_CLASS_EVENT_BASE 0x8000 1377 #define USBD_CDC_EVENT_BASE (USB_CLASS_EVENT_BASE + 0) 1378 #define USBD_HID_EVENT_BASE (USB_CLASS_EVENT_BASE + 0x1000) 1379 #define USBD_HID_KEYB_EVENT_BASE \ 1380 (USBD_HID_EVENT_BASE + 0x100) 1381 #define USBD_BULK_EVENT_BASE (USB_CLASS_EVENT_BASE + 0x2000) 1382 #define USBD_MSC_EVENT_BASE (USB_CLASS_EVENT_BASE + 0x3000) 1383 #define USBD_AUDIO_EVENT_BASE (USB_CLASS_EVENT_BASE + 0x4000) 1384 #define USBD_DFU_EVENT_BASE (USB_CLASS_EVENT_BASE + 0x5000) 1386 #define USBH_CDC_EVENT_BASE (USBD_CDC_EVENT_BASE + 0x800) 1387 #define USBH_HID_EVENT_BASE (USBD_HID_EVENT_BASE + 0x800) 1388 #define USBH_BULK_EVENT_BASE (USBD_BULK_EVENT_BASE + 0x800) 1389 #define USBH_MSC_EVENT_BASE (USBD_MSC_EVENT_BASE + 0x800) 1390 #define USBH_AUDIO_EVENT_BASE (USBD_AUDIO_EVENT_BASE + 0x800) 1402 #define USB_EVENT_CONNECTED (USB_EVENT_BASE + 0) 1412 #define USB_EVENT_DISCONNECTED (USB_EVENT_BASE + 1) 1422 #define USB_EVENT_RX_AVAILABLE (USB_EVENT_BASE + 2) 1432 #define USB_EVENT_DATA_REMAINING \ 1433 (USB_EVENT_BASE + 3) 1445 #define USB_EVENT_REQUEST_BUFFER \ 1446 (USB_EVENT_BASE + 4) 1454 #define USB_EVENT_TX_COMPLETE (USB_EVENT_BASE + 5) 1461 #define USB_EVENT_ERROR (USB_EVENT_BASE + 6) 1466 #define USB_EVENT_SUSPEND (USB_EVENT_BASE + 7) 1471 #define USB_EVENT_RESUME (USB_EVENT_BASE + 8) 1476 #define USB_EVENT_SCHEDULER (USB_EVENT_BASE + 9) 1480 #define USB_EVENT_STALL (USB_EVENT_BASE + 10) 1485 #define USB_EVENT_POWER_FAULT (USB_EVENT_BASE + 11) 1491 #define USB_EVENT_POWER_ENABLE (USB_EVENT_BASE + 12) 1497 #define USB_EVENT_POWER_DISABLE (USB_EVENT_BASE + 13) 1511 #define USB_EVENT_COMP_IFACE_CHANGE \ 1512 (USB_EVENT_BASE + 14) 1529 #define USB_EVENT_COMP_EP_CHANGE \ 1530 (USB_EVENT_BASE + 15) 1545 #define USB_EVENT_COMP_STR_CHANGE \ 1546 (USB_EVENT_BASE + 16) 1562 #define USB_EVENT_COMP_CONFIG (USB_EVENT_BASE + 17) 1572 #define USB_EVENT_UNKNOWN_CONNECTED \ 1573 (USB_EVENT_BASE + 18) 1579 #define USB_EVENT_SOF (USB_EVENT_BASE + 19) 1584 #define USB_EVENT_LPM_SLEEP (USB_EVENT_BASE + 20) 1589 #define USB_EVENT_LPM_RESUME (USB_EVENT_BASE + 21) 1595 #define USB_EVENT_LPM_ERROR (USB_EVENT_BASE + 22) 1600 #define USB_EVENT_CONFIG_CHANGE (USB_EVENT_BASE + 23) 1623 uint32_t ui32Length,
bool bLast);
1662 #define USBLIB_FEATURE_LPM 0x00000001 1670 #define USBLIB_FEATURE_LPM_RMT_WAKE \ 1672 #define USBLIB_FEATURE_LPM_EN 0x00000001 1673 #define USBLIB_FEATURE_LPM_DIS 0x00000000 1683 #define USBLIB_FEATURE_CPUCLK 0x00000002 1697 #define USBLIB_FEATURE_USBPLL 0x00000003 1712 #define USBLIB_FEATURE_USBULPI 0x00000004 1720 #define USBLIB_FEATURE_ULPI_NONE \ 1722 #define USBLIB_FEATURE_ULPI_HS 0x00000010 1723 #define USBLIB_FEATURE_ULPI_FS 0x00000020 1738 #define USBLIB_FEATURE_POWER 0x00000005 1746 #define USBLIB_FEATURE_POWER_SELF \ 1748 #define USBLIB_FEATURE_POWER_BUS \ 1750 #define USBLIB_FEATURE_REMOTE_WAKE \ 1900 const uint8_t *pui8Data, uint32_t ui32Length);
1902 uint32_t ui32Length);
1904 uint32_t ui32Length);
1907 uint32_t ui32Length);
1911 uint32_t ui32MsgValue,
void *pvMsgData);
1922 uint8_t *pui8Data, uint32_t ui32Length);
1926 const uint8_t *pui8Data, uint32_t ui32Length);
1928 uint32_t ui32NumBytes);
1930 uint32_t ui32NumBytes);
1932 uint8_t *pui8Buf, uint32_t ui32Size);
1943 extern void USBOTGMain(uint32_t ui32MsTicks);
1944 extern void USBOTGPollRate(uint32_t ui32Index, uint32_t ui32PollRate);
1945 extern void USBOTGModeInit(uint32_t ui32Index, uint32_t ui32PollRate,
1946 void *pHostData, uint32_t ui32HostDataSize);
1962 #endif // __USBLIB_H__ tUSBDeviceHandler pfnDeviceHandler
Definition: usblib.h:1037
tStdRequest pfnRequestHandler
Definition: usblib.h:978
uint8_t * pui8Buf
The ring buffer.
Definition: usblib.h:1792
tUSBMode
Definition: usblib.h:1151
uint8_t iManufacturer
The index of a string descriptor describing the manufacturer.
Definition: usblib.h:390
void USBRingBufWriteOne(tUSBRingBufObject *psUSBRingBuf, uint8_t ui8Data)
Definition: usbringbuf.c:611
tEndpointDescriptor * USBDescGetInterfaceEndpoint(tInterfaceDescriptor *psInterface, uint32_t ui32Index, uint32_t ui32Size)
Definition: usbdesc.c:449
void(* tStdRequest)(void *pvInstance, tUSBRequest *pUSBRequest)
Definition: usblib.h:919
tUSBIntHandler pfnSuspendHandler
Definition: usblib.h:1013
Definition: usblib.h:1157
tUSBEPIntHandler pfnEndpointHandler
Definition: usblib.h:1029
uint32_t USBRingBufSize(tUSBRingBufObject *psUSBRingBuf)
Definition: usbringbuf.c:370
uint8_t * pui8Buffer
Definition: usblib.h:1866
uint32_t ui32Event
One of the USB_EVENT_ values.
Definition: usblib.h:1345
Definition: usblib.h:1175
uint8_t bString
Definition: usblib.h:816
uint16_t bcdDevice
The device release number in BCD format.
Definition: usblib.h:385
uint16_t wIndex
Definition: usblib.h:190
uint8_t bInterval
Definition: usblib.h:712
const uint8_t * pui8Data
Definition: usblib.h:1060
uint8_t bInterfaceClass
The interface class code as assigned by the USB-IF.
Definition: usblib.h:647
tUSBPacketTransfer pfnTransfer
Definition: usblib.h:1843
void USBBufferFlush(const tUSBBuffer *psBuffer)
Definition: usbbuffer.c:859
uint8_t bAlternateSetting
Definition: usblib.h:636
uint8_t bNumEndpoints
Definition: usblib.h:642
uint8_t iConfiguration
The index of a string descriptor describing this configuration.
Definition: usblib.h:577
Definition: usblib.h:1816
void USBBufferDataWritten(const tUSBBuffer *psBuffer, uint32_t ui32Length)
Definition: usbbuffer.c:655
bool USBRingBufFull(tUSBRingBufObject *psUSBRingBuf)
Definition: usbringbuf.c:112
tUSBBufferVars sPrivateData
Definition: usblib.h:1877
void * USBBufferCallbackDataSet(tUSBBuffer *psBuffer, void *pvCBData)
Definition: usbbuffer.c:753
volatile uint32_t ui32WriteIndex
The ring buffer write index.
Definition: usblib.h:1782
uint32_t ui32BufferSize
The size, in bytes, of the buffer pointed to by pi8Buffer.
Definition: usblib.h:1871
void(* tInterfaceCallback)(void *pvInstance, uint8_t ui8InterfaceNum, uint8_t ui8AlternateSetting)
Definition: usblib.h:934
uint16_t idProduct
The device Product ID (PID) as assigned by the manufacturer.
Definition: usblib.h:380
void(* tUSBIntHandler)(void *pvInstance)
Definition: usblib.h:942
void USBRingBufAdvanceRead(tUSBRingBufObject *psUSBRingBuf, uint32_t ui32NumBytes)
Definition: usbringbuf.c:482
void(* tUSBModeCallback)(uint32_t ui32Index, tUSBMode iMode)
Definition: usblib.h:1198
uint32_t USBBufferEventCallback(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgValue, void *pvMsgData)
Definition: usbbuffer.c:1039
void * pvHandle
Definition: usblib.h:1860
tUSBIntHandler pfnDisconnectHandler
This callback is made when the device is disconnected from the USB bus.
Definition: usblib.h:1023
void(* tUSBEPIntHandler)(void *pvInstance, uint32_t ui32Status)
Definition: usblib.h:949
uint32_t USBRingBufContigUsed(tUSBRingBufObject *psUSBRingBuf)
Definition: usbringbuf.c:280
uint8_t bMaxPacketSize0
Definition: usblib.h:370
void(* tUSBDeviceHandler)(void *pvInstance, uint32_t ui32Request, void *pvRequestData)
Definition: usblib.h:957
tUSBIntHandler pfnResetHandler
This callback is made when a USB reset is detected.
Definition: usblib.h:1007
void USBDualModeTerm(uint32_t ui32Index)
Definition: usbmode.c:493
uint8_t bInterfaceProtocol
The interface protocol code as assigned by the USB-IF.
Definition: usblib.h:657
void USBOTGModeTerm(uint32_t ui32Index)
Definition: usbmode.c:538
uint8_t bmAttributes
Attributes of this configuration.
Definition: usblib.h:582
bool bTransmitBuffer
Definition: usblib.h:1824
void USB0_IRQOTGModeHandler(void)
Definition: usbmode.c:791
tInfoCallback pfnDataReceived
Definition: usblib.h:996
tInfoCallback pfnDataSent
Definition: usblib.h:1002
Definition: usblib.h:1181
void USBRingBufInit(tUSBRingBufObject *psUSBRingBuf, uint8_t *pui8Buf, uint32_t ui32Size)
Definition: usbringbuf.c:689
uint8_t bNumConfigurations
The number of other-speed configurations supported.
Definition: usblib.h:408
void USBStackModeSet(uint32_t ui32Index, tUSBMode iUSBMode, tUSBModeCallback pfnCallback)
Definition: usbmode.c:244
void USBRingBufFlush(tUSBRingBufObject *psUSBRingBuf)
Definition: usbringbuf.c:184
uint32_t USBBufferWrite(const tUSBBuffer *psBuffer, const uint8_t *pui8Data, uint32_t ui32Length)
Definition: usbbuffer.c:798
uint8_t bMaxPower
Definition: usblib.h:589
uint32_t USBRingBufContigFree(tUSBRingBufObject *psUSBRingBuf)
Definition: usbringbuf.c:317
uint32_t(* tUSBPacketAvailable)(void *pvHandle)
Definition: usblib.h:1636
uint8_t bConfigurationValue
Definition: usblib.h:572
uint32_t ui32Size
The ring buffer size.
Definition: usblib.h:1777
uint32_t ui32Instance
The caller supplied instance value that is passed to event handlers.
Definition: usblib.h:1350
uint32_t USBDescGetNum(tDescriptorHeader *psDesc, uint32_t ui32Size, uint32_t ui32Type)
Definition: usbdesc.c:84
uint32_t USBDescGetNumAlternateInterfaces(tConfigDescriptor *psConfig, uint8_t ui8InterfaceNumber)
Definition: usbdesc.c:225
void(* tInfoCallback)(void *pvInstance, uint32_t ui32Info)
Definition: usblib.h:926
uint32_t(* tUSBPacketTransfer)(void *pvHandle, uint8_t *pi8Data, uint32_t ui32Length, bool bLast)
Definition: usblib.h:1622
void USBBufferDataRemoved(const tUSBBuffer *psBuffer, uint32_t ui32Length)
Definition: usbbuffer.c:707
uint32_t ui32HIRD
Definition: usblib.h:1761
Definition: usblib.h:1169
uint32_t ui32Features
Definition: usblib.h:1762
uint16_t wMaxPacketSize
Definition: usblib.h:706
tUSBPacketAvailable pfnAvailable
Definition: usblib.h:1851
tInterfaceDescriptor * USBDescGetInterface(tConfigDescriptor *psConfig, uint32_t ui32Index, uint32_t ui32Alt)
Definition: usbdesc.c:386
const tUSBBuffer * USBBufferInit(tUSBBuffer *psBuffer)
Definition: usbbuffer.c:502
uint8_t iInterface
The index of a string descriptor describing this interface.
Definition: usblib.h:662
void USBOTGPollRate(uint32_t ui32Index, uint32_t ui32PollRate)
Definition: usbmode.c:761
Definition: usblib.h:1802
tUSBIntHandler pfnResumeHandler
This is called when resume signaling is detected.
Definition: usblib.h:1018
tDescriptorHeader * USBDescGet(tDescriptorHeader *psDesc, uint32_t ui32Size, uint32_t ui32Type, uint32_t ui32Index)
Definition: usbdesc.c:150
tInterfaceCallback pfnInterfaceChange
Definition: usblib.h:984
tUSBRingBufObject sRingBuf
Definition: usblib.h:1804
Definition: usblib.h:1187
uint32_t(* tUSBCallback)(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgParam, void *pvMsgData)
Definition: usblib.h:1220
uint16_t wLength
Definition: usblib.h:196
bool USBOTGFeatureSet(uint32_t ui32Index, uint32_t ui32Feature, void *pvFeature)
Definition: usbmode.c:1127
uint8_t bInterfaceSubClass
The interface subclass code as assigned by the USB-IF.
Definition: usblib.h:652
bool USBRingBufEmpty(tUSBRingBufObject *psUSBRingBuf)
Definition: usbringbuf.c:150
uint8_t bEndpointAddress
Definition: usblib.h:691
uint16_t bcdUSB
Definition: usblib.h:347
uint8_t iSerialNumber
Definition: usblib.h:401
void USBOTGModeInit(uint32_t ui32Index, uint32_t ui32PollRate, void *pHostData, uint32_t ui32HostDataSize)
Definition: usbmode.c:597
uint16_t ui16Size
The number of bytes of descriptor data pointed to by pui8Data.
Definition: usblib.h:1054
void * pvCBData
Definition: usblib.h:1837
uint32_t USBRingBufFree(tUSBRingBufObject *psUSBRingBuf)
Definition: usbringbuf.c:252
Definition: usblib.h:1049
uint32_t USBBufferRead(const tUSBBuffer *psBuffer, uint8_t *pui8Data, uint32_t ui32Length)
Definition: usbbuffer.c:900
uint32_t USBBufferSpaceAvailable(const tUSBBuffer *psBuffer)
Definition: usbbuffer.c:993
uint16_t wValue
Word-sized field that varies according to the request.
Definition: usblib.h:184
uint8_t USBRingBufReadOne(tUSBRingBufObject *psUSBRingBuf)
Definition: usbringbuf.c:395
void USB0DualModeIntHandler(void)
Definition: usbmode.c:304
Definition: usblibpriv.h:177
uint32_t USBBufferDataAvailable(const tUSBBuffer *psBuffer)
Definition: usbbuffer.c:956
uint32_t ui32LastSent
Definition: usblib.h:1805
uint16_t wTotalLength
Definition: usblib.h:561
uint8_t bInterfaceNumber
Definition: usblib.h:630
uint16_t idVendor
The device Vendor ID (VID) as assigned by the USB-IF.
Definition: usblib.h:375
uint8_t bReserved
Reserved for future use. Must be set to zero.
Definition: usblib.h:530
void USBOTGMain(uint32_t ui32MsTicks)
Definition: usbmode.c:1027
Definition: usblib.h:1759
tStdRequest pfnGetDescriptor
Definition: usblib.h:972
tUSBCallback pfnCallback
Definition: usblib.h:1831
uint8_t bmRequestType
Determines the type and direction of the request.
Definition: usblib.h:174
Definition: usblib.h:1772
uint8_t bNumInterfaces
The number of interface supported by this configuration.
Definition: usblib.h:566
void USBBufferInfoGet(const tUSBBuffer *psBuffer, tUSBRingBufObject *psRingBuf)
Definition: usbbuffer.c:608
uint32_t ui32Flags
Definition: usblib.h:1806
void USBBufferZeroLengthPacketInsert(const tUSBBuffer *psBuffer, bool bSendZLP)
Definition: usbbuffer.c:546
void USBRingBufAdvanceWrite(tUSBRingBufObject *psUSBRingBuf, uint32_t ui32NumBytes)
Definition: usbringbuf.c:531
void USBRingBufRead(tUSBRingBufObject *psUSBRingBuf, uint8_t *pui8Data, uint32_t ui32Length)
Definition: usbringbuf.c:439
uint32_t USBRingBufUsed(tUSBRingBufObject *psUSBRingBuf)
Definition: usbringbuf.c:217
Definition: usblib.h:1340
uint8_t iProduct
The index of a string descriptor describing the product.
Definition: usblib.h:395
tInfoCallback pfnConfigChange
Definition: usblib.h:990
uint8_t bDeviceSubClass
Definition: usblib.h:358
volatile uint32_t ui32ReadIndex
The ring buffer read index.
Definition: usblib.h:1787
uint8_t bDeviceClass
The device class code.
Definition: usblib.h:352
uint8_t bDeviceProtocol
Definition: usblib.h:364
void USBRingBufWrite(tUSBRingBufObject *psUSBRingBuf, const uint8_t *pui8Data, uint32_t ui32Length)
Definition: usbringbuf.c:649
Definition: usblib.h:1163
USB_CDC_GET/SET_LINE_CODING request-specific data.
Definition: usbaudio.h:288
uint8_t bRequest
Identifies the specific request being made.
Definition: usblib.h:179
void USBDualModeInit(uint32_t ui32Index)
Definition: usbmode.c:414