summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-05-11 16:31:08 +0700
committerhathach <[email protected]>2019-05-11 16:31:52 +0700
commitde56a0ca8987c15c06112ece2589dab18f1d6666 (patch)
tree101bd3bf6cb994043e3347e2e473f252996fd215 /src/device/usbd.h
parentbfa073818c83266c2353ccf4fce580eef62e4a0c (diff)
add tud_descriptor_string_cb() for getting string descriptor from application
- remove tud_desc_set.string_arr/string_count
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index 8debbf535..0e7ed58f1 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -39,12 +39,8 @@
/// \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** string_arr; ///< a array of pointers to string descriptors
- uint16_t string_count;
-
+ 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;
@@ -78,6 +74,11 @@ bool tud_remote_wakeup(void);
// Application Callbacks (WEAK is optional)
//--------------------------------------------------------------------+
+// 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
+uint8_t tud_descriptor_string_cb(uint8_t index, uint16_t* desc, uint8_t max_char);
+
// Invoked when device is mounted (configured)
ATTR_WEAK void tud_mount_cb(void);