Skip to content

Commit

Permalink
chore: Restructure esp-usb repository
Browse files Browse the repository at this point in the history
  • Loading branch information
tore-espressif committed Jan 24, 2024
1 parent 9d2d5e9 commit e939a52
Show file tree
Hide file tree
Showing 146 changed files with 57 additions and 63 deletions.
4 changes: 2 additions & 2 deletions .build-test-rules.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
usb/test_app:
test_app:
enable:
- if: IDF_TARGET in ["esp32s2", "esp32s3"]
- if: IDF_TARGET in ["esp32s2", "esp32s3"]
12 changes: 6 additions & 6 deletions .github/workflows/build_and_run_test_app_usb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:
with:
name: usb_test_app_bin_${{ matrix.idf_ver }}
path: |
usb/test_app/build_esp*/bootloader/bootloader.bin
usb/test_app/build_esp*/partition_table/partition-table.bin
usb/test_app/build_esp*/usb_test_app.bin
usb/test_app/build_esp*/usb_test_app.elf
usb/test_app/build_esp*/flasher_args.json
test_app/build_esp*/bootloader/bootloader.bin
test_app/build_esp*/partition_table/partition-table.bin
test_app/build_esp*/usb_test_app.bin
test_app/build_esp*/usb_test_app.elf
test_app/build_esp*/flasher_args.json
run-target:
name: Run USB Test App on target
Expand All @@ -62,4 +62,4 @@ jobs:
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
run: pip install --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pyserial
- name: Run USB Test App on target
run: pytest --target=${{ matrix.idf_target }} -m usb_host --build-dir=build_${{ matrix.idf_target }}
run: pytest --target=${{ matrix.idf_target }} -m usb_host --build-dir=build_${{ matrix.idf_target }}
22 changes: 11 additions & 11 deletions .github/workflows/upload_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ jobs:
# or if the 2nd component depends on the exact (new) version of the first one.
#
directories: >
usb/esp_modem_usb_dte;
usb/esp_tinyusb;
usb/usb_host_cdc_acm;
usb/usb_host_ch34x_vcp;
usb/usb_host_cp210x_vcp;
usb/usb_host_ftdi_vcp;
usb/usb_host_hid;
usb/usb_host_msc;
usb/usb_host_uvc;
usb/usb_host_vcp;
device/esp_tinyusb;
host/class/cdc/esp_modem_usb_dte;
host/class/cdc/usb_host_cdc_acm;
host/class/cdc/usb_host_ch34x_vcp;
host/class/cdc/usb_host_cp210x_vcp;
host/class/cdc/usb_host_ftdi_vcp;
host/class/cdc/usb_host_vcp;
host/class/hid/usb_host_hid;
host/class/msc/usb_host_msc;
host/class/uvc/usb_host_uvc;
namespace: "espressif"
# API token will only be available in the master branch in the main repository.
# However, dry-run doesn't require a valid token.
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
dry_run: ${{ github.ref_name != 'master' || github.repository_owner != 'espressif' }}
dry_run: ${{ github.ref_name != 'master' || github.repository_owner != 'espressif' }}
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "usb/usb_host_uvc/libuvc"]
path = usb/usb_host_uvc/libuvc
url = https://github.com/libuvc/libuvc.git
[submodule "host/usb_host_uvc/libuvc"]
path = host/class/uvc/usb_host_uvc/libuvc
url = ../../libuvc/libuvc.git
4 changes: 2 additions & 2 deletions .idf_build_apps.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
target = "all"
paths = "usb/test_app"
paths = "test_app"
recursive = true
manifest_file = ".build-test-rules.yml"
check_warnings = true

