From 54f22f7c43264328eba8cdc91277bd467eb41d0b Mon Sep 17 00:00:00 2001 From: Peter Marcisovsky Date: Wed, 3 Jan 2024 12:52:51 +0100 Subject: [PATCH] feat(docs): added usb host enumeration filter description - CN and EN docs --- .../en/api-reference/peripherals/usb_host.rst | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/en/api-reference/peripherals/usb_host.rst b/docs/en/api-reference/peripherals/usb_host.rst index 5d08e46104..1ad1feb82f 100644 --- a/docs/en/api-reference/peripherals/usb_host.rst +++ b/docs/en/api-reference/peripherals/usb_host.rst @@ -408,10 +408,25 @@ The figure above shows all the timeouts associated with both turning on port pow Configurable parameters of the USB host stack can be configured with multiple options via Menuconfig. -* For Debounce delay refer to :ref:`CONFIG_USB_HOST_DEBOUNCE_DELAY_MS` -* For Reset hold interval refer to :ref:`CONFIG_USB_HOST_RESET_HOLD_MS` -* For Reset recovery interval refer to :ref:`CONFIG_USB_HOST_RESET_RECOVERY_MS` -* Fer SetAddress() recovery interval refer to: :ref:`CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS` +* For debounce delay, refer to :ref:`CONFIG_USB_HOST_DEBOUNCE_DELAY_MS`. +* For reset hold interval, refer to :ref:`CONFIG_USB_HOST_RESET_HOLD_MS`. +* For reset recovery interval, refer to :ref:`CONFIG_USB_HOST_RESET_RECOVERY_MS`. +* For ``SetAddress()`` recovery interval, refer to :ref:`CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS`. + +Multiple Configuration Support +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To support USB devices that have more than one configuration, it is possible to specify the desired configuration number during a device's enumeration process. + +Enumeration Filter +"""""""""""""""""" + +The enumeration filter is a callback function of type :cpp:type:`usb_host_enum_filter_cb_t` called at the beginning of the enumeration process once a device descriptor is read from a newly attached USB device. Consequently, the user is provided with the obtained device descriptor. Through this callback, the user can: + +* Select the configuration of the USB device. +* Filter which USB devices should be enumerated. + +To use the enumeration filter, users should enable the :ref:`CONFIG_USB_HOST_ENABLE_ENUM_FILTER_CALLBACK` option using menuconfig. Users can specify the callback by setting :cpp:member:`usb_host_config_t::enum_filter_cb` which is then passed to the Host Library when calling :cpp:func:`usb_host_install`. .. -------------------------------------------------- API Reference ----------------------------------------------------