mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
usb: Add USB host CDC-ACM class driver
This commit is contained in:
10
tools/test_apps/peripherals/usb/CMakeLists.txt
Normal file
10
tools/test_apps/peripherals/usb/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
# The following lines of boilerplate have to be in your project's
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/peripherals/usb/host/cdc/common)
|
||||
|
||||
# Set the components to include the tests for.
|
||||
set(TEST_COMPONENTS "cdc_acm_host" CACHE STRING "List of components to test")
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(usb_test_app)
|
14
tools/test_apps/peripherals/usb/README.md
Normal file
14
tools/test_apps/peripherals/usb/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
| Supported Targets | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | -------- | -------- |
|
||||
|
||||
# USB Host CDC-ACM driver test project
|
||||
|
||||
Main purpose of this application is to test the USB Host CDC-ACM driver.
|
||||
It tests basic functionality of the driver like open/close/read/write operations,
|
||||
advanced features like CDC control request, multi-threaded or multi-device access,
|
||||
as well as reaction to sudden disconnection and other error states.
|
||||
|
||||
## Hardware Required
|
||||
|
||||
This test expects that TinyUSB dual CDC device with VID = 0x303A and PID = 0x4002
|
||||
is connected to the USB host.
|
3
tools/test_apps/peripherals/usb/main/CMakeLists.txt
Normal file
3
tools/test_apps/peripherals/usb/main/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
idf_component_register(SRCS "usb_test_main.c"
|
||||
INCLUDE_DIRS ""
|
||||
REQUIRES unity)
|
16
tools/test_apps/peripherals/usb/main/usb_test_main.c
Normal file
16
tools/test_apps/peripherals/usb/main/usb_test_main.c
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "unity.h"
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
UNITY_BEGIN();
|
||||
unity_run_all_tests();
|
||||
UNITY_END();
|
||||
}
|
Reference in New Issue
Block a user