2021-02-03 12:49:34 +01:00
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
|
2023-12-31 21:43:31 +01:00
|
|
|
option(FLOW_CONTROL "Enable Hardware Flow-control on the UARTs" FALSE)
|
2023-12-31 21:57:14 +01:00
|
|
|
option(LINE_CONTROL "Enable Hardware Line-control on the UARTs" FALSE)
|
2023-12-31 21:43:31 +01:00
|
|
|
|
2021-02-03 12:49:34 +01:00
|
|
|
include(pico-sdk/pico_sdk_init.cmake)
|
|
|
|
|
|
|
|
project(pico_uart_bridge)
|
|
|
|
|
|
|
|
pico_sdk_init()
|
2022-11-04 10:58:51 +01:00
|
|
|
|
2021-02-03 12:49:34 +01:00
|
|
|
add_executable(uart_bridge uart-bridge.c usb-descriptors.c)
|
|
|
|
|
|
|
|
target_include_directories(uart_bridge PUBLIC
|
2021-02-04 09:02:27 +01:00
|
|
|
./
|
|
|
|
pico-sdk/lib/tinyusb/src)
|
2021-02-03 12:49:34 +01:00
|
|
|
|
|
|
|
target_link_libraries(uart_bridge
|
2022-11-03 18:12:56 +01:00
|
|
|
hardware_flash
|
2021-02-03 12:49:34 +01:00
|
|
|
pico_multicore
|
|
|
|
pico_stdlib
|
|
|
|
tinyusb_device)
|
|
|
|
|
2023-12-31 21:43:31 +01:00
|
|
|
if(FLOW_CONTROL)
|
|
|
|
target_compile_definitions(uart_bridge PUBLIC FLOW_CONTROL=1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(LINE_CONTROL)
|
|
|
|
target_compile_definitions(uart_bridge PUBLIC LINE_CONTROL=1)
|
|
|
|
endif()
|
|
|
|
|
2021-02-03 12:49:34 +01:00
|
|
|
pico_add_extra_outputs(uart_bridge)
|