49 #define HIDINTERFACE_SIZE (9) 56 #define HIDINENDPOINT_SIZE (7) 63 #define HIDOUTENDPOINT_SIZE (7) 70 #define HIDDESCRIPTOR_SIZE (9) 80 #define COMPOSITE_DHID_SIZE (HIDINTERFACE_SIZE + HIDINENDPOINT_SIZE + \ 81 HIDOUTENDPOINT_SIZE + HIDDESCRIPTOR_SIZE) 103 #define UsagePage(ui8Value) 0x05, ((ui8Value) & 0xff) 120 #define UsagePageVendor(ui16Value) 0x06, ((ui16Value) & 0xFF), \ 121 (((ui16Value) >> 8) & 0xFF) 135 #define Usage(ui8Value) 0x09, ((ui8Value) & 0xff) 151 #define UsageVendor(ui16Value) 0x0A, ((ui16Value) & 0xFF), \ 152 (((ui16Value) >> 8) & 0xFF) 168 #define UsageMinimum(ui8Value) 0x19, ((ui8Value) & 0xff) 184 #define UsageMaximum(ui8Value) 0x29, ((ui8Value) & 0xff) 200 #define LogicalMinimum(i8Value) 0x15, ((i8Value) & 0xff) 216 #define LogicalMaximum(i8Value) 0x25, ((i8Value) & 0xff) 234 #define PhysicalMinimum(i16Value) \ 235 0x36, ((i16Value) & 0xFF), \ 236 (((i16Value) >> 8) & 0xFF) 254 #define PhysicalMaximum(i16Value) \ 255 0x46, ((i16Value) & 0xFF), \ 256 (((i16Value) >> 8) & 0xFF) 273 #define Collection(ui8Value) 0xa1, ((ui8Value) & 0xff) 288 #define EndCollection 0xc0 304 #define ReportCount(ui8Value) 0x95, ((ui8Value) & 0xff) 320 #define ReportID(ui8Value) 0x85, ((ui8Value) & 0xff) 337 #define ReportSize(ui8Value) 0x75, ((ui8Value) & 0xff) 356 #define Input(ui8Value) 0x81, ((ui8Value) & 0xff) 376 #define Input2(ui16Value) 0x82, ((ui16Value) & 0xff), \ 377 (((ui16Value) >> 8) & 0xFF) 396 #define Feature(ui8Value) 0xB1, ((ui8Value) & 0xff) 416 #define Feature2(ui16Value) 0xB2, ((ui16Value) & 0xff), \ 417 (((ui16Value) >> 8) & 0xFF) 436 #define Output(ui8Value) 0x91, ((ui8Value) & 0xff) 456 #define Output2(ui16Value) 0x92, ((ui16Value) & 0xff), \ 457 (((ui16Value) >> 8) & 0xFF) 474 #define UnitExponent(i8Value) 0x55, ((i8Value) & 0x0f) 493 #define Unit(ui32Value) 0x67, (ui32Value) & 0x0f), \ 494 (((ui32Value) >> 8) & 0xFF), \ 495 (((ui32Value) >> 16) & 0xFF), \ 496 (((ui32Value) >> 24) & 0xFF) 503 #define UnitDistance_cm 0x66, 0x11, 0x00 510 #define UnitDistance_i 0x66, 0x13, 0x00 517 #define UnitRotation_deg 0x66, 0x14, 0x00 524 #define UnitRotation_rad 0x66, 0x12, 0x00 531 #define UnitMass_g 0x66, 0x01, 0x01 538 #define UnitTime_s 0x66, 0x01, 0x10 546 #define UnitTemp_K 0x67, 0x01, 0x00, 0x01, 0x00 554 #define UnitTemp_F 0x67, 0x03, 0x00, 0x01, 0x00 562 #define UnitVelocitySI 0x66, 0x11, 0xF0 570 #define UnitMomentumSI 0x66, 0x11, 0xF1 578 #define UnitAccelerationSI 0x66, 0x11, 0xE0 586 #define UnitForceSI 0x66, 0x11, 0xE1 594 #define UnitEnergySI 0x66, 0x21, 0xE1 602 #define UnitAngAccelerationSI 0x66, 0x12, 0xE0 609 #define UnitVoltage 0x67, 0x21, 0xD1, 0xF0, 0x00 616 #define UnitCurrent_A 0x67, 0x01, 0x00, 0x10, 0x00 627 #define USBDHID_MAX_PACKET 64 968 #define USBD_HID_EVENT_GET_REPORT \ 969 (USBD_HID_EVENT_BASE + 0) 983 #define USBD_HID_EVENT_REPORT_SENT \ 984 (USBD_HID_EVENT_BASE + 1) 999 #define USBD_HID_EVENT_GET_REPORT_BUFFER \ 1000 (USBD_HID_EVENT_BASE + 2) 1014 #define USBD_HID_EVENT_SET_REPORT \ 1015 (USBD_HID_EVENT_BASE + 3) 1024 #define USBD_HID_EVENT_GET_PROTOCOL \ 1025 (USBD_HID_EVENT_BASE + 4) 1034 #define USBD_HID_EVENT_SET_PROTOCOL \ 1035 (USBD_HID_EVENT_BASE + 5) 1047 #define USBD_HID_EVENT_IDLE_TIMEOUT \ 1048 (USBD_HID_EVENT_BASE + 6) 1063 uint32_t ui32Length,
bool bLast);
1065 uint32_t ui32Length,
bool bLast);
1100 #endif // __USBDHID_H__
uint8_t ui8NumInputReports
Definition: usbdhid.h:841
tHIDInstance sPrivateData
Definition: usbdhid.h:945
Definition: usbdhid.h:759
bool bUseOutEndpoint
Definition: usbdhid.h:891
uint16_t ui16MaxPowermA
The maximum power consumption of the device, expressed in milliamps.
Definition: usbdhid.h:815
tUSBCallback pfnTxCallback
Definition: usbdhid.h:874
void USBDHIDTerm(void *pvHIDInstance)
Definition: usbdhid.c:2007
const uint8_t *const * ppui8ClassDescriptors
Definition: usbdhid.h:907
Definition: usbdhid.h:666
uint8_t ui8INEndpoint
Definition: usbdhid.h:737
uint32_t ui32NumStringDescriptors
Definition: usbdhid.h:933
bool bGetRequestPending
Definition: usbdhid.h:732
Definition: usbdhid.h:652
tHIDReportIdle * psReportIdle
Definition: usbdhid.h:853
uint8_t ui8ReportID
Definition: usbdhid.h:775
uint16_t ui16VID
The vendor ID that this device is to present in the device descriptor.
Definition: usbdhid.h:805
uint8_t * pui8OutReportData
Definition: usbdhid.h:717
tDeviceInfo sDevInfo
Definition: usbdhid.h:676
uint16_t ui16OutReportSize
Definition: usbdhid.h:707
uint32_t ui32USBBase
Definition: usbdhid.h:671
Definition: usbdevice.h:135
tHIDState
Definition: usbdhid.h:637
Definition: usbdhid.h:800
void USBDHIDPowerStatusSet(void *pvHIDInstance, uint8_t ui8Power)
Definition: usbdhid.c:2450
const tHIDDescriptor * psHIDDescriptor
Definition: usbdhid.h:898
void * USBDHIDInit(uint32_t ui32Index, tUSBDHIDDevice *psHIDDevice)
Definition: usbdhid.c:1789
uint32_t ui32TimeSinceReportmS
Definition: usbdhid.h:790
const tConfigHeader *const * ppsConfigDescriptor
Definition: usbdhid.h:938
void * pvTxCBData
Definition: usbdhid.h:881
volatile uint16_t ui16DeferredOpFlags
Definition: usbdhid.h:692
uint16_t ui16InReportSize
Definition: usbdhid.h:697
bool USBDHIDRemoteWakeupRequest(void *pvHIDInstance)
Definition: usbdhid.c:2481
uint8_t ui8PwrAttributes
Definition: usbdhid.h:823
uint8_t ui8Subclass
The interface subclass to publish to the server for this HID device.
Definition: usbdhid.h:828
uint32_t USBDHIDTxPacketAvailable(void *pvHIDInstance)
Definition: usbdhid.c:2347
uint32_t USBDHIDReportWrite(void *pvHIDInstance, uint8_t *pi8Data, uint32_t ui32Length, bool bLast)
Definition: usbdhid.c:2141
void * pvRxCBData
Definition: usbdhid.h:867
volatile bool bSendInProgress
Definition: usbdhid.h:727
uint8_t ui8OUTEndpoint
Definition: usbdhid.h:742
uint8_t * pui8InReportData
Definition: usbdhid.h:712
tUSBCallback pfnRxCallback
Definition: usbdhid.h:860
volatile tHIDState iHIDRxState
Definition: usbdhid.h:681
uint16_t ui16InReportIndex
Definition: usbdhid.h:702
Definition: usbdevice.h:66
uint32_t(* tUSBCallback)(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgParam, void *pvMsgData)
Definition: usblib.h:1220
volatile bool bConnected
Definition: usbdhid.h:722
uint32_t USBDHIDPacketRead(void *pvHIDInstance, uint8_t *pi8Data, uint32_t ui32Length, bool bLast)
Definition: usbdhid.c:2246
uint16_t ui16PID
The product ID that this device is to present in the device descriptor.
Definition: usbdhid.h:810
Definition: usbdhid.h:642
uint32_t USBDHIDRxPacketAvailable(void *pvHIDInstance)
Definition: usbdhid.c:2395
uint8_t ui8Duration4mS
Definition: usbdhid.h:766
void * USBDHIDCompositeInit(uint32_t ui32Index, tUSBDHIDDevice *psHIDDevice, tCompositeEntry *psCompEntry)
Definition: usbdhid.c:1849
struct tHIDInstance tHIDInstance
Definition: usbhhid.h:44
uint16_t ui16TimeTillNextmS
Definition: usbdhid.h:782
void * USBDHIDSetRxCBData(void *pvHIDInstance, void *pvCBData)
Definition: usbdhid.c:2050
uint8_t ui8Protocol
The interface protocol to publish to the server for this HID device.
Definition: usbdhid.h:833
uint8_t ui8Interface
Definition: usbdhid.h:747
void * USBDHIDSetTxCBData(void *pvHIDInstance, void *pvCBData)
Definition: usbdhid.c:2092
const uint8_t *const * ppui8StringDescriptors
Definition: usbdhid.h:927
volatile tHIDState iHIDTxState
Definition: usbdhid.h:686
Definition: usbdhid.h:647