summaryrefslogtreecommitdiff
path: root/src/class/vendor/vendor_device.h
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2026-02-11 22:04:44 +0100
committerHiFiPhile <[email protected]>2026-02-11 22:04:44 +0100
commit135a130ba51d2e41b30f13fbd998f1db32a47470 (patch)
treefdbd0911fff794c89c014ee7a3a252e92162f8d1 /src/class/vendor/vendor_device.h
parentf5424c569ddc673a9c23b78febceed8f7f098509 (diff)
fix rx transfer length when high speed capable device/host working at full speed
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/class/vendor/vendor_device.h')
-rw-r--r--src/class/vendor/vendor_device.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/class/vendor/vendor_device.h b/src/class/vendor/vendor_device.h
index 101765bb1..594da19cb 100644
--- a/src/class/vendor/vendor_device.h
+++ b/src/class/vendor/vendor_device.h
@@ -37,7 +37,7 @@ extern "C" {
// Configuration
//--------------------------------------------------------------------+
#ifndef CFG_TUD_VENDOR_EPSIZE
- #define CFG_TUD_VENDOR_EPSIZE 64
+ #define CFG_TUD_VENDOR_EPSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
#endif
// RX FIFO can be disabled by setting this value to 0
@@ -63,6 +63,21 @@ extern "C" {
#endif
//--------------------------------------------------------------------+
+// Driver Configuration
+//--------------------------------------------------------------------+
+typedef struct TU_ATTR_PACKED {
+ bool rx_multiple_packet_transfer : 1; // allow transfer more than one packet in a single transfer, increase throughput but requires host sending ZLP at the end of transfer
+} tud_vendor_configure_t;
+TU_VERIFY_STATIC(sizeof(tud_vendor_configure_t) == 1, "size is not correct");
+
+#define TUD_VENDOR_CONFIGURE_DEFAULT() { \
+ .rx_multiple_packet_transfer = false, \
+}
+
+// Configure CDC driver behavior
+bool tud_vendor_configure(const tud_vendor_configure_t* driver_cfg);
+
+//--------------------------------------------------------------------+
// Application API (Multiple Interfaces) i.e CFG_TUD_VENDOR > 1
//--------------------------------------------------------------------+