9
tests/espressif/host/CMakeLists.txt
Normal file
9
tests/espressif/host/CMakeLists.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
# 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.16)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
list(APPEND EXTRA_COMPONENT_DIRS "../../../../CherryUSB")
|
||||
|
||||
project(cherryusb)
|
||||
4
tests/espressif/host/main/CMakeLists.txt
Normal file
4
tests/espressif/host/main/CMakeLists.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
idf_component_register(SRCS "main.c"
|
||||
INCLUDE_DIRS "."
|
||||
WHOLE_ARCHIVE)
|
||||
33
tests/espressif/host/main/main.c
Normal file
33
tests/espressif/host/main/main.c
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: CC0-1.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include "sdkconfig.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "esp_netif.h"
|
||||
#include "esp_event.h"
|
||||
#include "esp_log.h"
|
||||
#include "usbd_core.h"
|
||||
#include "usbh_core.h"
|
||||
#include "demo/usb_host.c"
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
USB_LOG_INFO("Hello CherryUSB!\n");
|
||||
|
||||
// Initialize TCP/IP network interface aka the esp-netif (should be called only once in application)
|
||||
ESP_ERROR_CHECK(esp_netif_init());
|
||||
// Create default event loop that running in background
|
||||
ESP_ERROR_CHECK(esp_event_loop_create_default());
|
||||
|
||||
usbh_initialize(0, 0x60080000, NULL);
|
||||
while(1)
|
||||
{
|
||||
vTaskDelay(10);
|
||||
}
|
||||
}
|
||||
8
tests/espressif/host/sdkconfig.defaults
Normal file
8
tests/espressif/host/sdkconfig.defaults
Normal file
@@ -0,0 +1,8 @@
|
||||
# This file was generated using idf.py save-defconfig. It can be edited manually.
|
||||
#
|
||||
CONFIG_CHERRYUSB=y
|
||||
CONFIG_CHERRYUSB_HOST=y
|
||||
CONFIG_CHERRYUSB_HOST_CUSTOM=y
|
||||
CONFIG_CHERRYUSB_HOST_CDC_ACM=y
|
||||
CONFIG_CHERRYUSB_HOST_HID=y
|
||||
CONFIG_CHERRYUSB_HOST_CDC_RNDIS=y
|
||||
Reference in New Issue
Block a user