From a4f7dc1105f2a2f9aa27fdef810024eebbb7f2ba Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 1 Jul 2013 10:35:37 +0700 Subject: add & pass a first few test for cdc host implement cdch_open_subtask --- tinyusb/class/cdc.h | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'tinyusb/class/cdc.h') diff --git a/tinyusb/class/cdc.h b/tinyusb/class/cdc.h index 0835dfbd9..14c7c800b 100644 --- a/tinyusb/class/cdc.h +++ b/tinyusb/class/cdc.h @@ -210,7 +210,7 @@ typedef ATTR_PACKED_STRUCT(struct) { uint8_t bLength ; ///< Size of this descriptor in bytes. uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_ - uint8_t bcdCDC ; ///< CDC release number in Binary-Coded Decimal + uint16_t bcdCDC ; ///< CDC release number in Binary-Coded Decimal }tusb_cdc_func_header_t; typedef ATTR_PACKED_STRUCT(struct) { @@ -218,17 +218,35 @@ typedef ATTR_PACKED_STRUCT(struct) { uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_ uint8_t bControlInterface ; ///< Interface number of Communication Interface - uint8_t bSubordinateInterface[0] ; ///< Interface number of Data Interface + uint8_t bSubordinateInterface ; ///< Array of Interface number of Data Interface }tusb_cdc_func_union_t; +#define tusb_cdc_func_union_n_t(no_slave)\ + ATTR_PACKED_STRUCT(struct) { \ + uint8_t bLength ;\ + uint8_t bDescriptorType ;\ + uint8_t bDescriptorSubType ;\ + uint8_t bControlInterface ;\ + uint8_t bSubordinateInterface[no_slave] ;\ +} + typedef ATTR_PACKED_STRUCT(struct) { uint8_t bLength ; ///< Size of this descriptor in bytes. uint8_t bDescriptorType ; ///< Descriptor Type, must be Class-Specific uint8_t bDescriptorSubType ; ///< Descriptor SubType one of above CDC_FUCN_DESC_ uint8_t iCountryCodeRelDate ; ///< Index of a string giving the release date for the implemented ISO 3166 Country Codes. - uint16_t wCountryCode[0] ; ///< Country code in the format as defined in [ISO3166], release date as specified inoffset 3 for the first supported country. + uint16_t wCountryCode[] ; ///< Country code in the format as defined in [ISO3166], release date as specified inoffset 3 for the first supported country. }tusb_cdc_func_country_selection_t; +#define tusb_cdc_func_country_selection_n_t(no_country) \ + ATTR_PACKED_STRUCT(struct) {\ + uint8_t bLength ;\ + uint8_t bDescriptorType ;\ + uint8_t bDescriptorSubType ;\ + uint8_t iCountryCodeRelDate ;\ + uint16_t wCountryCode[no_country] ;\ +} + //--------------------------------------------------------------------+ // PUBLIC SWITCHED TELEPHONE NETWORK (PSTN) SUBCLASS //--------------------------------------------------------------------+ -- cgit v1.3.1