Skip to content

Commit 16c13bc

Browse files
committed
tusb_types:
Added descriptive strings for edpt_dir and edpt_type
1 parent 9c8c5c1 commit 16c13bc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/common/tusb_types.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,16 @@ static inline uint16_t tu_edpt_packet_size(tusb_desc_endpoint_t const* desc_ep)
513513
return tu_le16toh(desc_ep->wMaxPacketSize) & TU_GENMASK(10, 0);
514514
}
515515

516+
static inline const char *tu_edpt_dir_str(tusb_dir_t dir) {
517+
static const char *str[] = {"out", "in"};
518+
return str[dir];
519+
}
520+
521+
static inline const char *tu_edpt_type_str(tusb_xfer_type_t t) {
522+
static const char *str[] = {"control", "isochronous", "bulk", "interrupt"};
523+
return str[t];
524+
}
525+
516526
//--------------------------------------------------------------------+
517527
// Descriptor helper
518528
//--------------------------------------------------------------------+

0 commit comments

Comments
 (0)