subsys: usb: configure Interface descriptor at runtime
Introduce function to configure interface descriptor at runtime. It is simple to leave the corresponding function to configure the interface descriptor and fix bInterfaceNumber and iInterface values, for example. Signed-off-by: Johann Fischer <j.fischer@phytec.de>
This commit is contained in:
parent
bf332d0004
commit
1237549082
3 changed files with 45 additions and 0 deletions
|
@ -105,6 +105,11 @@ typedef void (*usb_ep_callback)(u8_t ep,
|
|||
typedef int (*usb_request_handler) (struct usb_setup_packet *detup,
|
||||
s32_t *transfer_len, u8_t **payload_data);
|
||||
|
||||
/**
|
||||
* Function for interface runtime configuration
|
||||
*/
|
||||
typedef void (*usb_interface_config)(u8_t bInterfaceNumber);
|
||||
|
||||
/*
|
||||
* USB Endpoint Configuration
|
||||
*/
|
||||
|
@ -169,6 +174,8 @@ struct usb_cfg_data {
|
|||
const u8_t *usb_device_description;
|
||||
/** Pointer to interface descriptor */
|
||||
const void *interface_descriptor;
|
||||
/** Function for interface runtime configuration */
|
||||
usb_interface_config interface_config;
|
||||
/** Callback to be notified on USB connection status change */
|
||||
usb_status_callback cb_usb_status;
|
||||
/** USB interface (Class) handler and storage space */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue