ESP32-S2/S3 USB- Needing a CustomHID-Example for Input *AND* output-Reports. #11111
CRprog
started this conversation in
Question - Community Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Reference to ...\packages\esp32\hardware\esp32\3.1.3\libraries\USB\examples\CustomHIDDevice\
I get it to work, also with changed Report descriptor (e.g gamepad with lots of buttons) and thus required small source code adjustments. Very nice, but only using Input (Data,Var,Abs, ....) , that means data flows only from Device -> Host (PC)
But I have no idea how to implement a simple byte data exchange (e.g. 4 bytes device->host and 2 bytes host->device)
Here's an example Reportdescriptor for that (I think) :
`
// Only IO-Device 2/4 Byte PC<->Device
static const uint8_t repdes_ByteIO[] = {
0x05, 0x01, // Usage Page (Generic Desktop Ctrls)
0x09, 0x00, // Usage (Undefined)
0xA1, 0x01, // Collection (Application)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8) =Byte
0x95, 0x04, // Report Count (4) x 4
0x09, 0x00, // Usage (Undefined)
0x81, 0x82, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) Device->PC 4 Bytes
0x75, 0x08, // Report Size (8) =Byte
0x95, 0x02, // Report Count (2) x 2
0x09, 0x00, // Usage (Undefined)
0x91, 0x82, // Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Volatile) PC->Device 2 Bytes
0xC0 // End Collection
};
`
Can someone provide a correspondingly adapted CustomHIDDevice.ino file which simply serial.print() the received bytes ?
Of course, something similar should be added later in the examples folder here.
Many thx !
Beta Was this translation helpful? Give feedback.
All reactions