-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'eab4425b9009776dec5a41738248ef303ce8fedc' as 'Software/…
…pico-uart-bridge'
- Loading branch information
Showing
11 changed files
with
598 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: CI | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
CI: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: 'Check out code' | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Install dependencies' | ||
run: | | ||
sudo apt-get install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi | ||
- name: 'Update Submodules' | ||
run: | | ||
git submodule sync --recursive | ||
git submodule update --init --recursive | ||
- name: 'Configure' | ||
run: | | ||
mkdir -p build | ||
cmake -B build | ||
- name: 'Build' | ||
run: | | ||
make -C build | ||
- name: 'Upload binary' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pico-uart-bridge.uf2 | ||
path: build/uart_bridge.uf2 | ||
retention-days: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.vscode | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "pico-sdk"] | ||
path = pico-sdk | ||
url = https://github.com/raspberrypi/pico-sdk.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# SPDX-License-Identifier: MIT | ||
|
||
cmake_minimum_required(VERSION 3.13) | ||
|
||
include(pico-sdk/pico_sdk_init.cmake) | ||
|
||
project(pico_uart_bridge) | ||
|
||
pico_sdk_init() | ||
|
||
add_executable(uart_bridge uart-bridge.c usb-descriptors.c) | ||
|
||
target_include_directories(uart_bridge PUBLIC | ||
./ | ||
pico-sdk/lib/tinyusb/src) | ||
|
||
target_link_libraries(uart_bridge | ||
hardware_flash | ||
pico_multicore | ||
pico_stdlib | ||
tinyusb_device) | ||
|
||
pico_add_extra_outputs(uart_bridge) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
The MIT License (MIT) | ||
===================== | ||
|
||
Copyright © 2021 Álvaro Fernández Rojas <[email protected]> | ||
|
||
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 contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Raspberry Pi Pico USB-UART Bridge | ||
================================= | ||
|
||
This program bridges the Raspberry Pi Pico HW UARTs to two independent USB CDC serial devices in order to behave like any other USB-to-UART Bridge controllers. | ||
|
||
Disclaimer | ||
---------- | ||
|
||
This software is provided without warranty, according to the MIT License, and should therefore not be used where it may endanger life, financial stakes, or cause discomfort and inconvenience to others. | ||
|
||
Raspberry Pi Pico Pinout | ||
------------------------ | ||
|
||
| Raspberry Pi Pico GPIO | Function | | ||
|:----------------------:|:--------:| | ||
| GPIO16 (Pin 21) | UART0 TX | | ||
| GPIO17 (Pin 22) | UART0 RX | | ||
| GPIO4 (Pin 6) | UART1 TX | | ||
| GPIO5 (Pin 7) | UART1 RX | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
BASE_DIR="$(dirname ${BASH_SOURCE[0]})" | ||
BUILD_DIR=$BASE_DIR/build | ||
PICO_SDK_DIR=$BASE_DIR/pico-sdk | ||
|
||
main() { | ||
if [ ! -d "$PICO_SDK_DIR/.git" ]; then | ||
git submodule sync --recursive | ||
git submodule update --init --recursive | ||
fi | ||
|
||
cmake -B $BUILD_DIR -S $BASE_DIR | ||
make -C $BUILD_DIR | ||
} | ||
|
||
main $@ |
Submodule pico-sdk
added at
6a7db3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: MIT | ||
/* | ||
* Copyright (c) 2021 Álvaro Fernández Rojas <[email protected]> | ||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd. | ||
* Copyright (c) 2020 Damien P. George | ||
*/ | ||
|
||
#if !defined(_TUSB_CONFIG_H_) | ||
#define _TUSB_CONFIG_H_ | ||
|
||
#include <tusb_option.h> | ||
|
||
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE | ||
|
||
#define CFG_TUD_CDC 2 | ||
#define CFG_TUD_CDC_RX_BUFSIZE 1024 | ||
#define CFG_TUD_CDC_TX_BUFSIZE 1024 | ||
|
||
void usbd_serial_init(void); | ||
|
||
#endif /* _TUSB_CONFIG_H_ */ |
Oops, something went wrong.