diff options
| author | Maurizio Pesce <[email protected]> | 2025-03-12 09:50:04 +0100 |
|---|---|---|
| committer | roundby <[email protected]> | 2025-08-06 06:14:13 +0200 |
| commit | 283b06bb543f513d964dc3a6953115df897a93a1 (patch) | |
| tree | 4b8fe0783a64d6ca6157649bef0b35a8c0c5e324 /src/device/usbd.h | |
| parent | f01c4be350d21145162f4a3f283a298cd221f74d (diff) | |
Add MTP class device
Diffstat (limited to 'src/device/usbd.h')
| -rw-r--r-- | src/device/usbd.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h index de6007fb3..b89a0200b 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 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, MTP_PROTOCOL_STILL_IMAGE, _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 //--------------------------------------------------------------------+ |