# build related options
build_dir = "build_@t"
build_dir = "build_@t"
3 changes: 0 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ repos:
rev: v4.3.0
hooks:
- id: trailing-whitespace
files: ^usb/
types_or: [c, c++]
- id: end-of-file-fixer
files: ^usb/
types_or: [c, c++]
- id: check-merge-conflict
- id: mixed-line-ending
files: ^usb/ # temporary USB only
types_or: [c, c++]
args: ['--fix=lf']
description: Forces to replace line ending by the UNIX 'lf' character
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
description: Espressif's additions to TinyUSB
documentation: "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-reference/peripherals/usb_device.html"
version: "1.4.3"
url: https://github.com/espressif/idf-extra-components/tree/master/usb/esp_tinyusb
url: https://github.com/espressif/esp-usb/tree/master/device/esp_tinyusb
dependencies:
idf: '>=5.0' # IDF 4.x contains TinyUSB as submodule
tinyusb:
version: '>=0.14.2'
public: true
public: true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ static void tinyusb_cdc_rx_callback(int itf, cdcacm_event_t *event)
* @brief TinyUSB CDC testcase
*
* This is not a 'standard' testcase, as it never exits. The testcase runs in a loop where it echoes back all the data received.
* The accompanying pytest script can be found in usb/test_app/pytest_usb_device.py
*
* - Init TinyUSB with standard CDC device and configuration descriptors
* - Init 2 CDC-ACM interfaces
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## IDF Component Manager Manifest File
version: "1.1.0~1"
description: USB DTE plugin for esp_modem component
url: https://github.com/espressif/idf-extra-components/tree/master/usb/esp_modem_usb_dte
url: https://github.com/espressif/esp-usb/tree/master/host/class/cdc/esp_modem_usb_dte

dependencies:
idf: ">=4.4"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,5 @@ The following steps outline the typical API call pattern of the CDC-ACM Class Dr
## Examples

- For an example with a CDC-ACM device, refer to [cdc_acm_host](https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/host/cdc/cdc_acm_host)
- For an example with a CDC-like device, refer to [cdc_acm_host_bg96](https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/host/cdc/cdc_acm_bg96)
- For an example with Virtual COM devices, refer to [cdc_acm_vcp](https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/host/cdc/cdc_acm_vcp)
- For examples with [esp_modem](https://components.espressif.com/components/espressif/esp_modem), refer to [esp_modem examples](https://github.com/espressif/esp-protocols/tree/master/components/esp_modem/examples)
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## IDF Component Manager Manifest File
version: "2.0.2~1"
description: USB Host CDC-ACM driver
url: https://github.com/espressif/idf-extra-components/tree/master/usb/usb_host_cdc_acm
url: https://github.com/espressif/esp-usb/tree/master/host/class/cdc/usb_host_cdc_acm
dependencies:
idf: ">=4.4"
targets:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## IDF Component Manager Manifest File
version: "2.0.0"
description: USB Host driver for CH34x series of chips
url: https://github.com/espressif/idf-extra-components/tree/master/usb/usb_host_ch34x_vcp
url: https://github.com/espressif/esp-usb/tree/master/host/class/cdc/usb_host_ch34x_vcp
dependencies:
espressif/usb_host_cdc_acm:
version: ">=1.0.4,<3.0.0"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## IDF Component Manager Manifest File
version: "2.0.0"
description: USB Host driver for CP210x series of chips
url: https://github.com/espressif/idf-extra-components/tree/master/usb/usb_host_cp210x_vcp
url: https://github.com/espressif/esp-usb/tree/master/host/class/cdc/usb_host_cp210x_vcp
dependencies:
espressif/usb_host_cdc_acm:
version: ">=1.0.4,<3.0.0"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## IDF Component Manager Manifest File
version: "2.0.0"
description: USB Host driver for FTDI USB<->UART converters series of chips
url: https://github.com/espressif/idf-extra-components/tree/master/usb/usb_host_ftdi_vcp
url: https://github.com/espressif/esp-usb/tree/master/host/class/cdc/usb_host_ftdi_vcp
dependencies:
espressif/usb_host_cdc_acm:
version: "^2.0.0"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## IDF Component Manager Manifest File
version: "1.0.0~2"
description: USB Host Virtual COM Port Service
url: https://github.com/espressif/idf-extra-components/tree/master/usb/usb_host_vcp
url: https://github.com/espressif/esp-usb/tree/master/host/class/cdc/usb_host_vcp
dependencies:
espressif/usb_host_cdc_acm:
version: ">=1.0.4,<3.0.0"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions usb/usb_host_hid/idf_component.yml → .../class/hid/usb_host_hid/idf_component.yml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## IDF Component Manager Manifest File
version: "1.0.1~1"
description: USB Host HID driver
url: https://github.com/espressif/idf-extra-components/tree/master/usb/usb_host_hid
dependencies:
idf: ">=4.4"
targets:
- esp32s2
- esp32s3
- esp32p4
## IDF Component Manager Manifest File
version: "1.0.1~1"
description: USB Host HID driver
url: https://github.com/espressif/esp-usb/tree/master/host/class/hid/usb_host_hid
dependencies:
idf: ">=4.4"
targets:
- esp32s2
- esp32s3
- esp32p4
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## IDF Component Manager Manifest File
version: "1.1.1~1"
description: USB Host MSC driver
url: https://github.com/espressif/idf-extra-components/tree/master/usb/usb_host_msc
url: https://github.com/espressif/esp-usb/tree/master/host/class/msc/usb_host_msc
dependencies:
idf: ">=4.4.1"
targets:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## IDF Component Manager Manifest File
version: "1.0.2~1"
description: USB Host UVC driver
url: https://github.com/espressif/idf-extra-components/tree/master/usb/usb_host_uvc
url: https://github.com/espressif/esp-usb/tree/master/host/class/uvc/usb_host_uvc
dependencies:
idf: ">=4.4"
sbom:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 12 additions & 11 deletions usb/test_app/CMakeLists.txt → test_app/CMakeLists.txt
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/version.cmake)

