mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-18 23:54:39 +00:00
usb: Extend CDC device with second CDC channel
Closes https://github.com/espressif/esp-idf/issues/7020 Closes https://github.com/espressif/esp-idf/pull/8011
This commit is contained in:
@@ -12,6 +12,9 @@ static tusb_desc_device_t s_descriptor;
|
||||
static char *s_str_descriptor[USB_STRING_DESCRIPTOR_ARRAY_SIZE];
|
||||
#define MAX_DESC_BUF_SIZE 32
|
||||
|
||||
#define EPNUM_MSC ((CFG_TUD_CDC * 2) + 1)
|
||||
#define EPNUM_HID (EPNUM_MSC + 1)
|
||||
|
||||
#if CFG_TUD_HID //HID Report Descriptor
|
||||
uint8_t const desc_hid_report[] = {
|
||||
TUD_HID_REPORT_DESC_KEYBOARD(HID_REPORT_ID(REPORT_ID_KEYBOARD), ),
|
||||
@@ -27,13 +30,20 @@ uint8_t const desc_configuration[] = {
|
||||
// Interface number, string index, EP notification address and size, EP data address (out, in) and size.
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, 0x81, 8, 0x02, 0x82, 64),
|
||||
# endif
|
||||
|
||||
# if CFG_TUD_CDC > 1
|
||||
// Interface number, string index, EP notification address and size, EP data address (out, in) and size.
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC1, 4, 0x83, 8, 0x04, 0x84, 64),
|
||||
# endif
|
||||
|
||||
# if CFG_TUD_MSC
|
||||
// Interface number, string index, EP Out & EP In address, EP size
|
||||
TUD_MSC_DESCRIPTOR(ITF_NUM_MSC, 5, EPNUM_MSC, 0x80 | EPNUM_MSC, 64), // highspeed 512
|
||||
# endif
|
||||
|
||||
# if CFG_TUD_HID
|
||||
// Interface number, string index, protocol, report descriptor len, EP In address, size & polling interval
|
||||
TUD_HID_DESCRIPTOR(ITF_NUM_HID, 6, HID_PROTOCOL_NONE, sizeof(desc_hid_report), 0x84, 16, 10)
|
||||
TUD_HID_DESCRIPTOR(ITF_NUM_HID, 6, HID_PROTOCOL_NONE, sizeof(desc_hid_report), 0x80 | EPNUM_HID, 16, 10)
|
||||
# endif
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user