summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index c446638c3..efde9377f 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -33,10 +33,30 @@
extern "C" {
#endif
+// ConfigID for tud_configure()
+enum {
+ TUD_CFGID_INVALID = 0,
+ TUD_CFGID_DWC2 = 100,
+};
+
+typedef struct {
+ uint16_t bm_double_buffered; // bitmap of IN endpoints to be double buffered, only effective for bulk endpoints
+} tud_configure_dwc2_t;
+
+typedef union {
+ tud_configure_dwc2_t dwc2;
+} tud_configure_param_t;
+
//--------------------------------------------------------------------+
// Application API
//--------------------------------------------------------------------+
+// Configure device stack behavior with dynamic or port-specific parameters.
+// Should be called before initialization of the device stack
+// - cfg_id : configure ID from TUD_CFGID_* enum values
+// - cfg_param: configure data, structure depends on the ID
+bool tud_configure(uint8_t rhport, uint32_t cfg_id, const void* cfg_param);
+
// New API to replace tud_init() to init device stack on specific roothub port
bool tud_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init);