summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorSkyler Mansfield <[email protected]>2022-04-17 01:16:49 +0100
committerSkyler Mansfield <[email protected]>2022-04-17 01:16:49 +0100
commit16c13bc110fb0959e704b417706dd303afc69981 (patch)
tree65925d8e1fe72bfcf5e22943a473431d71713b58 /src/common
parent9c8c5c1c53214b8954bb28c33a496b5b423d5ecc (diff)
tusb_types:
Added descriptive strings for edpt_dir and edpt_type
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_types.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/tusb_types.h b/src/common/tusb_types.h
index e2fa17532..7eab396ef 100644
--- a/src/common/tusb_types.h
+++ b/src/common/tusb_types.h
@@ -513,6 +513,16 @@ static inline uint16_t tu_edpt_packet_size(tusb_desc_endpoint_t const* desc_ep)
return tu_le16toh(desc_ep->wMaxPacketSize) & TU_GENMASK(10, 0);
}
+static inline const char *tu_edpt_dir_str(tusb_dir_t dir) {
+ static const char *str[] = {"out", "in"};
+ return str[dir];
+}
+
+static inline const char *tu_edpt_type_str(tusb_xfer_type_t t) {
+ static const char *str[] = {"control", "isochronous", "bulk", "interrupt"};
+ return str[t];
+}
+
//--------------------------------------------------------------------+
// Descriptor helper
//--------------------------------------------------------------------+