esp-idf/components/usb/test/usb_host/msc_client.h
Darian Leung 1aad12468a usb: Hub Driver Update and Refactor
Hub Driver is refactored as follows:

This commit update and refactors the Hub Driver as follows:

- Refactored enumeration state machine and stage functions
    - Enumeration stage is now incremented
    - Combined transfer stages of enumeration into common functions
- Comments updated
- Fixed usbh_hal_disable_debounce_lock() that would cause root_port_handle_events()
    to fail the HCD_PORT_CMD_RESET call because the previous port connection interrupt
    was not cleared.

The following features were added to the Hub Driver

- Enumeration config descriptor is now fetched in two separate stages
    - Header is fetched first to determine the wTotalLength of the descriptor
    - Fetching the full descriptor will request exactly wTotalLength bytes
    - This works around some non-compliant devices that will babble/return zero
        when requesting a length > wTotalLength
    - Closes https://github.com/espressif/esp-idf/issues/7799
- Enumeration now stores string descriptors
    - The Manufacturer, Product, and Serial Number string descriptors are
        now read and stored during enumeration
    - String descriptors are now part of usb_device_info_t
- Added unit test to test enumeration
2022-01-06 15:11:13 +08:00

24 lines
510 B
C

/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#define MSC_ASYNC_CLIENT_MAX_EVENT_MSGS 5
typedef struct {
int num_sectors_to_read;
int num_sectors_per_xfer;
uint32_t msc_scsi_xfer_tag;
uint16_t idVendor;
uint16_t idProduct;
} msc_client_test_param_t;
void msc_client_async_seq_task(void *arg);
void msc_client_async_dconn_task(void *arg);
void msc_client_async_enum_task(void *arg);