summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
diff options
context:
space:
mode:
authorMasterPhi <[email protected]>2021-06-29 22:40:21 +0200
committerMasterPhi <[email protected]>2021-07-04 15:46:10 +0200
commit6e9da70c18a0dbabaedb1c9aadcc9fe53a0113a7 (patch)
tree458c8141fe7707ef80eda7cc8da185fb2dfdc30f /src/device/usbd.h
parent681a61d4795b05d701a651733a1c0358ac2cb546 (diff)
Fix audiod_get_AS_interface_index in audio class.
Enhance uac2_headset example with multiple sample rates. Add macro to calculate EP size.
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index 3857295d7..45aefe53b 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -542,6 +542,11 @@ TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb
/* Standard AS Isochronous Feedback Endpoint Descriptor(4.10.2.1) */\
TUD_AUDIO_DESC_STD_AS_ISO_FB_EP(/*_ep*/ _epfb, /*_interval*/ 1)\
+// Calculate wMaxPacketSize of Endpoints
+#define TUD_AUDIO_EP_SIZE(_maxFrequency, _nBytesPerSample, _nChannels) \
+ ((((_maxFrequency + ((CFG_TUSB_RHPORT0_MODE & OPT_MODE_HIGH_SPEED) ? 7999 : 999)) / ((CFG_TUSB_RHPORT0_MODE & OPT_MODE_HIGH_SPEED) ? 8000 : 1000)) + 1) * _nBytesPerSample * _nChannels)
+
+
//------------- TUD_USBTMC/USB488 -------------//
#define TUD_USBTMC_APP_CLASS (TUSB_CLASS_APPLICATION_SPECIFIC)
#define TUD_USBTMC_APP_SUBCLASS 0x03u