Wykres commitów

18 Commity (f2db4c7520851ee5e0ea8d0f4d67dbd4fbc58234)

Autor SHA1 Wiadomość Data
Darian Leung 1af36a5b9d usb: Change API and refactor tests
This commit updates the USB Host Library API in the following wasy:
- usb_host_client_handle_t and usb_device_handle_t made into struct pointers
  to generate compiler warnings about conflicting handle types
- usb_host_client_config_t changed to future proof API for Synchronous Clients
- Added usb_host_lib_unblock()
- Added usb_host_device_addr_list_fill()
- Return of usb_host_device_free_all() updated to indicate whether there
  are still devices yet to be freed.
- Blockg APIs are now marked explicitly
- Fixed a bug in usb_host_transfer_submit_control() when checking the bEndpointAddress
  of a control transfer.

Tests are also refactored to move some common macros into shared headers

Closes https://github.com/espressif/esp-idf/issues/7786
2021-11-11 16:26:56 +08:00
Darian Leung 891c979c64 usb: Add USB Host Library sudden disconnect tests 2021-11-11 16:26:35 +08:00
Darian Leung 0a948594cb usb: Fix USBH handling of disconnections
This commit fixes how the USBH handling of a sudden device disconnection,
more specifically handling of device gone.
- Previously the USBH would only halt, flush, and dequeue the device's
default EP, then send a device gone event to the Host Library layer.
- Now the USBH will also halt and flush all non-default EPs, allowing
all of the URBs to be dequeud.
- Some internal object members are now protected by a mutex instead of
a spinlock.

Closes https://github.com/espressif/esp-idf/issues/7505
2021-11-11 16:26:09 +08:00
Darian Leung de6bf09f40 usb: Fix how the HCD handles sudden disconnection
This commit fixes how the USB Host HCD handles sudden disconnections.

Bugs:
- HW channels remain active when the port suddenly disconnects, and
previously the channel would be disabled by setting the disabled bit,
then waiting for a disabled interrupt. However, ISOC channels do not
generate the disabled interrupt when the port is invalid, thus leading
to tasks getting indefinitely blocked in hcd_pipe_command().

Fix:
On a sudden disconnection, forcibly treat all channels as halted even
if their HCCHAR.ChEna bit is still set. We do a soft reset after a port
error anyways, so the channels will eventually be reset.

Closes https://github.com/espressif/esp-idf/issues/7505
2021-11-11 16:25:01 +08:00
songruojing 1fcd639224 usb: Add usb_phy driver to support operations on USB PHY 2021-09-13 12:39:56 +08:00
Darian Leung 963836f491 Add USB Host Library API docs
- This commit adds the API documentation for the USB Host Library.
- Warnings about the beta API are also added.
- usb_host_misc.h renamed to usb_helpers.h
2021-09-02 18:40:24 +08:00
Darian Leung accbaee57c Add USB Host Library
This commit adds the preliminary version of the USB Host Library. This commit contains:

- USBH (USB Host Driver)
- Hub Driver that only supports a single device and device enumeration
- USB Host Library (asychronous API)
- Test cases for USB Host Library asychronous API

The following changes were made to the existing HCD:
- Removed HCD_PIPE_STATE_INVALID. Pipes are no longer invalidated
- Changed pipe commands to halt, flush, and clear. Pipes need to be manually
  halted, flush, and cleared.
- Halting and flushing a pipe will execute the pipe callback if it causes a
  HCD_PIPE_EVENT_URB_DONE event
2021-08-24 23:28:00 +08:00
morris 81448dcae8 tiny_usb: rename Kconfig name
1. Renamed Kconfig file of tinyusb (distinguish tinyusb stack from usb
   peripheral)
2. bugfix/typofix/doc update of tinyusb
2021-07-22 10:43:10 +08:00
Renz Bagaporo 7c22cccb9c esp32: cleanup build script 2021-07-16 20:14:27 +08:00
Darian Leung d37451f2c7 USB HCD: Add pipe persistence feature
This commit adds a pipe persistence feature allowing HCD pipes
to survive a port reset.
2021-06-29 21:09:27 +08:00
Darian Leung b901cbd273 USB: Make unit test mock classes common
This commit moves the mock classes used for HCD unit tests into
a common header so that other layers of the USB Host stack can
also utilzie them for their own unit tests.
2021-06-28 15:02:58 +08:00
Darian Leung 5f9692ae97 HCD: Fix multiple bugs
This commit fixes the following bugs with the HCD and USB Host HAL

- Make the setting to periodic frame list and scheduling to occur after
  a reset command
- All port errors states should put the port into the HCD_PORT_STATE_RECOVERY
  state.
- Fixed incorrect return type of hcd_port_command() function
2021-06-15 18:52:56 +08:00
Darian Leung 18f9dabce1 USB: Change IRP to URBs
This commit changes the IRP (I/O Request Packet) structure to
the URB (USB Request Block) in order to represent USB transfers
in the host stack. The new URB strcuture:

- Add extra safety with const fields
- Allows each layer of the stack to add their own overhead variables

The HCD layer API and tests have been updated to use this new URB structure
2021-06-09 22:09:46 +08:00
Alex Lisitsyn 46020fe13a usb/hal/soc: initial copy of usbh support from esp32s2
copy required usbh driver files from esp32s2
check usb host functionality using unit tests on esp32s3
2021-06-02 17:57:50 +08:00
Darian Leung 7f42104893 HCD: Add support for interrupt and isochronous pipes
This commit adds support for interrupt and isochronous pipes to the HCD:
- HCD now internally uses double buffering
- Added test cases for interrupt and isochronous transfers
- Reorganized test cases for each transfer type
- Updated API comments and maintainer's notes

Some minor bugs were also fixed
2021-05-26 22:55:12 +08:00
Darian Leung 738af3fd38 USB HCD uses IRPs directly for transfer
This commit updates the HCD so that transfer requests are no longer used.
The USB IRP object is updated so that the it can be directly passed to the HCD
to start a transfer. HCD API, tests, and documentation updated accordingly.
2021-04-25 21:52:07 +08:00
Darian Leung 2906a25988 Separate USB HAL and common USB types
This commit separates out the common USB types used throughout most of the stack into its
own header file inside the USB component. The types used in the USB HAL are now exclusive
to the HAL.
2021-04-22 19:24:48 +08:00
Darian Leung 424e1e1886 Add USB HCD
This commit adds the USB HCD (Host Controller Driver) and accompanying unit tests.
2021-02-26 23:13:42 +08:00