summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-07-01 15:11:58 +0700
committerhathach <[email protected]>2018-07-01 15:11:58 +0700
commitff219f1f019a90df4a5e9de9632cbe057a4c35ef (patch)
tree89a2275bc78486b83e80c85a4677f51eda6d92dd /src/device/usbd.h
parentcfd5e1e6d19d94481ef84b4a16b41b2fae6c252e (diff)
add CFG_TUD_DESC_AUTO for auto descritpor (device, config)
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index 8e4d9f1a0..e40c86577 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -59,20 +59,22 @@
/// \brief Descriptor pointer collector to all the needed.
typedef struct {
- uint8_t const * device; ///< pointer to device descriptor \ref tusb_desc_device_t
- uint8_t const * configuration; ///< pointer to the whole configuration descriptor, starting by \ref tusb_desc_configuration_t
- uint8_t const** string_arr; ///< a array of pointers to string descriptors
+ uint8_t const * device; ///< pointer to device descriptor \ref tusb_desc_device_t
+ uint8_t const * config; ///< pointer to the whole configuration descriptor, starting by \ref tusb_desc_configuration_t
+ uint8_t const** string_arr; ///< a array of pointers to string descriptors
+ uint8_t const * hid_report; ///< pointer to HID report descriptor only needed if CFG_TUD_HID_* is enabled
+}tud_desc_set_t;
+
+
+// Must be defined by application
+extern tud_desc_set_t tud_desc_set;
- uint8_t const * p_hid_keyboard_report; ///< pointer to HID report descriptor of Keyboard interface. Only needed if CFG_TUD_HID_KEYBOARD is enabled
- uint8_t const * p_hid_mouse_report; ///< pointer to HID report descriptor of Mouse interface. Only needed if CFG_TUD_HID_MOUSE is enabled
-}tud_desc_init_t;
//--------------------------------------------------------------------+
// APPLICATION API (Multiple Root Ports)
// Should be used only with MCU that support more than 1 ports
//--------------------------------------------------------------------+
bool tud_n_mounted(uint8_t rhport);
-bool tud_n_set_descriptors(uint8_t rhport, tud_desc_init_t const* desc_cfg);
//--------------------------------------------------------------------+
// APPLICATION API (Single Port)
@@ -83,11 +85,6 @@ static inline bool tud_mounted(void)
return tud_n_mounted(0);
}
-static inline bool tud_set_descriptors(tud_desc_init_t const* desc_cfg)
-{
- return tud_n_set_descriptors(0, desc_cfg);
-}
-
//--------------------------------------------------------------------+
// APPLICATION CALLBACK
//--------------------------------------------------------------------+