Merge branch 'CCRX_Port' of https://github.com/Wini-Buh/tinyusb into Wini-Buh-CCRX_Port

This commit is contained in:
hathach
2021-07-22 16:48:18 +07:00
9 changed files with 196 additions and 51 deletions

View File

@@ -215,6 +215,8 @@ typedef enum
// Class Specific Functional Descriptor (Communication Interface)
//--------------------------------------------------------------------+
TU_PACK_STRUCT_BEGIN // Start of definition of packed structs (used by the CCRX toolchain)
/// Header Functional Descriptor (Communication Interface)
typedef struct TU_ATTR_PACKED
{
@@ -234,14 +236,21 @@ typedef struct TU_ATTR_PACKED
uint8_t bSubordinateInterface ; ///< Array of Interface number of Data Interface
}cdc_desc_func_union_t;
TU_PACK_STRUCT_END // End of definition of packed structs (used by the CCRX toolchain)
#define cdc_desc_func_union_n_t(no_slave)\
struct TU_ATTR_PACKED { \
TU_PACK_STRUCT_BEGIN \
struct TU_ATTR_PACKED { \
uint8_t bLength ;\
uint8_t bDescriptorType ;\
uint8_t bDescriptorSubType ;\
uint8_t bControlInterface ;\
uint8_t bSubordinateInterface[no_slave] ;\
}
} \
TU_PACK_STRUCT_END
TU_PACK_STRUCT_BEGIN // Start of definition of packed structs (used by the CCRX toolchain)
/// Country Selection Functional Descriptor (Communication Interface)
typedef struct TU_ATTR_PACKED
@@ -253,21 +262,28 @@ typedef struct TU_ATTR_PACKED
uint16_t wCountryCode ; ///< Country code in the format as defined in [ISO3166], release date as specified inoffset 3 for the first supported country.
}cdc_desc_func_country_selection_t;
TU_PACK_STRUCT_END // End of definition of packed structs (used by the CCRX toolchain)
#define cdc_desc_func_country_selection_n_t(no_country) \
struct TU_ATTR_PACKED {\
TU_PACK_STRUCT_BEGIN \
struct TU_ATTR_PACKED { \
uint8_t bLength ;\
uint8_t bDescriptorType ;\
uint8_t bDescriptorSubType ;\
uint8_t iCountryCodeRelDate ;\
uint16_t wCountryCode[no_country] ;\
}
} \
TU_PACK_STRUCT_END
//--------------------------------------------------------------------+
// PUBLIC SWITCHED TELEPHONE NETWORK (PSTN) SUBCLASS
//--------------------------------------------------------------------+
TU_PACK_STRUCT_BEGIN // Start of definition of packed structs (used by the CCRX toolchain)
/// \brief Call Management Functional Descriptor
/// \details This functional descriptor describes the processing of calls for the Communications Class interface.
TU_BIT_FIELD_ORDER_BEGIN
typedef struct TU_ATTR_PACKED
{
uint8_t bLength ; ///< Size of this descriptor in bytes.
@@ -282,8 +298,10 @@ typedef struct TU_ATTR_PACKED
uint8_t bDataInterface;
}cdc_desc_func_call_management_t;
TU_BIT_FIELD_ORDER_END
TU_BIT_FIELD_ORDER_BEGIN
typedef struct TU_ATTR_PACKED
{
uint8_t support_comm_request : 1; ///< Device supports the request combination of Set_Comm_Feature, Clear_Comm_Feature, and Get_Comm_Feature.
@@ -292,6 +310,7 @@ typedef struct TU_ATTR_PACKED
uint8_t support_notification_network_connection : 1; ///< Device supports the notification Network_Connection.
uint8_t TU_RESERVED : 4;
}cdc_acm_capability_t;
TU_BIT_FIELD_ORDER_END
TU_VERIFY_STATIC(sizeof(cdc_acm_capability_t) == 1, "mostly problem with compiler");
@@ -307,6 +326,7 @@ typedef struct TU_ATTR_PACKED
/// \brief Direct Line Management Functional Descriptor
/// \details This functional descriptor describes the commands supported by the Communications Class interface with SubClass code of \ref CDC_FUNC_DESC_DIRECT_LINE_MANAGEMENT
TU_BIT_FIELD_ORDER_BEGIN
typedef struct TU_ATTR_PACKED
{
uint8_t bLength ; ///< Size of this descriptor in bytes.
@@ -319,6 +339,7 @@ typedef struct TU_ATTR_PACKED
uint8_t TU_RESERVED : 5;
} bmCapabilities;
}cdc_desc_func_direct_line_management_t;
TU_BIT_FIELD_ORDER_END
/// \brief Telephone Ringer Functional Descriptor
/// \details The Telephone Ringer functional descriptor describes the ringer capabilities supported by the Communications Class interface,
@@ -335,6 +356,7 @@ typedef struct TU_ATTR_PACKED
/// \brief Telephone Operational Modes Functional Descriptor
/// \details The Telephone Operational Modes functional descriptor describes the operational modes supported by
/// the Communications Class interface, with the SubClass code of \ref CDC_COMM_SUBCLASS_TELEPHONE_CONTROL_MODEL
TU_BIT_FIELD_ORDER_BEGIN
typedef struct TU_ATTR_PACKED
{
uint8_t bLength ; ///< Size of this descriptor in bytes.
@@ -347,10 +369,12 @@ typedef struct TU_ATTR_PACKED
uint8_t TU_RESERVED : 5;
} bmCapabilities;
}cdc_desc_func_telephone_operational_modes_t;
TU_BIT_FIELD_ORDER_END
/// \brief Telephone Call and Line State Reporting Capabilities Descriptor
/// \details The Telephone Call and Line State Reporting Capabilities functional descriptor describes the abilities of a
/// telephone device to report optional call and line states.
TU_BIT_FIELD_ORDER_BEGIN
typedef struct TU_ATTR_PACKED
{
uint8_t bLength ; ///< Size of this descriptor in bytes.
@@ -366,6 +390,7 @@ typedef struct TU_ATTR_PACKED
uint32_t TU_RESERVED : 26;
} bmCapabilities;
}cdc_desc_func_telephone_call_state_reporting_capabilities_t;
TU_BIT_FIELD_ORDER_END
static inline uint8_t cdc_functional_desc_typeof(uint8_t const * p_desc)
{
@@ -385,12 +410,17 @@ typedef struct TU_ATTR_PACKED
TU_VERIFY_STATIC(sizeof(cdc_line_coding_t) == 7, "size is not correct");
TU_BIT_FIELD_ORDER_BEGIN
typedef struct TU_ATTR_PACKED
{
uint16_t dte_is_present : 1; ///< Indicates to DCE if DTE is presentor not. This signal corresponds to V.24 signal 108/2 and RS-232 signal DTR.
uint16_t half_duplex_carrier_control : 1;
uint16_t : 14;
} cdc_line_control_state_t;
TU_BIT_FIELD_ORDER_END
TU_PACK_STRUCT_END // End of definition of packed structs (used by the CCRX toolchain)
TU_VERIFY_STATIC(sizeof(cdc_line_control_state_t) == 2, "size is not correct");