diff options
| author | Skyler Mansfield <[email protected]> | 2022-04-17 01:16:49 +0100 |
|---|---|---|
| committer | Skyler Mansfield <[email protected]> | 2022-04-17 01:16:49 +0100 |
| commit | 16c13bc110fb0959e704b417706dd303afc69981 (patch) | |
| tree | 65925d8e1fe72bfcf5e22943a473431d71713b58 /src | |
| parent | 9c8c5c1c53214b8954bb28c33a496b5b423d5ecc (diff) | |
tusb_types:
Added descriptive strings for edpt_dir and edpt_type
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/tusb_types.h | 10 |
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 //--------------------------------------------------------------------+ |
