mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-14 00:40:29 +00:00
commit
8ea0dfba68
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -67,7 +67,7 @@ jobs:
|
|||||||
- name: Checkout pico-sdk
|
- name: Checkout pico-sdk
|
||||||
if: matrix.family == 'rp2040'
|
if: matrix.family == 'rp2040'
|
||||||
run: |
|
run: |
|
||||||
git clone --depth 1 https://github.com/raspberrypi/pico-sdk ~/pico-sdk
|
git clone --depth 1 -b tinyusb-0.10.0 https://github.com/raspberrypi/pico-sdk ~/pico-sdk
|
||||||
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
|
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
|
||||||
|
|
||||||
- name: Set Toolchain URL
|
- name: Set Toolchain URL
|
||||||
|
27
examples/device/CMakeLists.txt
Normal file
27
examples/device/CMakeLists.txt
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
|
|
||||||
|
project(tinyusb_device_examples)
|
||||||
|
family_initialize_project(tinyusb_device_examples ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
|
# family_add_subdirectory will filter what to actually add based on selected FAMILY
|
||||||
|
family_add_subdirectory(audio_4_channel_mic)
|
||||||
|
family_add_subdirectory(audio_test)
|
||||||
|
family_add_subdirectory(board_test)
|
||||||
|
family_add_subdirectory(cdc_dual_ports)
|
||||||
|
family_add_subdirectory(cdc_msc)
|
||||||
|
family_add_subdirectory(cdc_msc_freertos)
|
||||||
|
family_add_subdirectory(dfu)
|
||||||
|
family_add_subdirectory(dfu_runtime)
|
||||||
|
family_add_subdirectory(dynamic_configuration)
|
||||||
|
family_add_subdirectory(hid_composite)
|
||||||
|
family_add_subdirectory(hid_composite_freertos)
|
||||||
|
family_add_subdirectory(hid_generic_inout)
|
||||||
|
family_add_subdirectory(hid_multiple_interface)
|
||||||
|
family_add_subdirectory(midi_test)
|
||||||
|
family_add_subdirectory(msc_dual_lun)
|
||||||
|
family_add_subdirectory(net_lwip_webserver)
|
||||||
|
family_add_subdirectory(uac2_headset)
|
||||||
|
family_add_subdirectory(usbtmc)
|
||||||
|
family_add_subdirectory(webusb_serial)
|
@ -1,37 +1,28 @@
|
|||||||
# use BOARD-Directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
project(${PROJECT})
|
||||||
|
|
||||||
# Example source
|
# Checks this example is valid for the family and initializes the project
|
||||||
target_sources(${PROJECT} PUBLIC
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
add_executable(${PROJECT})
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example defines
|
# Example source
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
else()
|
# Example include
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
endif()
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
|
family_configure_device_example(${PROJECT})
|
||||||
|
@ -1,37 +1,28 @@
|
|||||||
# use BOARD-Directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
project(${PROJECT})
|
||||||
|
|
||||||
# Example source
|
# Checks this example is valid for the family and initializes the project
|
||||||
target_sources(${PROJECT} PUBLIC
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
add_executable(${PROJECT})
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example defines
|
# Example source
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
else()
|
# Example include
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
endif()
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
|
family_configure_device_example(${PROJECT})
|
@ -1,44 +1,43 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
# use BOARD-Directory name for project id
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# Check for -DFAMILY=
|
||||||
if(FAMILY MATCHES "^esp32s[2-3]")
|
if(FAMILY MATCHES "^esp32s[2-3]")
|
||||||
cmake_minimum_required(VERSION 3.5)
|
# use BOARD-Directory name for project id
|
||||||
|
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||||
|
set(PROJECT ${BOARD}-${PROJECT})
|
||||||
|
|
||||||
|
# TOP is absolute path to root directory of TinyUSB git repo
|
||||||
|
set(TOP "../../..")
|
||||||
|
get_filename_component(TOP "${TOP}" REALPATH)
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
||||||
project(${PROJECT})
|
project(${PROJECT})
|
||||||
|
|
||||||
elseif(FAMILY STREQUAL "rp2040")
|
else()
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
project(${PROJECT})
|
project(${PROJECT})
|
||||||
|
|
||||||
|
# Checks this example is valid for the family and initializes the project
|
||||||
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
add_executable(${PROJECT})
|
add_executable(${PROJECT})
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
|
||||||
|
|
||||||
# Example source
|
# Example source
|
||||||
target_sources(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# Example include
|
# Example include
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
# Example defines
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
family_configure_device_example(${PROJECT})
|
||||||
)
|
|
||||||
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,37 +1,28 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
project(${PROJECT})
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
# Checks this example is valid for the family and initializes the project
|
||||||
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
# Example source
|
add_executable(${PROJECT})
|
||||||
target_sources(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
# Example source
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
# Example defines
|
# Example include
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
else()
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
endif()
|
family_configure_device_example(${PROJECT})
|
@ -64,8 +64,9 @@
|
|||||||
#error "Incorrect RHPort configuration"
|
#error "Incorrect RHPort configuration"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// This example doesn't use an RTOS
|
#ifndef CFG_TUSB_OS
|
||||||
#define CFG_TUSB_OS OPT_OS_NONE
|
#define CFG_TUSB_OS OPT_OS_NONE
|
||||||
|
#endif
|
||||||
|
|
||||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||||
// #define CFG_TUSB_DEBUG 0
|
// #define CFG_TUSB_DEBUG 0
|
||||||
|
@ -1,38 +1,29 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
project(${PROJECT})
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
# Checks this example is valid for the family and initializes the project
|
||||||
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
# Example source
|
add_executable(${PROJECT})
|
||||||
target_sources(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
# Example source
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
# Example defines
|
# Example include
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
else()
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
endif()
|
family_configure_device_example(${PROJECT})
|
@ -1,37 +1,28 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
project(${PROJECT})
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
# Checks this example is valid for the family and initializes the project
|
||||||
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
# Example source
|
add_executable(${PROJECT})
|
||||||
target_sources(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
# Example source
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
# Example defines
|
# Example include
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
else()
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
endif()
|
family_configure_device_example(${PROJECT})
|
@ -1,37 +1,28 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
project(${PROJECT})
|
||||||
|
|
||||||
# Example source
|
# Checks this example is valid for the family and initializes the project
|
||||||
target_sources(${PROJECT} PUBLIC
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
add_executable(${PROJECT})
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example defines
|
# Example source
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
else()
|
# Example include
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
endif()
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
|
family_configure_device_example(${PROJECT})
|
@ -1,38 +1,29 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
project(${PROJECT})
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
# Checks this example is valid for the family and initializes the project
|
||||||
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
# Example source
|
add_executable(${PROJECT})
|
||||||
target_sources(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
# Example source
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
# Example defines
|
# Example include
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
else()
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
endif()
|
family_configure_device_example(${PROJECT})
|
@ -1,37 +1,28 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
project(${PROJECT})
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
# Checks this example is valid for the family and initializes the project
|
||||||
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
# Example source
|
add_executable(${PROJECT})
|
||||||
target_sources(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
# Example source
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
# Example defines
|
# Example include
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
else()
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
endif()
|
family_configure_device_example(${PROJECT})
|
@ -1,37 +1,28 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
project(${PROJECT})
|
||||||
|
|
||||||
# Example source
|
# Checks this example is valid for the family and initializes the project
|
||||||
target_sources(${PROJECT} PUBLIC
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
add_executable(${PROJECT})
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example defines
|
# Example source
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
else()
|
# Example include
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
endif()
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
|
family_configure_device_example(${PROJECT})
|
@ -1,37 +1,28 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
project(${PROJECT})
|
||||||
|
|
||||||
# Example source
|
# Checks this example is valid for the family and initializes the project
|
||||||
target_sources(${PROJECT} PUBLIC
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
add_executable(${PROJECT})
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example defines
|
# Example source
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
else()
|
# Example include
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
endif()
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
|
family_configure_device_example(${PROJECT})
|
@ -1,37 +1,28 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
project(${PROJECT})
|
||||||
|
|
||||||
# Example source
|
# Checks this example is valid for the family and initializes the project
|
||||||
target_sources(${PROJECT} PUBLIC
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
add_executable(${PROJECT})
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example defines
|
# Example source
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
else()
|
# Example include
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
endif()
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
|
family_configure_device_example(${PROJECT})
|
@ -1,38 +1,29 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
project(${PROJECT})
|
||||||
|
|
||||||
# Example source
|
# Checks this example is valid for the family and initializes the project
|
||||||
target_sources(${PROJECT} PUBLIC
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk_dual.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
add_executable(${PROJECT})
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example defines
|
# Example source
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk_dual.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
else()
|
# Example include
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
endif()
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
|
family_configure_device_example(${PROJECT})
|
@ -1,84 +1,81 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
|
||||||
set(TOP "../../..")
|
set(TOP "../../..")
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
get_filename_component(TOP "${TOP}" REALPATH)
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
if (EXISTS ${TOP}/lib/lwip/src)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
# lwip Stack source
|
project(${PROJECT})
|
||||||
set(SRC_LWIP
|
|
||||||
${TOP}/lib/lwip/src/core/altcp.c
|
|
||||||
${TOP}/lib/lwip/src/core/altcp_alloc.c
|
|
||||||
${TOP}/lib/lwip/src/core/altcp_tcp.c
|
|
||||||
${TOP}/lib/lwip/src/core/def.c
|
|
||||||
${TOP}/lib/lwip/src/core/dns.c
|
|
||||||
${TOP}/lib/lwip/src/core/inet_chksum.c
|
|
||||||
${TOP}/lib/lwip/src/core/init.c
|
|
||||||
${TOP}/lib/lwip/src/core/ip.c
|
|
||||||
${TOP}/lib/lwip/src/core/mem.c
|
|
||||||
${TOP}/lib/lwip/src/core/memp.c
|
|
||||||
${TOP}/lib/lwip/src/core/netif.c
|
|
||||||
${TOP}/lib/lwip/src/core/pbuf.c
|
|
||||||
${TOP}/lib/lwip/src/core/raw.c
|
|
||||||
${TOP}/lib/lwip/src/core/stats.c
|
|
||||||
${TOP}/lib/lwip/src/core/sys.c
|
|
||||||
${TOP}/lib/lwip/src/core/tcp.c
|
|
||||||
${TOP}/lib/lwip/src/core/tcp_in.c
|
|
||||||
${TOP}/lib/lwip/src/core/tcp_out.c
|
|
||||||
${TOP}/lib/lwip/src/core/timeouts.c
|
|
||||||
${TOP}/lib/lwip/src/core/udp.c
|
|
||||||
${TOP}/lib/lwip/src/core/ipv4/autoip.c
|
|
||||||
${TOP}/lib/lwip/src/core/ipv4/dhcp.c
|
|
||||||
${TOP}/lib/lwip/src/core/ipv4/etharp.c
|
|
||||||
${TOP}/lib/lwip/src/core/ipv4/icmp.c
|
|
||||||
${TOP}/lib/lwip/src/core/ipv4/igmp.c
|
|
||||||
${TOP}/lib/lwip/src/core/ipv4/ip4.c
|
|
||||||
${TOP}/lib/lwip/src/core/ipv4/ip4_addr.c
|
|
||||||
${TOP}/lib/lwip/src/core/ipv4/ip4_frag.c
|
|
||||||
${TOP}/lib/lwip/src/netif/ethernet.c
|
|
||||||
${TOP}/lib/lwip/src/netif/slipif.c
|
|
||||||
${TOP}/lib/lwip/src/apps/http/httpd.c
|
|
||||||
${TOP}/lib/lwip/src/apps/http/fs.c
|
|
||||||
${TOP}/lib/networking/dhserver.c
|
|
||||||
${TOP}/lib/networking/dnserver.c
|
|
||||||
${TOP}/lib/networking/rndis_reports.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example source
|
# Checks this example is valid for the family and initializes the project
|
||||||
target_sources(${PROJECT} PUBLIC
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
${SRC_LWIP}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
add_executable(${PROJECT})
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
||||||
${TOP}/lib/lwip/src/include
|
|
||||||
${TOP}/lib/lwip/src/include/ipv4
|
|
||||||
${TOP}/lib/lwip/src/include/lwip/apps
|
|
||||||
${TOP}/lib/networking
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example defines
|
# Example source
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
PBUF_POOL_SIZE=2
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
TCP_WND=2*TCP_MSS
|
)
|
||||||
HTTPD_USE_CUSTOM_FSDATA=0
|
|
||||||
)
|
|
||||||
|
|
||||||
else()
|
# Example include
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
endif()
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
${TOP}/lib/lwip/src/include
|
||||||
|
${TOP}/lib/lwip/src/include/ipv4
|
||||||
|
${TOP}/lib/lwip/src/include/lwip/apps
|
||||||
|
${TOP}/lib/networking
|
||||||
|
)
|
||||||
|
|
||||||
|
target_sources(${PROJECT} PUBLIC
|
||||||
|
${TOP}/lib/lwip/src/core/altcp.c
|
||||||
|
${TOP}/lib/lwip/src/core/altcp_alloc.c
|
||||||
|
${TOP}/lib/lwip/src/core/altcp_tcp.c
|
||||||
|
${TOP}/lib/lwip/src/core/def.c
|
||||||
|
${TOP}/lib/lwip/src/core/dns.c
|
||||||
|
${TOP}/lib/lwip/src/core/inet_chksum.c
|
||||||
|
${TOP}/lib/lwip/src/core/init.c
|
||||||
|
${TOP}/lib/lwip/src/core/ip.c
|
||||||
|
${TOP}/lib/lwip/src/core/mem.c
|
||||||
|
${TOP}/lib/lwip/src/core/memp.c
|
||||||
|
${TOP}/lib/lwip/src/core/netif.c
|
||||||
|
${TOP}/lib/lwip/src/core/pbuf.c
|
||||||
|
${TOP}/lib/lwip/src/core/raw.c
|
||||||
|
${TOP}/lib/lwip/src/core/stats.c
|
||||||
|
${TOP}/lib/lwip/src/core/sys.c
|
||||||
|
${TOP}/lib/lwip/src/core/tcp.c
|
||||||
|
${TOP}/lib/lwip/src/core/tcp_in.c
|
||||||
|
${TOP}/lib/lwip/src/core/tcp_out.c
|
||||||
|
${TOP}/lib/lwip/src/core/timeouts.c
|
||||||
|
${TOP}/lib/lwip/src/core/udp.c
|
||||||
|
${TOP}/lib/lwip/src/core/ipv4/autoip.c
|
||||||
|
${TOP}/lib/lwip/src/core/ipv4/dhcp.c
|
||||||
|
${TOP}/lib/lwip/src/core/ipv4/etharp.c
|
||||||
|
${TOP}/lib/lwip/src/core/ipv4/icmp.c
|
||||||
|
${TOP}/lib/lwip/src/core/ipv4/igmp.c
|
||||||
|
${TOP}/lib/lwip/src/core/ipv4/ip4.c
|
||||||
|
${TOP}/lib/lwip/src/core/ipv4/ip4_addr.c
|
||||||
|
${TOP}/lib/lwip/src/core/ipv4/ip4_frag.c
|
||||||
|
${TOP}/lib/lwip/src/netif/ethernet.c
|
||||||
|
${TOP}/lib/lwip/src/netif/slipif.c
|
||||||
|
${TOP}/lib/lwip/src/apps/http/httpd.c
|
||||||
|
${TOP}/lib/lwip/src/apps/http/fs.c
|
||||||
|
${TOP}/lib/networking/dhserver.c
|
||||||
|
${TOP}/lib/networking/dnserver.c
|
||||||
|
${TOP}/lib/networking/rndis_reports.c
|
||||||
|
)
|
||||||
|
|
||||||
|
target_compile_definitions(${PROJECT} PUBLIC
|
||||||
|
PBUF_POOL_SIZE=2
|
||||||
|
TCP_WND=2*TCP_MSS
|
||||||
|
HTTPD_USE_CUSTOM_FSDATA=0
|
||||||
|
)
|
||||||
|
|
||||||
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
|
family_configure_device_example(${PROJECT})
|
||||||
|
endif()
|
@ -1,37 +1,28 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
project(${PROJECT})
|
||||||
|
|
||||||
# Example source
|
# Checks this example is valid for the family and initializes the project
|
||||||
target_sources(${PROJECT} PUBLIC
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
add_executable(${PROJECT})
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example defines
|
# Example source
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
else()
|
# Example include
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
endif()
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
|
family_configure_device_example(${PROJECT})
|
@ -1,38 +1,29 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
project(${PROJECT})
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
# Checks this example is valid for the family and initializes the project
|
||||||
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
# Example source
|
add_executable(${PROJECT})
|
||||||
target_sources(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usbtmc_app.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
# Example source
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usbtmc_app.c
|
||||||
|
)
|
||||||
|
|
||||||
# Example defines
|
# Example include
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
else()
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
endif()
|
family_configure_device_example(${PROJECT})
|
@ -1,37 +1,28 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
project(${PROJECT})
|
||||||
|
|
||||||
# Example source
|
# Checks this example is valid for the family and initializes the project
|
||||||
target_sources(${PROJECT} PUBLIC
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
add_executable(${PROJECT})
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example defines
|
# Example source
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||||
|
)
|
||||||
|
|
||||||
else()
|
# Example include
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
endif()
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
|
family_configure_device_example(${PROJECT})
|
9
examples/host/CMakeLists.txt
Normal file
9
examples/host/CMakeLists.txt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
|
|
||||||
|
project(tinyusb_host_examples)
|
||||||
|
family_initialize_project(tinyusb_host_examples ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
|
# family_add_subdirectory will filter what to actually add based on selected FAMILY
|
||||||
|
family_add_subdirectory(cdc_msc_hid)
|
@ -1,38 +1,29 @@
|
|||||||
# use directory name for project id
|
cmake_minimum_required(VERSION 3.5)
|
||||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
|
||||||
set(PROJECT ${BOARD}-${PROJECT})
|
|
||||||
|
|
||||||
# TOP is absolute path to root directory of TinyUSB git repo
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/${FAMILY}/family.cmake)
|
||||||
set(TOP "../../..")
|
|
||||||
get_filename_component(TOP "${TOP}" REALPATH)
|
|
||||||
|
|
||||||
# Check for -DFAMILY=
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||||
if(FAMILY STREQUAL "rp2040")
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||||
cmake_minimum_required(VERSION 3.12)
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake)
|
|
||||||
project(${PROJECT})
|
|
||||||
add_executable(${PROJECT})
|
|
||||||
|
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
|
project(${PROJECT})
|
||||||
|
|
||||||
# Example source
|
# Checks this example is valid for the family and initializes the project
|
||||||
target_sources(${PROJECT} PUBLIC
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/hid_app.c
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_app.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example include
|
add_executable(${PROJECT})
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
||||||
)
|
|
||||||
|
|
||||||
# Example defines
|
# Example source
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
target_sources(${PROJECT} PUBLIC
|
||||||
CFG_TUSB_OS=OPT_OS_PICO
|
${CMAKE_CURRENT_SOURCE_DIR}/src/hid_app.c
|
||||||
)
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_app.c
|
||||||
|
)
|
||||||
|
|
||||||
else()
|
# Example include
|
||||||
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
|
target_include_directories(${PROJECT} PUBLIC
|
||||||
endif()
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||||
|
# in hw/bsp/FAMILY/family.cmake for details.
|
||||||
|
family_configure_host_example(${PROJECT})
|
@ -4,3 +4,7 @@ cmake_minimum_required(VERSION 3.5)
|
|||||||
set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s2/boards" "${TOP}/hw/bsp/esp32s2/components")
|
set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s2/boards" "${TOP}/hw/bsp/esp32s2/components")
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
set(SUPPORTED_TARGETS esp32s2)
|
set(SUPPORTED_TARGETS esp32s2)
|
||||||
|
|
||||||
|
# include basic family CMake functionality
|
||||||
|
set(FAMILY_MCUS ESP32S2)
|
||||||
|
include(${CMAKE_CURRENT_LIST_DIR}/../family_common.cmake)
|
||||||
|
@ -4,3 +4,7 @@ cmake_minimum_required(VERSION 3.5)
|
|||||||
set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s3/boards" "${TOP}/hw/bsp/esp32s3/components")
|
set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s3/boards" "${TOP}/hw/bsp/esp32s3/components")
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
set(SUPPORTED_TARGETS esp32s3)
|
set(SUPPORTED_TARGETS esp32s3)
|
||||||
|
|
||||||
|
# include basic family CMake functionality
|
||||||
|
set(FAMILY_MCUS ESP32S3)
|
||||||
|
include(${CMAKE_CURRENT_LIST_DIR}/../family_common.cmake)
|
||||||
|
57
hw/bsp/family_common.cmake
Normal file
57
hw/bsp/family_common.cmake
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
if (NOT FAMILY_MCUS)
|
||||||
|
set(FAMILY_MCUS ${FAMILY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# save it in case of re-inclusion
|
||||||
|
set(FAMILY_MCUS ${FAMILY_MCUS} CACHE INTERNAL "")
|
||||||
|
|
||||||
|
function(family_filter RESULT DIR)
|
||||||
|
get_filename_component(DIR ${DIR} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
file(GLOB ONLYS "${DIR}/.only.MCU_*")
|
||||||
|
if (ONLYS)
|
||||||
|
foreach(MCU IN LISTS FAMILY_MCUS)
|
||||||
|
if (EXISTS ${DIR}/.only.MCU_${MCU})
|
||||||
|
set(${RESULT} 1 PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
else()
|
||||||
|
foreach(MCU IN LISTS FAMILY_MCUS)
|
||||||
|
if (EXISTS ${DIR}/.skip.MCU_${MCU})
|
||||||
|
set(${RESULT} 0 PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
set(${RESULT} 1 PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(family_add_subdirectory DIR)
|
||||||
|
family_filter(SHOULD_ADD "${DIR}")
|
||||||
|
if (SHOULD_ADD)
|
||||||
|
add_subdirectory(${DIR})
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(family_get_project_name OUTPUT_NAME DIR)
|
||||||
|
get_filename_component(SHORT_NAME ${DIR} NAME)
|
||||||
|
set(${OUTPUT_NAME} ${TINYUSB_FAMILY_PROJECT_NAME_PREFIX}${SHORT_NAME} PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(family_initialize_project PROJECT DIR)
|
||||||
|
family_filter(ALLOWED "${DIR}")
|
||||||
|
if (NOT ALLOWED)
|
||||||
|
get_filename_component(SHORT_NAME ${DIR} NAME)
|
||||||
|
message(FATAL_ERROR "${SHORT_NAME} is not supported on FAMILY=${FAMILY}")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# configure an executable target to link to tinyusb in device mode, and add the board implementation
|
||||||
|
function(family_configure_device_example TARGET)
|
||||||
|
# default implentation is empty, the function should be redefined in the FAMILY/family.cmake
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# configure an executable target to link to tinyusb in host mode, and add the board implementation
|
||||||
|
function(family_configure_host_example TARGET)
|
||||||
|
# default implentation is empty, the function should be redefined in the FAMILY/family.cmake
|
||||||
|
endfunction()
|
@ -31,16 +31,20 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PICO_DEFAULT_LED_PIN
|
||||||
#define LED_PIN PICO_DEFAULT_LED_PIN
|
#define LED_PIN PICO_DEFAULT_LED_PIN
|
||||||
#define LED_STATE_ON 1
|
#define LED_STATE_ON (!(PICO_DEFAULT_LED_PIN_INVERTED))
|
||||||
|
#endif
|
||||||
|
|
||||||
// Button pin is BOOTSEL which is flash CS pin
|
// Button pin is BOOTSEL which is flash CS pin
|
||||||
#define BUTTON_BOOTSEL
|
#define BUTTON_BOOTSEL
|
||||||
#define BUTTON_STATE_ACTIVE 0
|
#define BUTTON_STATE_ACTIVE 0
|
||||||
|
|
||||||
#define UART_DEV uart0
|
#if defined(PICO_DEFAULT_UART_TX_PIN) && defined(PICO_DEFAULT_UART_RX_PIN) && defined(PICO_DEFAULT_UART)
|
||||||
#define UART_TX_PIN 0
|
#define UART_DEV PICO_DEFAULT_UART
|
||||||
#define UART_RX_PIN 1
|
#define UART_TX_PIN PICO_DEFAULT_UART_TX_PIN
|
||||||
|
#define UART_RX_PIN PICO_DEFAULT_UART_RX_PIN
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
@ -1 +1 @@
|
|||||||
set(PICO_DEFAULT_BOOT_STAGE2_FILE "${PICO_SDK_PATH}/src/rp2_common/boot_stage2/boot2_generic_03h.S")
|
set(PICO_BOARD adafruit_feather_rp2040)
|
@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2021, Ha Thach (tinyusb.org)
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*
|
|
||||||
* This file is part of the TinyUSB stack.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BOARD_H_
|
|
||||||
#define BOARD_H_
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LED_PIN 13
|
|
||||||
#define LED_STATE_ON 1
|
|
||||||
|
|
||||||
#define NEOPIXEL_PIN 16
|
|
||||||
#define NEOPIXEL_POWER_PIN 17
|
|
||||||
#define NEOPIXEL_POWER_STATE 1
|
|
||||||
|
|
||||||
// Button pin is BOOTSEL which is flash CS pin
|
|
||||||
#define BUTTON_BOOTSEL
|
|
||||||
#define BUTTON_STATE_ACTIVE 0
|
|
||||||
|
|
||||||
#define UART_DEV uart0
|
|
||||||
#define UART_TX_PIN 0
|
|
||||||
#define UART_RX_PIN 1
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* BOARD_H_ */
|
|
@ -1 +1 @@
|
|||||||
set(PICO_DEFAULT_BOOT_STAGE2_FILE "${PICO_SDK_PATH}/src/rp2_common/boot_stage2/boot2_w25q080.S")
|
set(PICO_BOARD adafruit_itsybitsy_rp2040)
|
@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2021, Ha Thach (tinyusb.org)
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*
|
|
||||||
* This file is part of the TinyUSB stack.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BOARD_H_
|
|
||||||
#define BOARD_H_
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LED_PIN 11
|
|
||||||
#define LED_STATE_ON 1
|
|
||||||
|
|
||||||
#define NEOPIXEL_PIN 17
|
|
||||||
#define NEOPIXEL_POWER_PIN 16
|
|
||||||
#define NEOPIXEL_POWER_STATE 1
|
|
||||||
|
|
||||||
// Button pin is BOOTSEL which is flash CS pin
|
|
||||||
#define BUTTON_BOOTSEL
|
|
||||||
#define BUTTON_STATE_ACTIVE 0
|
|
||||||
|
|
||||||
#define UART_DEV uart0
|
|
||||||
#define UART_TX_PIN 0
|
|
||||||
#define UART_RX_PIN 1
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* BOARD_H_ */
|
|
@ -1 +0,0 @@
|
|||||||
set(PICO_DEFAULT_BOOT_STAGE2_FILE "${PICO_SDK_PATH}/src/rp2_common/boot_stage2/boot2_w25q080.S")
|
|
@ -1,55 +0,0 @@
|
|||||||
/*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2021, Ha Thach (tinyusb.org)
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*
|
|
||||||
* This file is part of the TinyUSB stack.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BOARD_H_
|
|
||||||
#define BOARD_H_
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO QT RP2040 only has neopixel
|
|
||||||
#define LED_PIN 11
|
|
||||||
#define LED_STATE_ON 1
|
|
||||||
|
|
||||||
#define NEOPIXEL_PIN 12
|
|
||||||
#define NEOPIXEL_POWER_PIN 11
|
|
||||||
#define NEOPIXEL_POWER_STATE 1
|
|
||||||
|
|
||||||
// Button pin is BOOTSEL which is flash CS pin
|
|
||||||
#define BUTTON_BOOTSEL
|
|
||||||
#define BUTTON_STATE_ACTIVE 0
|
|
||||||
|
|
||||||
|
|
||||||
#define UART_DEV uart0
|
|
||||||
#define UART_TX_PIN 0
|
|
||||||
#define UART_RX_PIN 1
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* BOARD_H_ */
|
|
1
hw/bsp/rp2040/boards/adafruit_qtpy_rp2040/board.cmake
Normal file
1
hw/bsp/rp2040/boards/adafruit_qtpy_rp2040/board.cmake
Normal file
@ -0,0 +1 @@
|
|||||||
|
set(PICO_BOARD adafruit_qtpy_rp2040)
|
1
hw/bsp/rp2040/boards/pico_sdk/board.cmake
Normal file
1
hw/bsp/rp2040/boards/pico_sdk/board.cmake
Normal file
@ -0,0 +1 @@
|
|||||||
|
# This builds with settings based purely on the current PICO_BOARD set via the SDK
|
@ -1 +1 @@
|
|||||||
set(PICO_DEFAULT_BOOT_STAGE2_FILE "${PICO_SDK_PATH}/src/rp2_common/boot_stage2/boot2_w25q080.S")
|
set(PICO_BOARD pico)
|
@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pico/stdlib.h"
|
#include "pico/stdlib.h"
|
||||||
|
#include "pico/binary_info.h"
|
||||||
#include "hardware/gpio.h"
|
#include "hardware/gpio.h"
|
||||||
#include "hardware/sync.h"
|
#include "hardware/sync.h"
|
||||||
#include "hardware/structs/ioqspi.h"
|
#include "hardware/structs/ioqspi.h"
|
||||||
@ -110,10 +111,14 @@ void stdio_rtt_init(void)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef UART_DEV
|
||||||
|
static uart_inst_t *uart_inst;
|
||||||
|
#endif
|
||||||
|
|
||||||
void board_init(void)
|
void board_init(void)
|
||||||
{
|
{
|
||||||
#ifdef LED_PIN
|
#ifdef LED_PIN
|
||||||
|
bi_decl(bi_1pin_with_name(LED_PIN, "LED"));
|
||||||
gpio_init(LED_PIN);
|
gpio_init(LED_PIN);
|
||||||
gpio_set_dir(LED_PIN, GPIO_OUT);
|
gpio_set_dir(LED_PIN, GPIO_OUT);
|
||||||
#endif
|
#endif
|
||||||
@ -122,8 +127,10 @@ void board_init(void)
|
|||||||
#ifndef BUTTON_BOOTSEL
|
#ifndef BUTTON_BOOTSEL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef UART_DEV
|
#if defined(UART_DEV) && defined(LIB_PICO_STDIO_UART)
|
||||||
stdio_uart_init_full(UART_DEV, CFG_BOARD_UART_BAUDRATE, UART_TX_PIN, UART_RX_PIN);
|
bi_decl(bi_2pins_with_func(UART_TX_PIN, UART_TX_PIN, GPIO_FUNC_UART));
|
||||||
|
uart_inst = uart_get_instance(UART_DEV);
|
||||||
|
stdio_uart_init_full(uart_inst, CFG_BOARD_UART_BAUDRATE, UART_TX_PIN, UART_RX_PIN);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(LOGGER_RTT)
|
#if defined(LOGGER_RTT)
|
||||||
@ -164,7 +171,7 @@ int board_uart_read(uint8_t* buf, int len)
|
|||||||
{
|
{
|
||||||
#ifdef UART_DEV
|
#ifdef UART_DEV
|
||||||
for(int i=0;i<len;i++) {
|
for(int i=0;i<len;i++) {
|
||||||
buf[i] = uart_getc(UART_DEV);
|
buf[i] = uart_getc(uart_inst);
|
||||||
}
|
}
|
||||||
return len;
|
return len;
|
||||||
#else
|
#else
|
||||||
@ -175,9 +182,9 @@ int board_uart_read(uint8_t* buf, int len)
|
|||||||
int board_uart_write(void const * buf, int len)
|
int board_uart_write(void const * buf, int len)
|
||||||
{
|
{
|
||||||
#ifdef UART_DEV
|
#ifdef UART_DEV
|
||||||
char const* bufch = (uint8_t const*) buf;
|
char const* bufch = (char const*) buf;
|
||||||
for(int i=0;i<len;i++) {
|
for(int i=0;i<len;i++) {
|
||||||
uart_putc(UART_DEV, bufch[i]);
|
uart_putc(uart_inst, bufch[i]);
|
||||||
}
|
}
|
||||||
return len;
|
return len;
|
||||||
#else
|
#else
|
||||||
|
@ -1,77 +1,154 @@
|
|||||||
# Board specific define e.g boot stage2
|
cmake_minimum_required(VERSION 3.13)
|
||||||
# PICO_DEFAULT_BOOT_STAGE2_FILE must be set before pico_sdk_init()
|
if (NOT TARGET _rp2040_family_inclusion_marker)
|
||||||
include(${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake)
|
add_library(_rp2040_family_inclusion_marker INTERFACE)
|
||||||
|
|
||||||
pico_sdk_init()
|
if (NOT BOARD)
|
||||||
|
message(FATAL_ERROR "BOARD must be specified")
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(${PROJECT}
|
# add the SDK in case we are standalone tinyusb example (noop if already present)
|
||||||
pico_stdlib
|
include(${CMAKE_CURRENT_LIST_DIR}/pico_sdk_import.cmake)
|
||||||
pico_bootsel_via_double_reset
|
|
||||||
pico_fix_rp2040_usb_device_enumeration
|
|
||||||
)
|
|
||||||
|
|
||||||
pico_add_extra_outputs(${PROJECT})
|
# include basic family CMake functionality
|
||||||
pico_enable_stdio_uart(${PROJECT} 1)
|
set(FAMILY_MCUS RP2040)
|
||||||
|
include(${CMAKE_CURRENT_LIST_DIR}/../family_common.cmake)
|
||||||
|
|
||||||
# TinyUSB Stack source
|
include(${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake)
|
||||||
set(SRC_TINYUSB
|
|
||||||
${TOP}/src/tusb.c
|
|
||||||
${TOP}/src/common/tusb_fifo.c
|
|
||||||
${TOP}/src/device/usbd.c
|
|
||||||
${TOP}/src/device/usbd_control.c
|
|
||||||
${TOP}/src/class/audio/audio_device.c
|
|
||||||
${TOP}/src/class/cdc/cdc_device.c
|
|
||||||
${TOP}/src/class/dfu/dfu_device.c
|
|
||||||
${TOP}/src/class/dfu/dfu_rt_device.c
|
|
||||||
${TOP}/src/class/hid/hid_device.c
|
|
||||||
${TOP}/src/class/midi/midi_device.c
|
|
||||||
${TOP}/src/class/msc/msc_device.c
|
|
||||||
${TOP}/src/class/net/net_device.c
|
|
||||||
${TOP}/src/class/usbtmc/usbtmc_device.c
|
|
||||||
${TOP}/src/class/vendor/vendor_device.c
|
|
||||||
${TOP}/src/host/hub.c
|
|
||||||
${TOP}/src/host/usbh.c
|
|
||||||
${TOP}/src/host/usbh_control.c
|
|
||||||
${TOP}/src/class/cdc/cdc_host.c
|
|
||||||
${TOP}/src/class/hid/hid_host.c
|
|
||||||
${TOP}/src/class/msc/msc_host.c
|
|
||||||
${TOP}/src/portable/raspberrypi/${FAMILY}/rp2040_usb.c
|
|
||||||
${TOP}/src/portable/raspberrypi/${FAMILY}/dcd_rp2040.c
|
|
||||||
${TOP}/src/portable/raspberrypi/${FAMILY}/hcd_rp2040.c
|
|
||||||
)
|
|
||||||
|
|
||||||
target_sources(${PROJECT} PUBLIC
|
# TOP is absolute path to root directory of TinyUSB git repo
|
||||||
${TOP}/hw/bsp/${FAMILY}/family.c
|
set(TOP "${CMAKE_CURRENT_LIST_DIR}/../../..")
|
||||||
${SRC_TINYUSB}
|
get_filename_component(TOP "${TOP}" REALPATH)
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
if (NOT PICO_TINYUSB_PATH)
|
||||||
${TOP}/hw
|
set(PICO_TINYUSB_PATH ${TOP})
|
||||||
${TOP}/src
|
endif()
|
||||||
${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
# Base config for both device and host; wrapped by SDK's tinyusb_common
|
||||||
CFG_TUSB_MCU=OPT_MCU_RP2040
|
add_library(tinyusb_common_base INTERFACE)
|
||||||
PICO_RP2040_USB_DEVICE_ENUMERATION_FIX=1
|
|
||||||
)
|
target_sources(tinyusb_common_base INTERFACE
|
||||||
|
${TOP}/src/tusb.c
|
||||||
|
${TOP}/src/common/tusb_fifo.c
|
||||||
|
)
|
||||||
|
|
||||||
if(DEFINED LOG)
|
target_include_directories(tinyusb_common_base INTERFACE
|
||||||
target_compile_definitions(${PROJECT} PUBLIC CFG_TUSB_DEBUG=${LOG} )
|
${TOP}/src
|
||||||
|
${TOP}/src/common
|
||||||
|
${TOP}/hw
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(tinyusb_common_base INTERFACE
|
||||||
|
hardware_structs
|
||||||
|
hardware_irq
|
||||||
|
hardware_resets
|
||||||
|
pico_sync
|
||||||
|
)
|
||||||
|
|
||||||
|
set(TINYUSB_DEBUG_LEVEL 0)
|
||||||
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
message("Compiling TinyUSB with CFG_TUSB_DEBUG=1")
|
||||||
|
set(TINYUSB_DEBUG_LEVEL 1)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
target_compile_definitions(tinyusb_common_base INTERFACE
|
||||||
|
CFG_TUSB_MCU=OPT_MCU_RP2040
|
||||||
|
CFG_TUSB_OS=OPT_OS_PICO
|
||||||
|
CFG_TUSB_DEBUG=${TINYUSB_DEBUG_LEVEL}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Base config for device mode; wrapped by SDK's tinyusb_device
|
||||||
|
add_library(tinyusb_device_base INTERFACE)
|
||||||
|
target_sources(tinyusb_device_base INTERFACE
|
||||||
|
${TOP}/src/portable/raspberrypi/rp2040/dcd_rp2040.c
|
||||||
|
${TOP}/src/portable/raspberrypi/rp2040/rp2040_usb.c
|
||||||
|
${TOP}/src/device/usbd.c
|
||||||
|
${TOP}/src/device/usbd_control.c
|
||||||
|
${TOP}/src/class/audio/audio_device.c
|
||||||
|
${TOP}/src/class/cdc/cdc_device.c
|
||||||
|
${TOP}/src/class/dfu/dfu_device.c
|
||||||
|
${TOP}/src/class/dfu/dfu_rt_device.c
|
||||||
|
${TOP}/src/class/hid/hid_device.c
|
||||||
|
${TOP}/src/class/midi/midi_device.c
|
||||||
|
${TOP}/src/class/msc/msc_device.c
|
||||||
|
${TOP}/src/class/net/net_device.c
|
||||||
|
${TOP}/src/class/usbtmc/usbtmc_device.c
|
||||||
|
${TOP}/src/class/vendor/vendor_device.c
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Base config for host mode; wrapped by SDK's tinyusb_host
|
||||||
|
add_library(tinyusb_host_base INTERFACE)
|
||||||
|
target_sources(tinyusb_host_base INTERFACE
|
||||||
|
${TOP}/src/portable/raspberrypi/rp2040/hcd_rp2040.c
|
||||||
|
${TOP}/src/portable/raspberrypi/rp2040/rp2040_usb.c
|
||||||
|
${TOP}/src/host/usbh.c
|
||||||
|
${TOP}/src/host/usbh_control.c
|
||||||
|
${TOP}/src/host/hub.c
|
||||||
|
${TOP}/src/class/cdc/cdc_host.c
|
||||||
|
${TOP}/src/class/hid/hid_host.c
|
||||||
|
${TOP}/src/class/msc/msc_host.c
|
||||||
|
${TOP}/src/class/vendor/vendor_host.c
|
||||||
|
)
|
||||||
|
|
||||||
|
# Sometimes have to do host specific actions in mostly
|
||||||
|
# common functions
|
||||||
|
target_compile_definitions(tinyusb_host_base INTERFACE
|
||||||
|
RP2040_USB_HOST_MODE=1
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(tinyusb_bsp INTERFACE)
|
||||||
|
target_sources(tinyusb_bsp INTERFACE
|
||||||
|
${TOP}/hw/bsp/rp2040/family.c
|
||||||
|
)
|
||||||
|
# target_include_directories(tinyusb_bsp INTERFACE
|
||||||
|
# ${TOP}/hw/bsp/rp2040)
|
||||||
|
|
||||||
|
# tinyusb_additions will hold our extra settings for examples
|
||||||
|
add_library(tinyusb_additions INTERFACE)
|
||||||
|
|
||||||
|
target_compile_definitions(tinyusb_additions INTERFACE
|
||||||
|
PICO_RP2040_USB_DEVICE_ENUMERATION_FIX=1
|
||||||
|
)
|
||||||
|
|
||||||
|
if(DEFINED LOG)
|
||||||
|
target_compile_definitions(tinyusb_additions INTERFACE CFG_TUSB_DEBUG=${LOG} )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(LOGGER STREQUAL "rtt")
|
||||||
|
target_compile_definitions(tinyusb_additions INTERFACE
|
||||||
|
LOGGER_RTT
|
||||||
|
SEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
|
||||||
|
)
|
||||||
|
|
||||||
|
target_sources(tinyusb_additions INTERFACE
|
||||||
|
${TOP}/lib/SEGGER_RTT/RTT/SEGGER_RTT.c
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(tinyusb_additions INTERFACE
|
||||||
|
${TOP}/lib/SEGGER_RTT/RTT
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
function(family_configure_target TARGET)
|
||||||
|
pico_add_extra_outputs(${TARGET})
|
||||||
|
pico_enable_stdio_uart(${TARGET} 1)
|
||||||
|
target_link_libraries(${TARGET} PUBLIC pico_stdlib pico_bootsel_via_double_reset tinyusb_board tinyusb_additions)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(family_configure_device_example TARGET)
|
||||||
|
family_configure_target(${TARGET})
|
||||||
|
target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_device)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(family_configure_host_example TARGET)
|
||||||
|
family_configure_target(${TARGET})
|
||||||
|
target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_host)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(family_initialize_project PROJECT DIR)
|
||||||
|
# call the original version of this function from family_common.cmake
|
||||||
|
_family_initialize_project(${PROJECT} ${DIR})
|
||||||
|
enable_language(C CXX ASM)
|
||||||
|
pico_sdk_init()
|
||||||
|
endfunction()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(LOGGER STREQUAL "rtt")
|
|
||||||
target_compile_definitions(${PROJECT} PUBLIC
|
|
||||||
LOGGER_RTT
|
|
||||||
SEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
|
|
||||||
)
|
|
||||||
|
|
||||||
target_sources(${PROJECT} PUBLIC
|
|
||||||
${TOP}/lib/SEGGER_RTT/RTT/SEGGER_RTT.c
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(${PROJECT} PUBLIC
|
|
||||||
${TOP}/lib/SEGGER_RTT/RTT
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
@ -296,7 +296,6 @@ static void _hw_endpoint_init(struct hw_endpoint *ep, uint8_t dev_addr, uint8_t
|
|||||||
uint8_t const num = tu_edpt_number(ep_addr);
|
uint8_t const num = tu_edpt_number(ep_addr);
|
||||||
tusb_dir_t const dir = tu_edpt_dir(ep_addr);
|
tusb_dir_t const dir = tu_edpt_dir(ep_addr);
|
||||||
|
|
||||||
bool in = ep_addr & TUSB_DIR_IN_MASK;
|
|
||||||
ep->ep_addr = ep_addr;
|
ep->ep_addr = ep_addr;
|
||||||
ep->dev_addr = dev_addr;
|
ep->dev_addr = dev_addr;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user