diff options
| author | hathach <[email protected]> | 2013-07-01 10:35:37 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-07-01 10:35:37 +0700 |
| commit | a4f7dc1105f2a2f9aa27fdef810024eebbb7f2ba (patch) | |
| tree | 33eb906a997038d36ac32d68e9a3dcac1103c05d /tinyusb/class/cdc.h | |
| parent | a943cce99110eabeaea98a390a41842a15de715f (diff) | |
add & pass a first few test for cdc host
implement cdch_open_subtask
Diffstat (limited to 'tinyusb/class/cdc.h')
| -rw-r--r-- | tinyusb/class/cdc.h | 24 |
1 files changed, 21 insertions, 3 deletions
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 //--------------------------------------------------------------------+ |
