From d7b39eed5194f0bfe7f5c8713abb6f99607f5081 Mon Sep 17 00:00:00 2001 From: Diego Roversi Date: Sun, 11 Mar 2018 11:36:20 +0100 Subject: add serial ACM handling --- TERES-HID/Descriptors.h | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'TERES-HID/Descriptors.h') diff --git a/TERES-HID/Descriptors.h b/TERES-HID/Descriptors.h index 045c5ac..4dd4a3e 100644 --- a/TERES-HID/Descriptors.h +++ b/TERES-HID/Descriptors.h @@ -116,8 +116,23 @@ HID_RI_END_COLLECTION(0) + /* Macros: */ + /** Endpoint address of the CDC device-to-host notification IN endpoint. */ + #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) - /* Type Defines: */ + /** Endpoint address of the CDC device-to-host data IN endpoint. */ + #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3) + + /** Endpoint address of the CDC host-to-device data OUT endpoint. */ + #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4) + + /** Size in bytes of the CDC device-to-host notification IN endpoint. */ + #define CDC_NOTIFICATION_EPSIZE 8 + + /** Size in bytes of the CDC data IN and OUT endpoints. */ + #define CDC_TXRX_EPSIZE 16 + + /* Type Defines: */ /** Type define for the device configuration descriptor structure. This must be defined in the * application code, as the configuration descriptor contains several sub-descriptors which * vary between devices, and which describe the device's usage to the host. @@ -125,6 +140,20 @@ typedef struct { USB_Descriptor_Configuration_Header_t Config; + + // CDC Control Interface + USB_Descriptor_Interface_Association_t CDC_IAD; + USB_Descriptor_Interface_t CDC_CCI_Interface; + USB_CDC_Descriptor_FunctionalHeader_t CDC_Functional_Header; + USB_CDC_Descriptor_FunctionalACM_t CDC_Functional_ACM; + USB_CDC_Descriptor_FunctionalUnion_t CDC_Functional_Union; + USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; + + // CDC Data Interface + USB_Descriptor_Interface_t CDC_DCI_Interface; + USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; + USB_Descriptor_Endpoint_t CDC_DataInEndpoint; + // Keyboard HID Interface USB_Descriptor_Interface_t HID1_KeyboardInterface; @@ -146,6 +175,8 @@ INTERFACE_ID_Keyboard = 0, /**< Keyboard interface descriptor ID */ INTERFACE_ID_Mouse = 1, /**< Mouse interface descriptor ID */ + INTERFACE_ID_CDC_CCI = 2, /**< CDC CCI interface descriptor ID */ + INTERFACE_ID_CDC_DCI = 3, /**< CDC DCI interface descriptor ID */ -- cgit v1.2.3