set(EXTRA_COMPONENT_DIRS ../usb_host_cdc_acm
../usb_host_msc
../usb_host_uvc
../usb_host_ch34x_vcp
../usb_host_cp210x_vcp
../usb_host_ftdi_vcp
../usb_host_vcp
../usb_host_hid
../esp_modem_usb_dte
)
set(EXTRA_COMPONENT_DIRS
../host/class/cdc/esp_modem_usb_dte
../host/class/cdc/usb_host_cdc_acm
../host/class/cdc/usb_host_ch34x_vcp
../host/class/cdc/usb_host_cp210x_vcp
../host/class/cdc/usb_host_ftdi_vcp
../host/class/cdc/usb_host_vcp
../host/class/hid/usb_host_hid
../host/class/msc/usb_host_msc
../host/class/uvc/usb_host_uvc
)

# Set the components to include the tests for.
set(TEST_COMPONENTS "usb_host_cdc_acm" "usb_host_msc" "usb_host_uvc" "usb_host_hid" CACHE STRING "List of components to test")
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0")
list(APPEND EXTRA_COMPONENT_DIRS ../esp_tinyusb)
list(APPEND EXTRA_COMPONENT_DIRS ../device/esp_tinyusb)
list(APPEND TEST_COMPONENTS "esp_tinyusb")
endif()

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
dependencies:
espressif/esp_tinyusb:
version: "*"
override_path: "../../esp_tinyusb"
override_path: "../../device/esp_tinyusb"
rules:
- if: "idf_version >= 5.0"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
@pytest.mark.usb_device
def test_usb_device(dut) -> None:
'''
This is a pytest script for esp_tinyusb testcase in usb/esp_tinyusb/test/test_esp_tinyusb.c
Running the test locally:
1. Build the testa app for your DUT (ESP32-S2 or S3)
2. Connect you DUT to your test runner (local machine) with USB port and flashing port
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit e939a52

Please sign in to comment.