summaryrefslogtreecommitdiff
path: root/src/common/tusb_types.h
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2025-04-11 23:07:22 +0200
committerHiFiPhile <[email protected]>2025-04-11 23:07:22 +0200
commit459e2cd39ece797eb35f74ccace0db0a588b795a (patch)
tree68e0f398392eb001ab64857575a2b76934519021 /src/common/tusb_types.h
parent8d2310247c47160bf8de6e5f754284360ad7e937 (diff)
parent865e3488f99209c57b73953428dccf2bc666f0be (diff)
Merge remote-tracking branch 'upstream/master' into async_io
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/common/tusb_types.h')
-rw-r--r--src/common/tusb_types.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/common/tusb_types.h b/src/common/tusb_types.h
index 9e4d9380c..e000a4bd3 100644
--- a/src/common/tusb_types.h
+++ b/src/common/tusb_types.h
@@ -281,7 +281,8 @@ typedef enum {
// TODO remove
enum {
DESC_OFFSET_LEN = 0,
- DESC_OFFSET_TYPE = 1
+ DESC_OFFSET_TYPE = 1,
+ DESC_OFFSET_SUBTYPE = 2
};
enum {
@@ -302,9 +303,9 @@ typedef enum {
enum {
CONTROL_STAGE_IDLE = 0,
- CONTROL_STAGE_SETUP,
- CONTROL_STAGE_DATA,
- CONTROL_STAGE_ACK
+ CONTROL_STAGE_SETUP, // 1
+ CONTROL_STAGE_DATA, // 2
+ CONTROL_STAGE_ACK // 3
};
enum {
@@ -462,7 +463,7 @@ TU_VERIFY_STATIC( sizeof(tusb_desc_interface_assoc_t) == 8, "size is not correct
typedef struct TU_ATTR_PACKED {
uint8_t bLength ; ///< Size of this descriptor in bytes
uint8_t bDescriptorType ; ///< Descriptor Type
- uint16_t unicode_string[];
+ uint16_t utf16le[];
} tusb_desc_string_t;
// USB Binary Device Object Store (BOS)
@@ -570,14 +571,19 @@ TU_ATTR_ALWAYS_INLINE static inline uint8_t const * tu_desc_next(void const* des
return desc8 + desc8[DESC_OFFSET_LEN];
}
+// get descriptor length
+TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_desc_len(void const* desc) {
+ return ((uint8_t const*) desc)[DESC_OFFSET_LEN];
+}
+
// get descriptor type
TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_desc_type(void const* desc) {
return ((uint8_t const*) desc)[DESC_OFFSET_TYPE];
}
-// get descriptor length
-TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_desc_len(void const* desc) {
- return ((uint8_t const*) desc)[DESC_OFFSET_LEN];
+// get descriptor subtype
+TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_desc_subtype(void const* desc) {
+ return ((uint8_t const*) desc)[DESC_OFFSET_SUBTYPE];
}
// find descriptor that match byte1 (type)