summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-05-12 14:09:35 +0700
committerhathach <[email protected]>2019-05-12 14:09:35 +0700
commitba2136486c153edd372eadaa325dab27fe1297b2 (patch)
treed30de0dbfb87172da850733d88cf08ec9751e69e /src/device/usbd.h
parentde56a0ca8987c15c06112ece2589dab18f1d6666 (diff)
add tud_hid_descriptor_report_cb()
- remove tud_desc_set.hid_report - remove tud_desc_set_t
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index 0e7ed58f1..f8485166d 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -37,17 +37,6 @@
#include "common/tusb_common.h"
#include "device/dcd.h"
-/// \brief Descriptor pointer collector to all the needed.
-typedef struct {
- void const * device; ///< pointer to device descriptor \ref tusb_desc_device_t
- void const * config; ///< pointer to the whole configuration descriptor, starting by \ref tusb_desc_configuration_t
- uint8_t const* hid_report;
-
-}tud_desc_set_t;
-
-// Descriptor collection set, must be defined by application
-extern tud_desc_set_t tud_desc_set;
-
//--------------------------------------------------------------------+
// Application API
//--------------------------------------------------------------------+
@@ -74,9 +63,18 @@ bool tud_remote_wakeup(void);
// Application Callbacks (WEAK is optional)
//--------------------------------------------------------------------+
-// Invoked when received GET_STRING_DESC request
+// Invoked when received GET DEVICE DESCRIPTOR
+// Application return pointer to descriptor
+uint8_t const * tud_descriptor_device_cb(void);
+
+// Invoked when received GET CONFIGURATION DESCRIPTOR
+// Application return pointer to descriptor
+// Descriptor contents must exist long enough for transfer to complete
+uint8_t const * tud_descriptor_configuration_cb(void);
+
+// Invoked when received GET STRING DESC request
// max_char is CFG_TUD_ENDOINT0_SIZE/2 -1, typically max_char = 31 if Endpoint0 size is 64
-// Return number of characters. Note usb string is in 16-bits unicode format
+// Return number of characters. Note usb string is in UTF-16 format
uint8_t tud_descriptor_string_cb(uint8_t index, uint16_t* desc, uint8_t max_char);
// Invoked when device is mounted (configured)