summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
diff options
context:
space:
mode:
authorMengsk <[email protected]>2025-10-03 09:34:40 +0200
committerMengsk <[email protected]>2025-10-03 09:34:40 +0200
commit05ea8cf0ee1365dfe5b2c43c304838648f739abb (patch)
treeef4b339711c41927c35ef036e26640ae84c81ee7 /src/device/usbd.h
parentd322207441d55f636be911899f1c7928ba6b00b7 (diff)
parentc1bf19ed6cf1eaa791f221c1bc5ce4b3d069f76d (diff)
Merge remote-tracking branch 'tinyusb/master' into uac1
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index 9c61c5ef8..92409f6b4 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -270,6 +270,25 @@ bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_requ
//--------------------------------------------------------------------+
+// MTP Descriptor Templates
+//--------------------------------------------------------------------+
+
+// Length of template descriptor: 30 bytes
+#define TUD_MTP_DESC_LEN (9 + 7 + 7 + 7)
+
+// Interface number, string index, EP event, EP event size, EP event polling, EP Out & EP In address, EP size
+#define TUD_MTP_DESCRIPTOR(_itfnum, _stridx, _ep_evt, _ep_evt_size, _ep_evt_polling_interval, _epout, _epin, _epsize) \
+ /* Interface */\
+ 9, TUSB_DESC_INTERFACE, _itfnum, 0, 3, TUSB_CLASS_IMAGE, MTP_SUBCLASS_STILL_IMAGE, MTP_PROTOCOL_PIMA_15470, _stridx,\
+ /* Endpoint Interrupt */\
+ 7, TUSB_DESC_ENDPOINT, _ep_evt, TUSB_XFER_INTERRUPT, U16_TO_U8S_LE(_ep_evt_size), _ep_evt_polling_interval,\
+ /* Endpoint Out */\
+ 7, TUSB_DESC_ENDPOINT, _epout, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0,\
+ /* Endpoint In */\
+ 7, TUSB_DESC_ENDPOINT, _epin, TUSB_XFER_BULK, U16_TO_U8S_LE(_epsize), 0
+
+
+//--------------------------------------------------------------------+
// HID Descriptor Templates
//--------------------------------------------------------------------+