From f3f9d1fb9533529776ded4fd3af7fd274ba5f2fe Mon Sep 17 00:00:00 2001 From: Tomasz Moń Date: Tue, 8 Jun 2021 16:46:07 +0200 Subject: USB Serial: Implement Abstract Control Management On devices that can assign interrupt IN, bulk IN and bulk OUT endpoints this change results in the serial interface working out of the box on Linux and Windows. On Linux it is registered as ttyACM device and on Windows it is assigned a COM port number. On devices that cannot assign the interrupt IN this change won't have any effect. Implement minimum required interface control requests. Respond with whatever line coding was set to make terminal programs happy. Change-Id: Id7d3899d8546e45d7cb4ecc3fe464908cb59e810 --- firmware/export/usb_ch9.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'firmware/export/usb_ch9.h') diff --git a/firmware/export/usb_ch9.h b/firmware/export/usb_ch9.h index c11775b893..659bcca101 100644 --- a/firmware/export/usb_ch9.h +++ b/firmware/export/usb_ch9.h @@ -390,6 +390,23 @@ struct usb_debug_descriptor { uint8_t bDebugOutEndpoint; } __attribute__((packed)); +/*-------------------------------------------------------------------------*/ + +/* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */ +struct usb_interface_assoc_descriptor { + uint8_t bLength; + uint8_t bDescriptorType; + + uint8_t bFirstInterface; + uint8_t bInterfaceCount; + uint8_t bFunctionClass; + uint8_t bFunctionSubClass; + uint8_t bFunctionProtocol; + uint8_t iFunction; +} __attribute__ ((packed)); + +#define USB_DT_INTERFACE_ASSOCIATION_SIZE 8 + /*-------------------------------------------------------------------------*/ /* USB 2.0 defines three speeds, here's how Linux identifies them */ -- cgit v1.2.3