mirror of
https://codeberg.org/libreboot/tinyusb.git
synced 2025-07-04 08:17:04 +00:00
Compare commits
No commits in common. "master" and "0.11.0" have entirely different histories.
1698 changed files with 34073 additions and 149831 deletions
10
.codespellrc
10
.codespellrc
|
@ -1,10 +0,0 @@
|
|||
# See: https://github.com/codespell-project/codespell#using-a-config-file
|
||||
[codespell]
|
||||
# In the event of a false positive, add the problematic word, in all lowercase, to 'ignore-words.txt' (one word per line).
|
||||
# Or copy & paste the whole problematic line to 'exclude-file.txt'
|
||||
ignore-words = tools/codespell/ignore-words.txt
|
||||
exclude-file = tools/codespell/exclude-file.txt
|
||||
check-filenames =
|
||||
check-hidden =
|
||||
count =
|
||||
skip = *.rb,.cproject,.git,./lib,./examples/*/*/_build,./examples/*/*/ses,./examples/*/*/ozone,./hw/mcu,./tests_obsolete
|
24
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
24
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
@ -33,10 +33,8 @@ body:
|
|||
attributes:
|
||||
label: Firmware
|
||||
placeholder: |
|
||||
e.g examples/device/cdc_msc. If it is custom firmware, it is preferably compiled like one in example folder and reviewable for people to comment on. The easiest way is
|
||||
- Fork this repo, checkout a new branch
|
||||
- Add your-own-example based on stock one
|
||||
- Push and post it here.
|
||||
e.g examples/device/cdc_msc.
|
||||
If it is custom firmware, please provide links to your minimal sources or as attached files.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
@ -51,7 +49,6 @@ body:
|
|||
attributes:
|
||||
label: How to reproduce ?
|
||||
placeholder: |
|
||||
Exact steps in chronological order, details should be specific e.g if you use a command/script to test with, please post it as well.
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. See error
|
||||
|
@ -60,15 +57,14 @@ body:
|
|||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
|
||||
label: Debug Log
|
||||
placeholder: |
|
||||
Attach your debug log txt file here, where the issue occurred, best with comments to explain the actual events.
|
||||
TinyUSB debug log where the issue occurred as attached txt file, best with comments to explain the actual events.
|
||||
|
||||
Note1: Please DO NOT paste your lengthy log contents here since it hurts the readability.
|
||||
Note2: To enable logging, add `LOG=2` to to the make command if building with stock examples or set `CFG_TUSB_DEBUG=2` in your tusb_config.h.
|
||||
Note: To enable logging, add `LOG=3` to to the make command if building with stock examples or set `CFG_TUSB_DEBUG=3` in your tusb_config.h.
|
||||
More information can be found at [example's readme](https://github.com/hathach/tinyusb/blob/master/docs/getting_started.md)
|
||||
validations:
|
||||
required: true
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
|
@ -76,11 +72,3 @@ body:
|
|||
description: If applicable, add screenshots to help explain your problem.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: I have checked existing issues, dicussion and documentation
|
||||
description: You agree to check all the resources above before opening a new issue.
|
||||
options:
|
||||
- label: I confirm I have checked existing issues, dicussion and documentation.
|
||||
required: true
|
||||
|
|
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
|
@ -1,8 +1,4 @@
|
|||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: TinyUSB Discussion
|
||||
url: https://github.com/hathach/tinyusb/discussions
|
||||
about: If you have other questions or need help, post it here.
|
||||
- name: TinyUSB Docs
|
||||
url: https://docs.tinyusb.org/
|
||||
about: Online documentation
|
||||
|
|
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
name: Feature Request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: Feature 💡
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
49
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
49
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
|
@ -1,49 +0,0 @@
|
|||
name: Feature Request
|
||||
description: Suggest an idea for this project
|
||||
labels: 'Feature 💡'
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this request!
|
||||
It's okay to leave some blank if it doesn't apply to your request.
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: Related area
|
||||
description: Please briefly explain the area of your Feature Request.
|
||||
placeholder: eg. new port support, device stack, class driver ...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: Hardware specification
|
||||
description: Please provide if your proposal depends on specific Hardware.
|
||||
placeholder: eg. rp2040, samd51 ...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Is your feature request related to a problem?
|
||||
description: Please provide a clear and concise description of what the problem is. Add relevant issue link.
|
||||
placeholder: ex. I'm facing the issue/missing function...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the solution you'd like
|
||||
description: Please provide a clear and concise description of what you want to happen.
|
||||
placeholder: ex. When using this function...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: I have checked existing issues, dicussion and documentation
|
||||
description: You agree to check all the resources above before opening a new issue.
|
||||
options:
|
||||
- label: I confirm I have checked existing issues, dicussion and documentation.
|
||||
required: true
|
144
.github/workflows/build.yml
vendored
Normal file
144
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,144 @@
|
|||
name: Build ARM
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
jobs:
|
||||
# ---------------------------------------
|
||||
# Unit testing with Ceedling
|
||||
# ---------------------------------------
|
||||
unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Ruby
|
||||
uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '2.7'
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Unit Tests
|
||||
run: |
|
||||
# Install Ceedling
|
||||
gem install ceedling
|
||||
cd test
|
||||
ceedling test:all
|
||||
|
||||
# ---------------------------------------
|
||||
# Build ARM family
|
||||
# ---------------------------------------
|
||||
build-arm:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
family:
|
||||
# Alphabetical order
|
||||
- 'imxrt'
|
||||
- 'lpc15'
|
||||
- 'lpc18'
|
||||
- 'lpc54'
|
||||
- 'lpc55'
|
||||
- 'nrf'
|
||||
- 'rp2040'
|
||||
- 'samd11'
|
||||
- 'samd21'
|
||||
- 'samd51'
|
||||
- 'saml2x'
|
||||
- 'stm32f0'
|
||||
- 'stm32f1'
|
||||
- 'stm32f4'
|
||||
- 'stm32f7'
|
||||
- 'stm32h7'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Checkout common submodules in lib
|
||||
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
|
||||
|
||||
- name: Checkout pico-sdk
|
||||
if: matrix.family == 'rp2040'
|
||||
run: |
|
||||
git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
|
||||
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
|
||||
|
||||
- name: Set Toolchain URL
|
||||
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz
|
||||
|
||||
- name: Cache Toolchain
|
||||
uses: actions/cache@v2
|
||||
id: cache-toolchain
|
||||
with:
|
||||
path: ~/cache/
|
||||
key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
|
||||
|
||||
- name: Install Toolchain
|
||||
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
mkdir -p ~/cache/toolchain
|
||||
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
|
||||
tar -C ~/cache/toolchain -xaf toolchain.tar.gz
|
||||
|
||||
- name: Set Toolchain Path
|
||||
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py ${{ matrix.family }}
|
||||
|
||||
# ---------------------------------------
|
||||
# Build all no-family (opharned) boards
|
||||
# ---------------------------------------
|
||||
build-board:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
example:
|
||||
# Alphabetical order, a group of 4
|
||||
- 'device/audio_test device/board_test device/cdc_dual_ports device/cdc_msc'
|
||||
- 'device/cdc_msc_freertos device/dfu_runtime device/hid_composite device/hid_composite_freertos'
|
||||
- 'device/hid_generic_inout device/hid_multiple_interface device/midi_test device/msc_dual_lun'
|
||||
- 'device/net_lwip_webserver'
|
||||
- 'device/uac2_headset device/usbtmc device/webusb_serial host/cdc_msc_hid'
|
||||
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Checkout common submodules in lib
|
||||
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
|
||||
|
||||
- name: Set Toolchain URL
|
||||
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz
|
||||
|
||||
- name: Cache Toolchain
|
||||
uses: actions/cache@v2
|
||||
id: cache-toolchain
|
||||
with:
|
||||
path: ~/cache/
|
||||
key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }}
|
||||
|
||||
- name: Install Toolchain
|
||||
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
mkdir -p ~/cache/toolchain
|
||||
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
|
||||
tar -C ~/cache/toolchain -xaf toolchain.tar.gz
|
||||
|
||||
- name: Set Toolchain Path
|
||||
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_board.py ${{ matrix.example }}
|
84
.github/workflows/build_aarch64.yml
vendored
84
.github/workflows/build_aarch64.yml
vendored
|
@ -1,84 +0,0 @@
|
|||
name: Build AArch64
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_aarch64.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_aarch64.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# ---------------------------------------
|
||||
# Build AARCH64 family
|
||||
# ---------------------------------------
|
||||
build-arm:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
family:
|
||||
# Alphabetical order
|
||||
- 'broadcom_64bit'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Checkout hathach/linkermap
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: hathach/linkermap
|
||||
path: linkermap
|
||||
|
||||
- name: Set Toolchain URL
|
||||
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz
|
||||
|
||||
- name: Cache Toolchain
|
||||
uses: actions/cache@v3
|
||||
id: cache-toolchain
|
||||
with:
|
||||
path: ~/cache/
|
||||
key: ${{ runner.os }}-21-11-02-${{ env.TOOLCHAIN_URL }}
|
||||
|
||||
- name: Install Toolchain
|
||||
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
mkdir -p ~/cache/toolchain
|
||||
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
|
||||
tar -C ~/cache/toolchain -xaf toolchain.tar.gz
|
||||
|
||||
- name: Set Toolchain Path
|
||||
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
|
||||
|
||||
- name: Get Dependencies
|
||||
run: python3 tools/get_deps.py ${{ matrix.family }}
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py ${{ matrix.family }}
|
||||
|
||||
- name: Linker Map
|
||||
run: |
|
||||
pip install linkermap/
|
||||
for ex in `ls -d examples/device/*/`; do \
|
||||
find ${ex} -name *.map -print -quit | \
|
||||
xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
|
||||
done
|
78
.github/workflows/build_arm.yml
vendored
78
.github/workflows/build_arm.yml
vendored
|
@ -1,78 +0,0 @@
|
|||
name: Build ARM
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_arm.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_arm.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# ---------------------------------------
|
||||
# Build ARM family
|
||||
# ---------------------------------------
|
||||
build-arm:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
family:
|
||||
# Alphabetical order
|
||||
- 'broadcom_32bit'
|
||||
- 'kinetis_k32l2'
|
||||
- 'lpc11 lpc13 lpc15 lpc17'
|
||||
- 'lpc51'
|
||||
- 'mm32 msp432e4'
|
||||
- 'samd11 same5x saml2x'
|
||||
- 'stm32f2 stm32f3'
|
||||
- 'stm32l0 stm32wb'
|
||||
- 'tm4c123 xmc4000'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install ARM GCC
|
||||
uses: carlosperate/arm-none-eabi-gcc-action@v1
|
||||
with:
|
||||
release: '11.2-2022.02'
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Checkout hathach/linkermap
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: hathach/linkermap
|
||||
path: linkermap
|
||||
|
||||
- name: Get Dependencies
|
||||
run: python3 tools/get_deps.py ${{ matrix.family }}
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py ${{ matrix.family }}
|
||||
|
||||
- name: Linker Map
|
||||
run: |
|
||||
pip install linkermap/
|
||||
# find -quit to only print linkermap of 1 board per example
|
||||
for ex in `ls -d examples/*/*/`
|
||||
do
|
||||
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
|
||||
done
|
37
.github/workflows/build_esp.yml
vendored
37
.github/workflows/build_esp.yml
vendored
|
@ -1,26 +1,11 @@
|
|||
name: Build ESP
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_esp.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_esp.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
push:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
jobs:
|
||||
build-esp:
|
||||
|
@ -29,22 +14,22 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
board:
|
||||
# Alphabetical order
|
||||
# ESP32-S2
|
||||
- 'espressif_kaluga_1'
|
||||
- 'espressif_saola_1'
|
||||
# ESP32-S3
|
||||
- 'espressif_s3_devkitm'
|
||||
# latest IDF does not define USB0 in linker
|
||||
#- 'espressif_addax_1'
|
||||
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
uses: actions/setup-python@v2
|
||||
|
||||
- name: Pull ESP-IDF docker
|
||||
run: docker pull espressif/idf:latest
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build
|
||||
run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32.py ${{ matrix.board }}
|
||||
run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32sx.py ${{ matrix.board }}
|
||||
|
|
54
.github/workflows/build_iar.yml
vendored
54
.github/workflows/build_iar.yml
vendored
|
@ -1,54 +0,0 @@
|
|||
name: Build IAR
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_iar.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_iar.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
cmake:
|
||||
runs-on: [self-hosted, Linux, X64, hifiphile]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
family:
|
||||
# Alphabetical order
|
||||
# Note: bundle multiple families into a matrix since there is only one self-hosted instance can
|
||||
# run IAR build. Too many matrix can hurt due to setup/teardown overhead.
|
||||
- 'lpc43 stm32f0 stm32f1 stm32f4 stm32f7 stm32g0 stm32g4 stm32h7 stm32l4'
|
||||
steps:
|
||||
- name: Clean workspace
|
||||
run: |
|
||||
echo "Cleaning up previous run"
|
||||
rm -rf "${{ github.workspace }}"
|
||||
mkdir -p "${{ github.workspace }}"
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Get Dependencies
|
||||
run: python3 tools/get_deps.py ${{ matrix.family }}
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=iar -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||
|
||||
- name: Test on actual hardware (hardware in the loop)
|
||||
run: |
|
||||
python3 test/hil/hil_test.py hil_hfp.json
|
51
.github/workflows/build_msp430.yml
vendored
51
.github/workflows/build_msp430.yml
vendored
|
@ -1,26 +1,11 @@
|
|||
name: Build MSP430
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_msp430.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_msp430.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
push:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
jobs:
|
||||
build-msp430:
|
||||
|
@ -31,27 +16,21 @@ jobs:
|
|||
family:
|
||||
# Alphabetical order
|
||||
- 'msp430'
|
||||
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
uses: actions/setup-python@v2
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Checkout hathach/linkermap
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: hathach/linkermap
|
||||
path: linkermap
|
||||
- name: Checkout common submodules in lib
|
||||
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
|
||||
|
||||
- name: Set Toolchain URL
|
||||
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2
|
||||
|
||||
- name: Cache Toolchain
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v2
|
||||
id: cache-toolchain
|
||||
with:
|
||||
path: ~/cache/
|
||||
|
@ -67,17 +46,5 @@ jobs:
|
|||
- name: Set Toolchain Path
|
||||
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
|
||||
|
||||
- name: Get Dependencies
|
||||
run: python3 tools/get_deps.py ${{ matrix.family }}
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py ${{ matrix.family }}
|
||||
|
||||
- name: Linker Map
|
||||
run: |
|
||||
pip install linkermap/
|
||||
# find -quit to only print linkermap of 1 board per example
|
||||
for ex in `ls -d examples/device/*/`
|
||||
do
|
||||
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
|
||||
done
|
||||
|
|
50
.github/workflows/build_renesas.yml
vendored
50
.github/workflows/build_renesas.yml
vendored
|
@ -1,26 +1,11 @@
|
|||
name: Build Renesas
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_renesas.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_renesas.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
push:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
jobs:
|
||||
build-rx:
|
||||
|
@ -33,24 +18,19 @@ jobs:
|
|||
- 'rx'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
uses: actions/setup-python@v2
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Checkout hathach/linkermap
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: hathach/linkermap
|
||||
path: linkermap
|
||||
- name: Checkout common submodules in lib
|
||||
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
|
||||
|
||||
- name: Set Toolchain URL
|
||||
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run
|
||||
|
||||
- name: Cache Toolchain
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v2
|
||||
id: cache-toolchain
|
||||
with:
|
||||
path: ~/cache/
|
||||
|
@ -67,17 +47,5 @@ jobs:
|
|||
- name: Set Toolchain Path
|
||||
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
|
||||
|
||||
- name: Get Dependencies
|
||||
run: python3 tools/get_deps.py ${{ matrix.family }}
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py ${{ matrix.family }}
|
||||
|
||||
- name: Linker Map
|
||||
run: |
|
||||
pip install linkermap/
|
||||
# find -quit to only print linkermap of 1 board per example
|
||||
for ex in `ls -d examples/device/*/`
|
||||
do
|
||||
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
|
||||
done
|
||||
|
|
51
.github/workflows/build_riscv.yml
vendored
51
.github/workflows/build_riscv.yml
vendored
|
@ -1,26 +1,11 @@
|
|||
name: Build RISC-V
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_riscv.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_riscv.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
push:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
jobs:
|
||||
build-riscv:
|
||||
|
@ -30,29 +15,23 @@ jobs:
|
|||
matrix:
|
||||
family:
|
||||
# Alphabetical order
|
||||
- 'ch32v307'
|
||||
- 'fomu'
|
||||
- 'gd32vf103'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
uses: actions/setup-python@v2
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Checkout hathach/linkermap
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: hathach/linkermap
|
||||
path: linkermap
|
||||
- name: Checkout common submodules in lib
|
||||
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
|
||||
|
||||
- name: Set Toolchain URL
|
||||
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.1.0-1.1/xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz
|
||||
|
||||
- name: Cache Toolchain
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v2
|
||||
id: cache-toolchain
|
||||
with:
|
||||
path: ~/cache/
|
||||
|
@ -68,17 +47,5 @@ jobs:
|
|||
- name: Set Toolchain Path
|
||||
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
|
||||
|
||||
- name: Get Dependencies
|
||||
run: python3 tools/get_deps.py ${{ matrix.family }}
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py ${{ matrix.family }}
|
||||
|
||||
- name: Linker Map
|
||||
run: |
|
||||
pip install linkermap/
|
||||
# find -quit to only print linkermap of 1 board per example
|
||||
for ex in `ls -d examples/device/*/`
|
||||
do
|
||||
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
|
||||
done
|
||||
|
|
54
.github/workflows/build_win_mac.yml
vendored
54
.github/workflows/build_win_mac.yml
vendored
|
@ -1,54 +0,0 @@
|
|||
name: Build Windows/MacOS
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_win_mac.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/build_win_mac.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# ---------------------------------------
|
||||
# Build ARM family
|
||||
# ---------------------------------------
|
||||
build-arm:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install ARM GCC
|
||||
uses: carlosperate/arm-none-eabi-gcc-action@v1
|
||||
with:
|
||||
release: '10.3-2021.10'
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Get Dependencies
|
||||
run: python3 tools/get_deps.py stm32f4
|
||||
|
||||
- name: Build
|
||||
run: python3 tools/build_family.py stm32f4 stm32f411disco
|
34
.github/workflows/cifuzz.yml
vendored
34
.github/workflows/cifuzz.yml
vendored
|
@ -1,34 +0,0 @@
|
|||
name: CIFuzz
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '**.c'
|
||||
- '**.cc'
|
||||
- '**.cpp'
|
||||
- '**.cxx'
|
||||
- '**.h'
|
||||
jobs:
|
||||
Fuzzing:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Build Fuzzers
|
||||
id: build
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'tinyusb'
|
||||
language: c++
|
||||
- name: Run Fuzzers
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'tinyusb'
|
||||
language: c++
|
||||
fuzz-seconds: 600
|
||||
- name: Upload Crash
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure() && steps.build.outcome == 'success'
|
||||
with:
|
||||
name: artifacts
|
||||
path: ./out/artifacts
|
164
.github/workflows/cmake_arm.yml
vendored
164
.github/workflows/cmake_arm.yml
vendored
|
@ -1,164 +0,0 @@
|
|||
name: CMake ARM
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/cmake_arm.yml'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'src/**'
|
||||
- 'examples/**'
|
||||
- 'lib/**'
|
||||
- 'hw/**'
|
||||
- '.github/workflows/cmake_arm.yml'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# ---------------------------------------
|
||||
# Build ARM family
|
||||
# ---------------------------------------
|
||||
build-arm:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
family:
|
||||
# Alphabetical order
|
||||
- 'imxrt'
|
||||
- 'kinetis_kl'
|
||||
- 'lpc18 lpc40 lpc43'
|
||||
- 'lpc54 lpc55'
|
||||
- 'mcx'
|
||||
- 'nrf'
|
||||
- 'ra'
|
||||
- 'rp2040'
|
||||
- 'samd21'
|
||||
- 'samd51'
|
||||
- 'stm32f0'
|
||||
- 'stm32f1'
|
||||
- 'stm32f4'
|
||||
- 'stm32f7'
|
||||
- 'stm32g0'
|
||||
- 'stm32g4'
|
||||
- 'stm32h7'
|
||||
- 'stm32l4'
|
||||
- 'stm32u5'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install ARM GCC
|
||||
uses: carlosperate/arm-none-eabi-gcc-action@v1
|
||||
with:
|
||||
release: '11.2-2022.02'
|
||||
|
||||
- name: Install Ninja
|
||||
run: sudo apt install -y ninja-build
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Checkout pico-sdk for rp2040
|
||||
if: matrix.family == 'rp2040'
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: raspberrypi/pico-sdk
|
||||
ref: develop
|
||||
path: pico-sdk
|
||||
|
||||
- name: Get Dependencies
|
||||
run: python3 tools/get_deps.py ${{ matrix.family }}
|
||||
|
||||
- name: Build
|
||||
run: python tools/build_cmake.py ${{ matrix.family }} -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||
env:
|
||||
# for rp2040, there is no harm if defined for other families
|
||||
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
|
||||
|
||||
# Upload binaries for hardware test with self-hosted
|
||||
- name: Prepare rp2040 Artifacts
|
||||
if: contains(matrix.family, 'rp2040') && github.repository_owner == 'hathach'
|
||||
working-directory: ${{github.workspace}}/cmake-build/cmake-build-raspberry_pi_pico
|
||||
run: |
|
||||
find device/ -name "*.elf" -exec mv {} ../../ \;
|
||||
# find host/ -name "*.elf" -exec mv {} ../../ \;
|
||||
# find dual/ -name "*.elf" -exec mv {} ../../ \;
|
||||
|
||||
- name: Upload Artifacts for rp2040
|
||||
if: contains(matrix.family,'rp2040') && github.repository_owner == 'hathach'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: rp2040
|
||||
path: |
|
||||
*.elf
|
||||
|
||||
# ---------------------------------------
|
||||
# Hardware in the loop (HIL)
|
||||
# Current self-hosted instance is running on an RPI4 with
|
||||
# - pico + pico-probe connected via USB
|
||||
# - pico-probe is /dev/ttyACM0
|
||||
# ---------------------------------------
|
||||
hw-rp2040-test:
|
||||
# run only with hathach's commit due to limited resource on RPI4
|
||||
if: github.repository_owner == 'hathach'
|
||||
needs: build-arm
|
||||
runs-on: [self-hosted, Linux, ARM64, rp2040]
|
||||
|
||||
steps:
|
||||
- name: Clean workspace
|
||||
run: |
|
||||
echo "Cleaning up previous run"
|
||||
rm -rf "${{ github.workspace }}"
|
||||
mkdir -p "${{ github.workspace }}"
|
||||
|
||||
- name: Download rp2040 Artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: rp2040
|
||||
|
||||
- name: Create flash.sh
|
||||
run: |
|
||||
echo > flash.sh 'cmdout=$(openocd -f "interface/cmsis-dap.cfg" -f "target/rp2040.cfg" -c "adapter speed 5000" -c "program $1 reset exit")'
|
||||
echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi'
|
||||
chmod +x flash.sh
|
||||
|
||||
- name: Test cdc_dual_ports
|
||||
run: |
|
||||
./flash.sh cdc_dual_ports.elf
|
||||
while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 10 ]; do :; done
|
||||
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
|
||||
test -e /dev/ttyACM2 && echo "ttyACM2 exists"
|
||||
|
||||
- name: Test cdc_msc
|
||||
run: |
|
||||
./flash.sh cdc_msc.elf
|
||||
readme='/media/pi/TinyUSB MSC/README.TXT'
|
||||
while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 10 ]; do :; done
|
||||
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
|
||||
test -f "$readme" && echo "$readme exists"
|
||||
cat "$readme"
|
||||
|
||||
- name: Test dfu
|
||||
run: |
|
||||
./flash.sh dfu.elf
|
||||
while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 10 ]; do :; done
|
||||
dfu-util -d cafe -a 0 -U dfu0
|
||||
dfu-util -d cafe -a 1 -U dfu1
|
||||
grep "TinyUSB DFU! - Partition 0" dfu0
|
||||
grep "TinyUSB DFU! - Partition 1" dfu1
|
||||
|
||||
- name: Test dfu_runtime
|
||||
run: |
|
||||
./flash.sh dfu_runtime.elf
|
||||
while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 10 ]; do :; done
|
48
.github/workflows/pre-commit.yml
vendored
48
.github/workflows/pre-commit.yml
vendored
|
@ -1,48 +0,0 @@
|
|||
name: pre-commit
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Setup Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '3.0'
|
||||
|
||||
- name: Checkout TinyUSB
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Get Dependencies
|
||||
run: |
|
||||
gem install ceedling
|
||||
#cd test/unit-test
|
||||
#ceedling test:all
|
||||
|
||||
- name: Run pre-commit
|
||||
uses: pre-commit/action@v3.0.0
|
||||
|
||||
- name: Build Fuzzer
|
||||
run: |
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
fuzz_harness=$(ls -d test/fuzz/device/*/)
|
||||
for h in $fuzz_harness
|
||||
do
|
||||
make -C $h get-deps
|
||||
make -C $h all
|
||||
done
|
6
.github/workflows/trigger.yml
vendored
6
.github/workflows/trigger.yml
vendored
|
@ -1,7 +1,6 @@
|
|||
name: Trigger Repos
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: master
|
||||
release:
|
||||
|
@ -23,7 +22,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Push to tinyusb_src
|
||||
run: |
|
||||
|
@ -56,5 +55,4 @@ jobs:
|
|||
git push origin ${{ github.event.release.tag_name }}
|
||||
|
||||
# Send POST reqwuest to release https://docs.github.com/en/rest/reference/repos#create-a-release
|
||||
bb="For release note, please checkout https://github.com/hathach/tinyusb/releases/tag/${{ github.event.release.tag_name }}"
|
||||
curl -X POST -H "Authorization: token ${{ secrets.API_TOKEN_GITHUB }}" -H "Accept: application/vnd.github.v3+json" --data '{"tag_name": "${{ github.event.release.tag_name }}", "name": "${{ github.event.release.name }}", "body": "$bb", "draft": ${{ github.event.release.draft }}, "prerelease": ${{ github.event.release.prerelease }}}' https://api.github.com/repos/hathach/tinyusb_src/releases
|
||||
curl -X POST -H "Authorization: token ${{ secrets.API_TOKEN_GITHUB }}" -H "Accept: application/vnd.github.v3+json" --data '{"tag_name": "${{ github.event.release.tag_name }}", "name": "${{ github.event.release.name }}", "body": "${{ github.event.release.body }}", "draft": ${{ github.event.release.draft }}, "prerelease": ${{ github.event.release.prerelease }}}' https://api.github.com/repos/hathach/tinyusb_src/releases
|
||||
|
|
62
.gitignore
vendored
62
.gitignore
vendored
|
@ -12,7 +12,7 @@ latex
|
|||
*.ind
|
||||
.env
|
||||
.settings/
|
||||
.vscode/
|
||||
.idea/
|
||||
.gdb_history
|
||||
/examples/*/*/build*
|
||||
test_old/
|
||||
|
@ -21,68 +21,8 @@ _build
|
|||
/examples/*/*/ses
|
||||
/examples/*/*/ozone
|
||||
/examples/obsolete
|
||||
hw/bsp/**/cubemx/*/
|
||||
.mxproject
|
||||
# coverity intermediate files
|
||||
cov-int
|
||||
# cppcheck build directories
|
||||
*-build-dir
|
||||
/_bin/
|
||||
__pycache__
|
||||
cmake-build-*
|
||||
sdkconfig
|
||||
|
||||
# submodules
|
||||
hw/mcu/allwinner
|
||||
hw/mcu/bridgetek/ft9xx/ft90x-sdk
|
||||
hw/mcu/broadcom
|
||||
hw/mcu/gd/nuclei-sdk
|
||||
hw/mcu/infineon/mtb-xmclib-cat3
|
||||
hw/mcu/microchip
|
||||
hw/mcu/mindmotion/mm32sdk
|
||||
hw/mcu/nordic/nrfx
|
||||
hw/mcu/nuvoton
|
||||
hw/mcu/nxp/lpcopen
|
||||
hw/mcu/nxp/mcux-sdk
|
||||
hw/mcu/nxp/nxp_sdk
|
||||
hw/mcu/raspberry_pi/Pico-PIO-USB
|
||||
hw/mcu/renesas/rx
|
||||
hw/mcu/silabs/cmsis-dfp-efm32gg12b
|
||||
hw/mcu/sony/cxd56/spresense-exported-sdk
|
||||
hw/mcu/st/cmsis_device_f0
|
||||
hw/mcu/st/cmsis_device_f1
|
||||
hw/mcu/st/cmsis_device_f2
|
||||
hw/mcu/st/cmsis_device_f3
|
||||
hw/mcu/st/cmsis_device_f4
|
||||
hw/mcu/st/cmsis_device_f7
|
||||
hw/mcu/st/cmsis_device_g0
|
||||
hw/mcu/st/cmsis_device_g4
|
||||
hw/mcu/st/cmsis_device_h7
|
||||
hw/mcu/st/cmsis_device_l0
|
||||
hw/mcu/st/cmsis_device_l1
|
||||
hw/mcu/st/cmsis_device_l4
|
||||
hw/mcu/st/cmsis_device_l5
|
||||
hw/mcu/st/cmsis_device_u5
|
||||
hw/mcu/st/cmsis_device_wb
|
||||
hw/mcu/st/stm32f0xx_hal_driver
|
||||
hw/mcu/st/stm32f1xx_hal_driver
|
||||
hw/mcu/st/stm32f2xx_hal_driver
|
||||
hw/mcu/st/stm32f3xx_hal_driver
|
||||
hw/mcu/st/stm32f4xx_hal_driver
|
||||
hw/mcu/st/stm32f7xx_hal_driver
|
||||
hw/mcu/st/stm32g0xx_hal_driver
|
||||
hw/mcu/st/stm32g4xx_hal_driver
|
||||
hw/mcu/st/stm32h7xx_hal_driver
|
||||
hw/mcu/st/stm32l0xx_hal_driver
|
||||
hw/mcu/st/stm32l1xx_hal_driver
|
||||
hw/mcu/st/stm32l4xx_hal_driver
|
||||
hw/mcu/st/stm32l5xx_hal_driver
|
||||
hw/mcu/st/stm32u5xx_hal_driver
|
||||
hw/mcu/st/stm32wbxx_hal_driver
|
||||
hw/mcu/ti
|
||||
hw/mcu/wch/ch32v307
|
||||
lib/CMSIS_5
|
||||
lib/FreeRTOS-Kernel
|
||||
lib/lwip
|
||||
lib/sct_neopixel
|
||||
tools/uf2
|
||||
|
|
129
.gitmodules
vendored
Normal file
129
.gitmodules
vendored
Normal file
|
@ -0,0 +1,129 @@
|
|||
[submodule "hw/mcu/nordic/nrfx"]
|
||||
path = hw/mcu/nordic/nrfx
|
||||
url = https://github.com/NordicSemiconductor/nrfx.git
|
||||
[submodule "tools/uf2"]
|
||||
path = tools/uf2
|
||||
url = https://github.com/microsoft/uf2.git
|
||||
[submodule "hw/mcu/sony/cxd56/spresense-exported-sdk"]
|
||||
path = hw/mcu/sony/cxd56/spresense-exported-sdk
|
||||
url = https://github.com/sonydevworld/spresense-exported-sdk.git
|
||||
[submodule "hw/mcu/ti"]
|
||||
path = hw/mcu/ti
|
||||
url = https://github.com/hathach/ti_driver.git
|
||||
[submodule "hw/mcu/microchip"]
|
||||
path = hw/mcu/microchip
|
||||
url = https://github.com/hathach/microchip_driver.git
|
||||
[submodule "hw/mcu/nuvoton"]
|
||||
path = hw/mcu/nuvoton
|
||||
url = https://github.com/majbthrd/nuc_driver.git
|
||||
[submodule "lib/lwip"]
|
||||
path = lib/lwip
|
||||
url = https://github.com/lwip-tcpip/lwip.git
|
||||
[submodule "hw/mcu/st/cmsis_device_f4"]
|
||||
path = hw/mcu/st/cmsis_device_f4
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_f4.git
|
||||
[submodule "hw/mcu/st/stm32f4xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32f4xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32f4xx_hal_driver.git
|
||||
[submodule "hw/mcu/st/cmsis_device_f0"]
|
||||
path = hw/mcu/st/cmsis_device_f0
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_f0.git
|
||||
[submodule "hw/mcu/st/stm32f0xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32f0xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32f0xx_hal_driver.git
|
||||
[submodule "hw/mcu/st/cmsis_device_f1"]
|
||||
path = hw/mcu/st/cmsis_device_f1
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_f1.git
|
||||
[submodule "hw/mcu/st/stm32f1xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32f1xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32f1xx_hal_driver.git
|
||||
[submodule "hw/mcu/st/cmsis_device_f2"]
|
||||
path = hw/mcu/st/cmsis_device_f2
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_f2.git
|
||||
[submodule "hw/mcu/st/stm32f2xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32f2xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32f2xx_hal_driver.git
|
||||
[submodule "hw/mcu/st/cmsis_device_f3"]
|
||||
path = hw/mcu/st/cmsis_device_f3
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_f3.git
|
||||
[submodule "hw/mcu/st/stm32f3xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32f3xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32f3xx_hal_driver.git
|
||||
[submodule "hw/mcu/st/cmsis_device_f7"]
|
||||
path = hw/mcu/st/cmsis_device_f7
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_f7.git
|
||||
[submodule "hw/mcu/st/stm32f7xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32f7xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32f7xx_hal_driver.git
|
||||
[submodule "hw/mcu/st/cmsis_device_h7"]
|
||||
path = hw/mcu/st/cmsis_device_h7
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_h7.git
|
||||
[submodule "hw/mcu/st/stm32h7xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32h7xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32h7xx_hal_driver.git
|
||||
[submodule "hw/mcu/st/cmsis_device_l0"]
|
||||
path = hw/mcu/st/cmsis_device_l0
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_l0.git
|
||||
[submodule "hw/mcu/st/stm32l0xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32l0xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32l0xx_hal_driver.git
|
||||
[submodule "hw/mcu/st/cmsis_device_l1"]
|
||||
path = hw/mcu/st/cmsis_device_l1
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_l1.git
|
||||
[submodule "hw/mcu/st/stm32l1xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32l1xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32l1xx_hal_driver.git
|
||||
[submodule "hw/mcu/st/cmsis_device_l4"]
|
||||
path = hw/mcu/st/cmsis_device_l4
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_l4.git
|
||||
[submodule "hw/mcu/st/stm32l4xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32l4xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32l4xx_hal_driver.git
|
||||
[submodule "hw/mcu/st/cmsis_device_g0"]
|
||||
path = hw/mcu/st/cmsis_device_g0
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_g0.git
|
||||
[submodule "hw/mcu/st/stm32g0xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32g0xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git
|
||||
[submodule "hw/mcu/st/cmsis_device_g4"]
|
||||
path = hw/mcu/st/cmsis_device_g4
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_g4.git
|
||||
[submodule "hw/mcu/st/stm32g4xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32g4xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32g4xx_hal_driver.git
|
||||
[submodule "hw/mcu/st/cmsis_device_l5"]
|
||||
path = hw/mcu/st/cmsis_device_l5
|
||||
url = https://github.com/STMicroelectronics/cmsis_device_l5.git
|
||||
[submodule "hw/mcu/st/stm32l5xx_hal_driver"]
|
||||
path = hw/mcu/st/stm32l5xx_hal_driver
|
||||
url = https://github.com/STMicroelectronics/stm32l5xx_hal_driver.git
|
||||
[submodule "lib/sct_neopixel"]
|
||||
path = lib/sct_neopixel
|
||||
url = https://github.com/gsteiert/sct_neopixel
|
||||
[submodule "lib/FreeRTOS-Kernel"]
|
||||
path = lib/FreeRTOS-Kernel
|
||||
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
|
||||
[submodule "lib/CMSIS_5"]
|
||||
path = lib/CMSIS_5
|
||||
url = https://github.com/ARM-software/CMSIS_5.git
|
||||
[submodule "hw/mcu/silabs/cmsis-dfp-efm32gg12b"]
|
||||
path = hw/mcu/silabs/cmsis-dfp-efm32gg12b
|
||||
url = https://github.com/cmsis-packs/cmsis-dfp-efm32gg12b
|
||||
[submodule "hw/mcu/renesas/rx"]
|
||||
path = hw/mcu/renesas/rx
|
||||
url = https://github.com/kkitayam/rx_device.git
|
||||
[submodule "hw/mcu/nxp/lpcopen"]
|
||||
path = hw/mcu/nxp/lpcopen
|
||||
url = https://github.com/hathach/nxp_lpcopen.git
|
||||
[submodule "hw/mcu/nxp/mcux-sdk"]
|
||||
path = hw/mcu/nxp/mcux-sdk
|
||||
url = https://github.com/NXPmicro/mcux-sdk.git
|
||||
[submodule "hw/mcu/nxp/nxp_sdk"]
|
||||
path = hw/mcu/nxp/nxp_sdk
|
||||
url = https://github.com/hathach/nxp_sdk.git
|
||||
[submodule "hw/mcu/mindmotion/mm32sdk"]
|
||||
path = hw/mcu/mindmotion/mm32sdk
|
||||
url = https://github.com/zhangslice/mm32sdk.git
|
||||
[submodule "hw/mcu/gd/nuclei-sdk"]
|
||||
path = hw/mcu/gd/nuclei-sdk
|
||||
url = https://github.com/Nuclei-Software/nuclei-sdk.git
|
8
.idea/.gitignore
generated
vendored
8
.idea/.gitignore
generated
vendored
|
@ -1,8 +0,0 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
70
.idea/cmake.xml
generated
70
.idea/cmake.xml
generated
|
@ -1,70 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakeSharedSettings">
|
||||
<configurations>
|
||||
<configuration PROFILE_NAME="esp32s2" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=espressif_saola_1">
|
||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
<envs>
|
||||
<env name="ESPBAUD" value="1500000" />
|
||||
</envs>
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</configuration>
|
||||
<configuration PROFILE_NAME="kaluga" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=espressif_kaluga_1 -DMAX3421_HOST=1 -DLOG=2">
|
||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
<envs>
|
||||
<env name="ESPBAUD" value="1500000" />
|
||||
</envs>
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</configuration>
|
||||
<configuration PROFILE_NAME="esp32s3" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=espressif_s3_devkitm">
|
||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
<envs>
|
||||
<env name="ESPBAUD" value="1500000" />
|
||||
</envs>
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</configuration>
|
||||
<configuration PROFILE_NAME="rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=raspberry_pi_pico -DLOG=2" />
|
||||
<configuration PROFILE_NAME="feather_rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pico_sdk -DPICO_BOARD=adafruit_feather_rp2040" />
|
||||
<configuration PROFILE_NAME="metro m7 1011" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m7_1011 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="rt1010 evk" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mimxrt1010_evk -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="rt1060 evk" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mimxrt1060_evk -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="mcb1800" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mcb1800 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="ea4088 quickstart" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ea4088_quickstart -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="ea4357" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ea4357 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="lpc54628" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=lpcxpresso54628 -DLOG=4 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="lpc55s69" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=lpcxpresso55s69 -DLOG=4 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="mcxn947" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mcxn947brk -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="feather_nrf52840_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_nrf52840_express -DLOG=3 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
||||
<configuration PROFILE_NAME="pca10056" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10056 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="pca10095" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10095 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="stm32g0b1nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32g0b1nucleo" />
|
||||
<configuration PROFILE_NAME="stm32g474nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32g474nucleo" />
|
||||
<configuration PROFILE_NAME="b_g474e_dpow1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=b_g474e_dpow1 -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="b_g474e_dpow1 iar" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=b_g474e_dpow1 -DTOOLCHAIN=iar" />
|
||||
<configuration PROFILE_NAME="frdm_kl25z" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=frdm_kl25z -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="stm32f072disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f072disco" />
|
||||
<configuration PROFILE_NAME="stm32f103_mini_2" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f103_mini_2" />
|
||||
<configuration PROFILE_NAME="stm32f411disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f411disco -DLOG=2 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="stm32f769disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f769disco -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="stm32h743eval" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32h743eval -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="stm32l476disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32l476disco" />
|
||||
<configuration PROFILE_NAME="ra4m1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra4m1_ek -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="ra6m1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m1_ek -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="ra6m5" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="ra6m5 PORT0" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1 -DPORT=0" />
|
||||
<configuration PROFILE_NAME="uno_r4" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=uno_r4 -DLOG=4 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="portenta_c33" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=portenta_c33 -DLOG=3" />
|
||||
<configuration PROFILE_NAME="metro_m4_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m4_express -DLOG=3 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
||||
<configuration PROFILE_NAME="metro_m0_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m0_express -DLOG=3 -DLOGGER=RTT -DMAX3421_HOST=1" />
|
||||
<configuration PROFILE_NAME="metro esp32s2" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=adafruit_metro_esp32s2 -DMAX3421_HOST=1 -DLOG=2">
|
||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
<envs>
|
||||
<env name="ESPBAUD" value="1500000" />
|
||||
</envs>
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</configuration>
|
||||
<configuration PROFILE_NAME="stm32u575eval" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u575eval" />
|
||||
<configuration PROFILE_NAME="stm32u575nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u575nucleo -DLOG=3" />
|
||||
</configurations>
|
||||
</component>
|
||||
</project>
|
10
.idea/runConfigurations/kl25.xml
generated
10
.idea/runConfigurations/kl25.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="kl25" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "MKL25Z128xxx4" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/lpc1857.xml
generated
10
.idea/runConfigurations/lpc1857.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="lpc1857" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "lpc1857" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/lpc4088.xml
generated
10
.idea/runConfigurations/lpc4088.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="lpc4088" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "lpc4088" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/lpc54628.xml
generated
10
.idea/runConfigurations/lpc54628.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="lpc54628" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "LPC54628J512" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/lpc55s69.xml
generated
10
.idea/runConfigurations/lpc55s69.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="lpc55s69" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "lpc55s69" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/mcx947.xml
generated
10
.idea/runConfigurations/mcx947.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="mcx947" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "MCXN947_M33_0" -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $ProjectFileDir$/hw/bsp/mcx/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/nrf52840.xml
generated
10
.idea/runConfigurations/nrf52840.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="nrf52840" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-select usb=752001685 -device "nrf52840_xxaa" -if swd -speed 8000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/nrf5340.xml
generated
10
.idea/runConfigurations/nrf5340.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="nrf5340" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-select usb=752001685 -device "nrf5340_xxaa_app" -if swd -speed 16000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/ra4m1.xml
generated
10
.idea/runConfigurations/ra4m1.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="ra4m1" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "R7FA4M1AB" -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $PROJECT_DIR$/hw/bsp/ra/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/ra6m1.xml
generated
10
.idea/runConfigurations/ra6m1.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="ra6m1" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "R7FA6M1AD" -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $PROJECT_DIR$/hw/bsp/ra/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/ra6m5.xml
generated
10
.idea/runConfigurations/ra6m5.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="ra6m5" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "R7FA6M5BH" -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $PROJECT_DIR$/hw/bsp/ra/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/rp2040.xml
generated
10
.idea/runConfigurations/rp2040.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="rp2040" type="com.jetbrains.cidr.embedded.openocd.conf.type" factoryName="com.jetbrains.cidr.embedded.openocd.conf.factory" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="rp2040" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<openocd version="1" gdb-port="3333" telnet-port="4444" board-config="$PROJECT_DIR$/hw/bsp/rp2040/rp2040-openocd.cfg" reset-type="INIT" download-type="UPDATED_ONLY">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</openocd>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/rt1010.xml
generated
10
.idea/runConfigurations/rt1010.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="rt1010" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "MIMXRT1011xxx5A" -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $ProjectFileDir$/hw/bsp/imxrt/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/rt1060.xml
generated
10
.idea/runConfigurations/rt1060.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="rt1060" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "MIMXRT1062xxx5A" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/samd21g18.xml
generated
10
.idea/runConfigurations/samd21g18.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="samd21g18" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "ATSAMD21G18" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/samd51j19.xml
generated
10
.idea/runConfigurations/samd51j19.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="samd51j19" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "ATSAMD51J19A" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/stlink.xml
generated
10
.idea/runConfigurations/stlink.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="stlink" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-p 62847 -cp "/opt/st/stm32cubeide_1.12.1/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64_2.0.600.202301161003/tools/bin" --frequency 24000 --swd" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::62847" executable="/opt/st/stm32cubeide_1.12.1/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.linux64_2.0.500.202301161003/tools/bin/ST-LINK_gdbserver" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/stm32g474.xml
generated
10
.idea/runConfigurations/stm32g474.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="stm32g474" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "stm32g474re" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/stm32h743.xml
generated
10
.idea/runConfigurations/stm32h743.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="stm32h743" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "stm32h743xi" -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
10
.idea/runConfigurations/uno_r4.xml
generated
10
.idea/runConfigurations/uno_r4.xml
generated
|
@ -1,10 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="uno_r4" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device "R7FA4M1AB" -if swd -speed 20000 -port 25321 -nogui -singlerun -jlinkscriptfile $PROJECT_DIR$/hw/bsp/ra/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
|
||||
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
|
||||
<debugger kind="GDB" isBundled="true" />
|
||||
</custom-gdb-server>
|
||||
<method v="2">
|
||||
<option name="CLION.COMPOUND.BUILD" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,42 +0,0 @@
|
|||
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
|
||||
#
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.4.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
- id: trailing-whitespace
|
||||
exclude: |
|
||||
(?x)^(
|
||||
hw/bsp/mcx/sdk/
|
||||
)
|
||||
- id: end-of-file-fixer
|
||||
exclude: |
|
||||
(?x)^(
|
||||
.idea/|
|
||||
hw/bsp/mcx/sdk/
|
||||
)
|
||||
- id: forbid-submodules
|
||||
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.2.4
|
||||
hooks:
|
||||
- id: codespell
|
||||
args: [-w]
|
||||
exclude: |
|
||||
(?x)^(
|
||||
lib/|
|
||||
hw/bsp/mcx/sdk/
|
||||
)
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: unit-test
|
||||
name: unit-test
|
||||
files: ^(src/|test/unit-test/)
|
||||
entry: sh -c "cd test/unit-test && ceedling test:all"
|
||||
pass_filenames: false
|
||||
types_or: [c, header]
|
||||
language: system
|
|
@ -4,21 +4,15 @@
|
|||
|
||||
version: 2
|
||||
|
||||
# Set the version of Python and other tools you might need
|
||||
build:
|
||||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3.11"
|
||||
|
||||
# Build documentation in the docs/ directory with Sphinx
|
||||
sphinx:
|
||||
configuration: docs/conf.py
|
||||
|
||||
# Optionally declare the Python requirements required to build your docs
|
||||
python:
|
||||
version: 3.8
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
|
||||
submodules:
|
||||
include: []
|
||||
recursive: false
|
||||
|
|
@ -18,12 +18,6 @@ Notable contributors
|
|||
- Design the project logo
|
||||
|
||||
|
||||
`Gordon McNab <https://github.com/ftdigdm>`__
|
||||
---------------------------------------------
|
||||
|
||||
- Add new DCD port for Bridgetek FT90x and FT93x
|
||||
|
||||
|
||||
`Ha Thach <https://github.com/hathach>`__
|
||||
-----------------------------------------
|
||||
|
||||
|
@ -37,12 +31,6 @@ Notable contributors
|
|||
- Improve ESP32s2 DCD
|
||||
|
||||
|
||||
`Jacob Berg Potter <https://github.com/j4cbo>`__
|
||||
------------------------------------------------
|
||||
|
||||
- Add new class driver for network CDC-NCM
|
||||
|
||||
|
||||
`Jan Dümpelmann <https://github.com/duempel>`__
|
||||
-----------------------------------------------
|
||||
|
||||
|
@ -59,7 +47,6 @@ Notable contributors
|
|||
-----------------------------------------------
|
||||
|
||||
- Add new DCD port for Dialog DA1469x
|
||||
- Add new DCD port for PIC32MZ
|
||||
- Add new class driver for Bluetooth HCI
|
||||
- Add ISO transfer for STM32 Synopsys, Nordic nRF, Dialog DA1469x
|
||||
- Improve Audio driver and add uac2\_headset example
|
||||
|
@ -88,10 +75,9 @@ Notable contributors
|
|||
`Koji KITAYAMA <https://github.com/kkitayam>`__
|
||||
-----------------------------------------------
|
||||
|
||||
- Add new DCD and HCD port for NXP Kinetis KL25
|
||||
- Add new DCD and HCD port for Renesas RX family (RX600, RX700 ..) with GR-CITRUS, RX65n target board
|
||||
- Add new DCD and HCD port for Mentor musb with MSP432E4
|
||||
- Add new class driver for USB Video Class (UVC 1.5)
|
||||
- Add new DCD port for NXP Kinetis KL25
|
||||
- Add new DCD port for Renesas RX63n with GR-CITRUS board
|
||||
|
||||
|
||||
`Nathan Conrad <https://github.com/pigrew>`__
|
||||
---------------------------------------------
|
||||
|
@ -107,9 +93,9 @@ Notable contributors
|
|||
------------------------------------------------
|
||||
|
||||
- Add new DCD port for Nuvoton NUC 120, 121, 125, 126, 505
|
||||
- Add new class driver for network RNDIS, CDC-ECM
|
||||
- Enhance CDC-NCM network driver to compatible with RNDIS/ECM
|
||||
- Add *net\_lwip\_webserver* example for demonstration of usbnet with lwip
|
||||
- Add new class driver for USBNET RNDIS, CDC-ECM
|
||||
- Add *net\_lwip\_webserver* example for demonstration of usbnet with
|
||||
lwip
|
||||
- Board support for NuTiny NUC120, NUC121s, NUC125s, NUC126V, NUC505
|
||||
- Improve multiple cdc interfaces API & add cdc\_dual\_ports example
|
||||
|
||||
|
@ -117,9 +103,8 @@ Notable contributors
|
|||
`Rafael Silva <https://github.com/perigoso>`__
|
||||
----------------------------------------------
|
||||
|
||||
- Port DCD Synopsys to support Silabs EFM32GG12 with SLTB009A board
|
||||
- Add new DCD port for Silabs EFM32GG12 with SLTB009A board
|
||||
- Rewrite documentation in rst and setup for readthedocs
|
||||
- Generalize Renesas driver and support RA family with EK-RA4M3 board
|
||||
|
||||
|
||||
`Raspberry Pi Team <https://github.com/raspberrypi>`__
|
||||
|
@ -133,8 +118,10 @@ Notable contributors
|
|||
------------------------------------------------
|
||||
|
||||
- Add new class driver for USB Audio Class 2.0 (UAC2)
|
||||
- Rework tu\_fifo with unmasked pointer, add DMA support, and constant address support
|
||||
- Add new DCD/USBD edpt\_xfer\_fifo() API for optimizing endpoint transfer
|
||||
- Rework tu\_fifo with unmasked pointer, add DMA support, and constant
|
||||
address support
|
||||
- Add new DCD/USBD edpt\_xfer\_fifo() API for optimizing endpoint
|
||||
transfer
|
||||
- Add and greatly improve Isochronous transfer
|
||||
- Add new audio examples: audio\_test and audio\_4\_channel\_mic
|
||||
|
||||
|
@ -143,7 +130,8 @@ Notable contributors
|
|||
------------------------------------------------
|
||||
|
||||
- Add new DCD port for SAMD21 and SAMD51
|
||||
- Add new class driver for Musical Instrument Digital Interface (MIDI)
|
||||
- Add new class driver for Musical Instrument Digital Interface
|
||||
(MIDI)
|
||||
- Improve USBD control transfer, MSC, CDC class driver
|
||||
- Board support for Metro M0 & M4 express
|
||||
- Write the excellent porting.md documentation
|
||||
|
@ -161,12 +149,6 @@ Notable contributors
|
|||
- Add new class driver for DFU Runtime
|
||||
|
||||
|
||||
`Tian Yunhao <https://github.com/t123yh>`__
|
||||
-------------------------------------------
|
||||
|
||||
- Add new DCD port for Allwinner F1C100S/F1C200S
|
||||
- Add support for osal_rtx4
|
||||
|
||||
`Timon Skerutsch <https://github.com/PTS93>`__
|
||||
----------------------------------------------
|
||||
|
||||
|
@ -191,17 +173,16 @@ Notable contributors
|
|||
- Add new DCD port for Synopsys DesignWare for STM32 L4, F2, F4,
|
||||
F7, H7 etc ...
|
||||
- Add new DCD port for TI MSP430
|
||||
- Board support for STM32F407 Discovery, STM32H743 Nucleo, pyboard v1.1, msp\_exp430f5529lp etc ...
|
||||
- Board support for STM32F407 Discovery, STM32H743 Nucleo, pyboard
|
||||
v1.1, msp\_exp430f5529lp etc ...
|
||||
|
||||
|
||||
`Zixun Li <https://github.com/HiFiPhile>`__
|
||||
-------------------------------------------
|
||||
-----------------------------------------------
|
||||
|
||||
- Add new DCD port for Microchip SAMx7x
|
||||
- Add IAR compiler support
|
||||
- Improve UAC2, CDC, DFU class driver
|
||||
- Improve stm32_fsdev, chipidea_ci_hs, lpc_ip3511 DCD
|
||||
- Host IAR Build CI & hardware in the loop (HITL) test
|
||||
|
||||
|
||||
`Full contributors list <https://github.com/hathach/tinyusb/contributors>`__
|
||||
|
|
66
README.rst
66
README.rst
|
@ -1,7 +1,7 @@
|
|||
.. figure:: docs/assets/logo.svg
|
||||
:alt: TinyUSB
|
||||
|
||||
|Build Status| |Documentation Status| |Fuzzing Status| |License|
|
||||
|Build Status| |Documentation Status| |License|
|
||||
|
||||
TinyUSB is an open-source cross-platform USB Host/Device stack for
|
||||
embedded system, designed to be memory-safe with no dynamic allocation
|
||||
|
@ -20,8 +20,8 @@ Please take a look at the online `documentation <https://docs.tinyusb.org/>`__.
|
|||
├── docs # Documentation
|
||||
├── examples # Sample with Makefile build support
|
||||
├── hw
|
||||
│ ├── bsp # Supported boards source files
|
||||
│ └── mcu # Low level mcu core & peripheral drivers
|
||||
│ ├── bsp # Supported boards source files
|
||||
│ └── mcu # Low level mcu core & peripheral drivers
|
||||
├── lib # Sources from 3rd party such as freeRTOS, fatfs ...
|
||||
├── src # All sources files for TinyUSB stack itself.
|
||||
├── test # Unit tests for the stack
|
||||
|
@ -32,35 +32,24 @@ Supported MCUs
|
|||
|
||||
The stack supports the following MCUs:
|
||||
|
||||
- **Allwinner:** F1C100s/F1C200s
|
||||
- **Analog:** MAX3421e (aka Arduino usb host shield)
|
||||
- **Broadcom:** BCM2837, BCM2711
|
||||
- **Dialog:** DA1469x
|
||||
- **Espressif:** ESP32-S2, ESP32-S3
|
||||
- **GigaDevice:** GD32VF103
|
||||
- **Infineon:** XMC4500
|
||||
- **MicroChip:** SAMD11, SAMD21, SAMD51, SAME5x, SAMG55, SAML21, SAML22, SAME7x
|
||||
- **NordicSemi:** nRF52833, nRF52840, nRF5340
|
||||
- **NordicSemi:** nRF52833, nRF52840
|
||||
- **Nuvoton:** NUC120, NUC121/NUC125, NUC126, NUC505
|
||||
- **NXP:**
|
||||
|
||||
- iMX RT Series: RT10xx, RT11xx
|
||||
- Kinetis: KL25, K32L2
|
||||
- iMX RT Series: RT1011, RT1015, RT1021, RT1052, RT1062, RT1064
|
||||
- Kinetis: KL25, K32L2Bxx
|
||||
- LPC Series: 11u, 13, 15, 17, 18, 40, 43, 51u, 54, 55
|
||||
- MCX: N9x
|
||||
|
||||
- **Raspberry Pi:** RP2040
|
||||
- **Renesas:**
|
||||
|
||||
- RX Series: 63n, 65n, 72n
|
||||
- RA Series: 4m1, 4m3, 6m1, 6m5
|
||||
|
||||
- **Silabs:** EFM32GG
|
||||
- **Renesas:** RX63N, RX65N
|
||||
- **Silabs:** EFM32GG12
|
||||
- **Sony:** CXD56
|
||||
- **ST:** STM32 series: F0, F1, F2, F3, F4, F7, H7, G0, G4, L0, L1, L4, L4+, WB
|
||||
- **TI:** MSP430, MSP432E4, TM4C123
|
||||
- **ST:** STM32 series: L0, L1, F0, F1, F2, F3, F4, F7, H7 both FullSpeed and HighSpeed
|
||||
- **TI:** MSP430
|
||||
- **ValentyUSB:** eptri
|
||||
- **WCH:** CH32V307
|
||||
|
||||
Here is the list of `Supported Devices`_ that can be used with provided examples.
|
||||
|
||||
|
@ -72,35 +61,23 @@ Supports multiple device configurations by dynamically changing USB descriptors,
|
|||
- Audio Class 2.0 (UAC2)
|
||||
- Bluetooth Host Controller Interface (BTH HCI)
|
||||
- Communication Device Class (CDC)
|
||||
- Device Firmware Update (DFU): DFU mode (WIP) and Runtime
|
||||
- Device Firmware Update (DFU): DFU mode (WIP) and Runtinme
|
||||
- Human Interface Device (HID): Generic (In & Out), Keyboard, Mouse, Gamepad etc ...
|
||||
- Mass Storage Class (MSC): with multiple LUNs
|
||||
- Musical Instrument Digital Interface (MIDI)
|
||||
- Network with RNDIS, Ethernet Control Model (ECM), Network Control Model (NCM)
|
||||
- Test and Measurement Class (USBTMC)
|
||||
- Video class 1.5 (UVC): work in progress
|
||||
- Network with RNDIS, CDC-ECM (work in progress)
|
||||
- USB Test and Measurement Class (USBTMC)
|
||||
- Vendor-specific class support with generic In & Out endpoints. Can be used with MS OS 2.0 compatible descriptor to load winUSB driver without INF file.
|
||||
- `WebUSB <https://github.com/WICG/webusb>`__ with vendor-specific class
|
||||
|
||||
If you have a special requirement, `usbd_app_driver_get_cb()` can be used to write your own class driver without modifying the stack. Here is how the RPi team added their reset interface `raspberrypi/pico-sdk#197 <https://github.com/raspberrypi/pico-sdk/pull/197>`_
|
||||
If you have a special requirement, `usbd_app_driver_get_cb()` can be used to write your own class driver without modifying the stack. Here is how the RPi team added their reset interface [raspberrypi/pico-sdk#197](https://github.com/raspberrypi/pico-sdk/pull/197)
|
||||
|
||||
Host Stack
|
||||
==========
|
||||
|
||||
- Human Interface Device (HID): Keyboard, Mouse, Generic
|
||||
- Mass Storage Class (MSC)
|
||||
- Communication Device Class: CDC-ACM
|
||||
- Vendor serial over USB: FTDI, CP210x
|
||||
- Hub with multiple-level support
|
||||
|
||||
Similar to the Device Stack, if you have a special requirement, `usbh_app_driver_get_cb()` can be used to write your own class driver without modifying the stack.
|
||||
|
||||
TypeC PD Stack
|
||||
==============
|
||||
|
||||
- Power Delivery 3.0 (PD3.0) with USB Type-C support (WIP)
|
||||
- Super early stage, only for testing purpose
|
||||
- Only support STM32 G4
|
||||
- Hub currently only supports 1 level of hub (due to my laziness)
|
||||
|
||||
OS Abstraction layer
|
||||
====================
|
||||
|
@ -109,11 +86,10 @@ TinyUSB is completely thread-safe by pushing all Interrupt Service Request (ISR)
|
|||
|
||||
- **No OS**
|
||||
- **FreeRTOS**
|
||||
- `RT-Thread <https://github.com/RT-Thread/rt-thread>`_: `repo <https://github.com/RT-Thread-packages/tinyusb>`_
|
||||
- **Mynewt** Due to the newt package build system, Mynewt examples are better to be on its `own repo <https://github.com/hathach/mynewt-tinyusb-example>`_
|
||||
- **Mynewt** Due to the newt package build system, Mynewt examples are better to be on its [own repo](https://github.com/hathach/mynewt-tinyusb-example)
|
||||
|
||||
Docs
|
||||
====
|
||||
Local Docs
|
||||
==========
|
||||
|
||||
- Info
|
||||
|
||||
|
@ -125,7 +101,6 @@ Docs
|
|||
|
||||
- `Supported Devices`_
|
||||
- `Getting Started`_
|
||||
- `Dependencies`_
|
||||
- `Concurrency`_
|
||||
|
||||
- `Contributing`_
|
||||
|
@ -144,12 +119,10 @@ Please make sure you understand all the license term for files you use
|
|||
in your project.
|
||||
|
||||
|
||||
.. |Build Status| image:: https://github.com/hathach/tinyusb/actions/workflows/cmake_arm.yml/badge.svg
|
||||
.. |Build Status| image:: https://github.com/hathach/tinyusb/workflows/Build/badge.svg
|
||||
:target: https://github.com/hathach/tinyusb/actions
|
||||
.. |Documentation Status| image:: https://readthedocs.org/projects/tinyusb/badge/?version=latest
|
||||
:target: https://docs.tinyusb.org/en/latest/?badge=latest
|
||||
.. |Fuzzing Status| image:: https://oss-fuzz-build-logs.storage.googleapis.com/badges/tinyusb.svg
|
||||
:target: https://oss-fuzz-build-logs.storage.googleapis.com/index.html#tinyusb
|
||||
.. |License| image:: https://img.shields.io/badge/license-MIT-brightgreen.svg
|
||||
:target: https://opensource.org/licenses/MIT
|
||||
|
||||
|
@ -160,7 +133,6 @@ in your project.
|
|||
.. _Reference: docs/reference/index.rst
|
||||
.. _Supported Devices: docs/reference/supported.rst
|
||||
.. _Getting Started: docs/reference/getting_started.rst
|
||||
.. _Dependencies: docs/reference/dependencies.rst
|
||||
.. _Concurrency: docs/reference/concurrency.rst
|
||||
.. _Contributing: docs/contributing/index.rst
|
||||
.. _Code of Conduct: CODE_OF_CONDUCT.rst
|
||||
|
|
|
@ -21,6 +21,7 @@ extensions = [
|
|||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.todo',
|
||||
'sphinx_autodoc_typehints',
|
||||
'sphinxemoji.sphinxemoji',
|
||||
]
|
||||
|
||||
templates_path = ['_templates']
|
||||
|
|
|
@ -6,7 +6,7 @@ Contributing can be highly rewarding, but it can also be frustrating at times.
|
|||
It takes time to review patches, and as this is an open source project, that
|
||||
sometimes can take a while. The reviewing process depends on the availability
|
||||
of the maintainers, who may not be always available. Please try to be
|
||||
understanding through the process.
|
||||
understanding throught the process.
|
||||
|
||||
There a few guidelines you need to keep in mind when contributing. Please have
|
||||
a look at them as that will make the contribution process easier for all
|
||||
|
|
|
@ -62,9 +62,9 @@ Feel free to skip this until you want to verify your demo code is running. To im
|
|||
OS Abstraction Layer (OSAL)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The OS Abstraction Layer is responsible for providing basic data structures for TinyUSB that may allow for concurrency when used with an RTOS. Without an RTOS it simply handles concurrency issues between the main code and interrupts. The code is almost entirely agnostic of MCU and lives in ``src/osal``.
|
||||
The OS Abstraction Layer is responsible for providing basic data structures for TinyUSB that may allow for concurrency when used with an RTOS. Without an RTOS it simply handles concurrency issues between the main code and interrupts.
|
||||
|
||||
In RTOS configurations, tud_task()/tuh_task() blocks behind a synchronization structure when the event queue is empty, so that the scheduler may give the CPU to a different task. To take advantage of the library's capability to yield the CPU when there are no actionable USB device events, ensure that the `CFG_TUSB_OS` symbol is defined, e.g `OPT_OS_FREERTOS` enables the FreeRTOS scheduler to schedule other threads than that which calls `tud_task()/tuh_task()`.
|
||||
The code is almost entirely agnostic of MCU and lives in ``src/osal``.
|
||||
|
||||
Device API
|
||||
^^^^^^^^^^
|
||||
|
@ -195,7 +195,7 @@ Others (like the nRF52) may need each USB packet queued individually. To make th
|
|||
some state for yourself and queue up an intermediate USB packet from the interrupt handler.
|
||||
|
||||
Once the transaction is going, the interrupt handler will notify TinyUSB of transfer completion.
|
||||
During transmission, the IN data buffer is guaranteed to remain unchanged in memory until the ``dcd_xfer_complete`` function is called.
|
||||
During transmission, the IN data buffer is guarenteed to remain unchanged in memory until the ``dcd_xfer_complete`` function is called.
|
||||
|
||||
The dcd_edpt_xfer function must never add zero-length-packets (ZLP) on its own to a transfer. If a ZLP is required,
|
||||
then it must be explicitly sent by the stack calling dcd_edpt_xfer(), by calling dcd_edpt_xfer() a second time with len=0.
|
||||
|
@ -238,4 +238,4 @@ Use `WireShark <https://www.wireshark.org/>`_ or `a Beagle <https://www.totalpha
|
|||
|
||||
* If the host sends a SETUP packet and its not ACKed then your USB peripheral probably isn't started correctly.
|
||||
* If the peripheral is started correctly but it still didn't work, then verify your usb clock is correct. (You did output a PWM based on it right? ;-) )
|
||||
* If the SETUP packet is ACKed but nothing is sent back then you interrupt handler isn't queueing the setup packet correctly. (Also, if you are using your own code instead of an example ``tud_task`` may not be called.) If that's OK, the ``dcd_xfer_complete`` may not be setting up the next transaction correctly.
|
||||
* If the SETUP packet is ACKed but nothing is sent back then you interrupt handler isn't queueing the setup packet correctly. (Also, if you are using your own code instead of an example ``tud_task`` may not be called.) If thats OK, the ``dcd_xfer_complete`` may not be setting up the next transaction correctly.
|
||||
|
|
|
@ -2,214 +2,6 @@
|
|||
Changelog
|
||||
*********
|
||||
|
||||
0.15.0
|
||||
======
|
||||
|
||||
- Add codespell to detect typo
|
||||
- Add support for fuzzing and bagde for oss-fuzz
|
||||
- [osal]
|
||||
|
||||
- Allow the use of non-static allocation for FreeRTOS
|
||||
- Fix FreeRTOS wrong task switch in some cases
|
||||
|
||||
- Fix tu_fifo memory overflown when repeatedly write to overwritable fifo (accumulated more than 2 depths)
|
||||
- Better support for IAR (ARM) with ci build check for stm32 mcus.
|
||||
- Fix Windows build for some mingw gnu make situations
|
||||
|
||||
Controller Driver (DCD & HCD)
|
||||
-----------------------------
|
||||
|
||||
- Add new port support (WIP) for WCH CH32V307 USB Highspeed
|
||||
- Add new port support (WIP) for PIC32MM/MX & PIC24
|
||||
|
||||
- [nRF]
|
||||
|
||||
- Fix endpoint internal state when closed
|
||||
- Fix reception of large ISO packets
|
||||
|
||||
- [rp2040]
|
||||
|
||||
- [dcd] Implement workaround for Errata 15. This enable SOF when bulk-in endpoint is in use and reduce its bandwidth to only 80%
|
||||
- [hcd] Fix shared irq slots filling up when hcd_init() is called multiple times
|
||||
- [hcd] Support host bulk endpoint using hw "interrupt" endpoint. Note speed limit is 64KB/s
|
||||
|
||||
- [samd][dcd] Add support for ISO endpoint
|
||||
- [dwc2][dcd] Add support for stm32u5xx
|
||||
- [esp32sx] Fix Isochronous transfers only transmitted on even frame
|
||||
- [lpc_ip3511][dcd] Add isochronous support and fix endpoint accidental write
|
||||
- [ft90x] Improve and enhance support for FT9xx MCU, tested with more examples
|
||||
|
||||
Device Stack
|
||||
------------
|
||||
|
||||
- [Video]
|
||||
|
||||
- Add support for MJPEG
|
||||
- Fix probe on macOS
|
||||
|
||||
- [MIDI]
|
||||
|
||||
- Support port name strings
|
||||
- fix MS Header wTotalLength computation
|
||||
|
||||
- [HID]
|
||||
|
||||
- Add FIDO descriptor template
|
||||
- change length in tud_hid_report_complete_cb() from uint8 to uint16
|
||||
|
||||
- [CDC]
|
||||
|
||||
- Fix autoflush for FIFO < MPS
|
||||
- Fix tx fifo memory overflown when DTR is not set and tud_cdc_write() is called repeatedly with large enough data
|
||||
|
||||
- [USBTMC] Fix packet size with highspeed
|
||||
|
||||
Host Stack
|
||||
----------
|
||||
|
||||
- Retry a few times with transfers in enumeration since device can be unstable when starting up
|
||||
- [MSC] Rework host masstorage API. Add new **host/msc_file_explorer** example
|
||||
- [CDC]
|
||||
|
||||
- Add support for host cdc
|
||||
- Fix host cdc with device without IAD e.g Arduino Due
|
||||
|
||||
0.14.0
|
||||
======
|
||||
|
||||
- Improve compiler support for CCRX and IAR
|
||||
- Add timeout to osal_queue_receive()
|
||||
- Add tud_task_ext(timeout, in_isr) as generic version of tud_task(). Same as tuh_task_ext(), tuh_task()
|
||||
- Enable more warnings -Wnull-dereference -Wuninitialized -Wunused -Wredundant-decls -Wconversion
|
||||
- Add new examples
|
||||
|
||||
- host/bare_api to demonstrate generic (app-level) enumeration and endpoint transfer
|
||||
- dual/host_hid_to_device_cdc to run both device and host stack concurrently, get HID report from host and print out to device CDC. This example only work with multiple-controller MCUs and rp2040 with the help of pio-usb as added controller.
|
||||
|
||||
Controller Driver (DCD & HCD)
|
||||
-----------------------------
|
||||
|
||||
- Enhance rhports management to better support dual roles
|
||||
|
||||
- CFG_TUD_ENABLED/CFG_TUH_ENABLED, CFG_TUD_MAX_SPEED/CFG_TUH_MAX_SPEED can be used to replace CFG_TUSB_RHPORT0_MODE/CFG_TUSB_RHPORT1_MODE
|
||||
- tud_init(rphort), tuh_init(rhport) can be used to init stack on specified roothub port (controller) instead of tusb_init(void)
|
||||
- Add dcd/hcd port specific defines `TUP_` (stand for tinyusb port-specific)
|
||||
- [dwc2]
|
||||
|
||||
- Update to support stm32 h72x, h73x with only 1 otg controller
|
||||
- Fix overwrite with grstctl when disable endpoint
|
||||
- [EHCI] Fix an issue with EHCI driver
|
||||
- [msp430] Fix for possible bug in msp430-elf-gcc 9.3.0
|
||||
- [nrf5x] Fix DMA access race condition using atomic function
|
||||
- [pic32] Fix PIC32 santiy
|
||||
- [rp2040]
|
||||
|
||||
- Add PICO-PIO-USB as controller (device/host) support for rp2040
|
||||
- Use shared IRQ handlers, so user can also hook the USB IRQ
|
||||
- Fix resumed signal not reported to device stack
|
||||
- [stm32fsdev] Add support for stm32wb55
|
||||
|
||||
Device Stack
|
||||
------------
|
||||
|
||||
- [Audio] Add support for feedback endpoint computation
|
||||
|
||||
- New API tud_audio_feedback_params_cb(), tud_audio_feedback_interval_isr().
|
||||
- Supported computation method are: frequency with fixed/float or power of 2. Feedback with fifo count is not yet supported.
|
||||
- Fix nitfs (should be 3) in TUD_AUDIO_HEADSET_STEREO_DESCRIPTOR
|
||||
- Fix typo in audiod_rx_done_cb()
|
||||
|
||||
- [DFU] Fix coexistence with other interfaces BTH, RNDIS
|
||||
- [MSC] Fix inquiry response additional length field
|
||||
- [Venndor] Improve write performance
|
||||
|
||||
Host Stack
|
||||
----------
|
||||
|
||||
- Add new API tuh_configure(rhport, cfg_id, cfg_param) for dynamnic port specific behavior configuration
|
||||
- [HID] Open OUT endpoint if available
|
||||
- [Hub] hub clear port and device interrupts
|
||||
- [USBH] Major improvement
|
||||
|
||||
- Rework usbh control transfer with complete callback. New API tuh_control_xfer() though still only carry 1 usbh (no queueing) at a time.
|
||||
- Add generic endpoint transfer with tuh_edpt_open(), tuh_edpt_xfer(). Require `CFG_TUH_API_EDPT_XFER=1`
|
||||
- Support app-level enumeration with new APIs
|
||||
|
||||
- tuh_descriptor_get(), tuh_descriptor_get_device(), tuh_descriptor_get_configuration(), tuh_descriptor_get_hid_report()
|
||||
- tuh_descriptor_get_string(), tuh_descriptor_get_manufacturer_string(), tuh_descriptor_get_product_string(), tuh_descriptor_get_serial_string()
|
||||
- Also add _sync() as sync/blocking version for above APIs
|
||||
|
||||
0.13.0
|
||||
======
|
||||
|
||||
- [tu_fifo] Fix locked mutex when full, and return type in peek_n()
|
||||
|
||||
Controller Driver (DCD & HCD)
|
||||
-----------------------------
|
||||
|
||||
- [DWC2] Generalize synopsys dwc2 with synopsys/dwc2 which support both FS and HS phy (UTMI and ULPI) for various MCUs.
|
||||
- Broadcom 28/27xx on raspberrypi SBC
|
||||
- Silicon Labs EFM32
|
||||
- Espressif ESP32 Sx
|
||||
- GigaDevice GD32
|
||||
- ST STM32
|
||||
- Infineon XMC
|
||||
- [KL25] Add new HCD for NXP KL25
|
||||
- [MUSB] Add new DCD and HCD for Mentor musb with TI MSP432E4
|
||||
- [F1C100s] Add new DCD for Allwinner F1C100s family
|
||||
- [PIC32MZ] Add new DCD for PIC32MZ
|
||||
- [nRF] Fix/Enhance various race condition with: EASY DMA, request HFXO, EPOUT
|
||||
- [ChipIdea] rename Transdimension to more popular ChipIdea Highspeed,
|
||||
- [RP2040] various update/fix for hcd/dcd
|
||||
- [FT9XX] new DCD port for Bridgetek FT90x and FT93x devices
|
||||
- [DA1469X] Fix resume
|
||||
- [OHCI] Fix device array out of bound
|
||||
|
||||
Note: legacy drivers such as st/synopsys, nxp/transdimension are still present in this release but won't receive more update and could be removed in the future.
|
||||
|
||||
Device Stack
|
||||
------------
|
||||
|
||||
- [Audio] Support disabling feedback format correction (16.16 <-> 10.14 format)
|
||||
- [MSC] Add tud_msc_request_sense_cb() callback, change most default sense error to medium not present (0x02, 0x3A, 0x00)
|
||||
- [Video] Fix video_capture example fails enumeration when 8FPS
|
||||
|
||||
Host Stack
|
||||
----------
|
||||
|
||||
No notable changes
|
||||
|
||||
0.12.0
|
||||
======
|
||||
|
||||
- add CFG_TUSB_OS_INC_PATH for os include path
|
||||
|
||||
Device Controller Driver (DCD)
|
||||
------------------------------
|
||||
|
||||
- Getting device stack to pass USB Compliance Verification test (chapter9, HID, MSC). Ports are tested:
|
||||
nRF, SAMD 21/51, rp2040, stm32f4, Renesas RX, iMXRT, ESP32-S2/3, Kinetic KL25/32, DA146xx
|
||||
- Added dcd_edpt_close_all() for switching configuration
|
||||
- [Transdimension] Support dcd_edpt_xfer_fifo() with auto wrap over if fifo buffer is 4K aligned and size is multiple of 4K.
|
||||
- [DA146xx] Improve vbus, reset, suspend, resume detection, and remote wakeup.
|
||||
|
||||
Device Stack
|
||||
------------
|
||||
|
||||
- Add new network driver Network Control Model (CDC-NCM), update net_lwip_webserver to work with NCM (need re-configure example)
|
||||
- Add new USB Video Class UVC 1.5 driver and video_capture example ((work in progress)
|
||||
- Fix potential buffer overflow for HID, bluetooth drivers
|
||||
|
||||
Host Controller Driver (HCD)
|
||||
----------------------------
|
||||
|
||||
No notable changes
|
||||
|
||||
Host Stack
|
||||
----------
|
||||
|
||||
No notable changes
|
||||
|
||||
0.11.0 (2021-08-29)
|
||||
===================
|
||||
|
||||
|
@ -234,7 +26,7 @@ Synopsys
|
|||
^^^^^^^^
|
||||
|
||||
- Fix Synopsys set address bug which could cause re-enumeration failed
|
||||
- Fix dcd_synopsys driver integer overflow in HS mode (issue #968)
|
||||
- Fix for dcd_synopsys driver integer overflow in HS mode (issue #968)
|
||||
|
||||
nRF5x
|
||||
^^^^^
|
||||
|
@ -246,7 +38,7 @@ RP2040
|
|||
^^^^^^
|
||||
|
||||
- Add RP2040 suspend & resume support
|
||||
- Implement double buffer for both host and device (#891). However device EPOUT is still single buffered due to techinical issue with short packet
|
||||
- Implement double buffer for both host and device (#891). Howver device EPOUT is still single bufferred due to techinical issue with short packet
|
||||
|
||||
Device Stack
|
||||
------------
|
||||
|
@ -255,7 +47,7 @@ USBD
|
|||
^^^^
|
||||
|
||||
- Better support big endian mcu
|
||||
- Add tuh_inited() and tud_inited(), will separate tusb_init/inited() to tud/tuh init/inited
|
||||
- Add tuh_inited() and tud_inited(), will separte tusb_init/inited() to tud/tuh init/inited
|
||||
- Add dcd_attr.h for defining common controller attribute such as max endpoints
|
||||
|
||||
Bluetooth
|
||||
|
@ -300,8 +92,8 @@ Host Controller Driver (HCD)
|
|||
RP2040
|
||||
^^^^^^
|
||||
|
||||
- Implement double buffered to fix E4 errata and boost performance
|
||||
- Lots of rp2040 update and enhancement
|
||||
- Implement double bufferred to fix E4 errata and boost performance
|
||||
- Lots of rp2040 update and enhancment
|
||||
|
||||
Host Stack
|
||||
----------
|
||||
|
@ -309,7 +101,7 @@ Host Stack
|
|||
- Major update and rework most of host stack, still needs more improvement
|
||||
- Lots of improvement and update in parsing configuration and control
|
||||
- Rework and major update to HID driver. Will default to enable boot interface if available
|
||||
- Separate CFG_TUH_DEVICE_MAX and CFG_TUH_HUB for better management and reduce SRAM usage
|
||||
- Sepearate CFG_TUH_DEVICE_MAX and CFG_TUH_HUB for better management and reduce SRAM usage
|
||||
|
||||
0.10.1 (2021-06-03)
|
||||
===================
|
||||
|
@ -386,12 +178,12 @@ MIDI
|
|||
Host Controller Driver (HCD)
|
||||
----------------------------
|
||||
|
||||
- No noticeable changes
|
||||
- No noticable changes
|
||||
|
||||
USB Host Driver (USBH)
|
||||
----------------------
|
||||
|
||||
- No noticeable changes
|
||||
- No noticable changes
|
||||
|
||||
Host Class Driver
|
||||
-----------------
|
||||
|
@ -464,7 +256,7 @@ HID
|
|||
MIDI
|
||||
|
||||
- Fix dropping MIDI sysex message when fifo is full
|
||||
- Fix typo in tud_midi_write24(), make example less ambiguous for cable and channel
|
||||
- Fix typo in tud_midi_write24(), make example less ambigous for cable and channel
|
||||
- Fix incorrect endpoint descriptor length, MIDI v1 use Audio v1 which has 9-byte endpoint descriptor (instead of 7)
|
||||
|
||||
Host Stack
|
||||
|
@ -779,7 +571,7 @@ Changed
|
|||
- Generalized dcd_stm32f4.c to dcd_synopsys.c
|
||||
- Changed cdc_msc_hid to cdc_msc (drop hid) due to limited endpoints number of some MCUs
|
||||
- Improved DCD SAMD stability, fix missing setup packet occasionally
|
||||
- Improved usbd/usbd_control with proper handling of zero-length packet (ZLP)
|
||||
- Improved usbd/usbd_control with proper hanlding of zero-length packet (ZLP)
|
||||
- Improved STM32 DCD FSDev
|
||||
- Improved STM32 DCD Synopsys
|
||||
- Migrated CI from Travis to Github Action
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
************
|
||||
Dependencies
|
||||
************
|
||||
|
||||
MCU low-level peripheral driver and external libraries for building TinyUSB examples
|
||||
|
||||
======================================== ============================================================== ========================================
|
||||
Path Project Commit
|
||||
======================================== ============================================================== ========================================
|
||||
hw/mcu/allwinner https://github.com/hathach/allwinner_driver.git 8e5e89e8e132c0fd90e72d5422e5d3d68232b756
|
||||
hw/mcu/bridgetek/ft9xx/ft90x-sdk https://github.com/BRTSG-FOSS/ft90x-sdk.git 91060164afe239fcb394122e8bf9eb24d3194eb1
|
||||
hw/mcu/broadcom https://github.com/adafruit/broadcom-peripherals.git 08370086080759ed54ac1136d62d2ad24c6fa267
|
||||
hw/mcu/gd/nuclei-sdk https://github.com/Nuclei-Software/nuclei-sdk.git 7eb7bfa9ea4fbeacfafe1d5f77d5a0e6ed3922e7
|
||||
hw/mcu/infineon/mtb-xmclib-cat3 https://github.com/Infineon/mtb-xmclib-cat3.git daf5500d03cba23e68c2f241c30af79cd9d63880
|
||||
hw/mcu/microchip https://github.com/hathach/microchip_driver.git 9e8b37e307d8404033bb881623a113931e1edf27
|
||||
hw/mcu/mindmotion/mm32sdk https://github.com/hathach/mm32sdk.git 0b79559eb411149d36e073c1635c620e576308d4
|
||||
hw/mcu/nordic/nrfx https://github.com/NordicSemiconductor/nrfx.git 281cc2e178fd9a470d844b3afdea9eb322a0b0e8
|
||||
hw/mcu/nuvoton https://github.com/majbthrd/nuc_driver.git 2204191ec76283371419fbcec207da02e1bc22fa
|
||||
hw/mcu/nxp/lpcopen https://github.com/hathach/nxp_lpcopen.git 43c45c85405a5dd114fff0ea95cca62837740c13
|
||||
hw/mcu/nxp/mcux-sdk https://github.com/NXPmicro/mcux-sdk.git ae2ab01d9d70ad00cd0e935c2552bd5f0e5c0294
|
||||
hw/mcu/nxp/nxp_sdk https://github.com/hathach/nxp_sdk.git 845c8fc49b6fb660f06a5c45225494eacb06f00c
|
||||
hw/mcu/raspberry_pi/Pico-PIO-USB https://github.com/sekigon-gonnoc/Pico-PIO-USB.git c3715ce94b6f6391856de56081d4d9b3e98fa93d
|
||||
hw/mcu/renesas/fsp https://github.com/renesas/fsp.git 8dc14709f2a6518b43f71efad70d900b7718d9f1
|
||||
hw/mcu/renesas/rx https://github.com/kkitayam/rx_device.git 706b4e0cf485605c32351e2f90f5698267996023
|
||||
hw/mcu/silabs/cmsis-dfp-efm32gg12b https://github.com/cmsis-packs/cmsis-dfp-efm32gg12b.git f1c31b7887669cb230b3ea63f9b56769078960bc
|
||||
hw/mcu/sony/cxd56/spresense-exported-sdk https://github.com/sonydevworld/spresense-exported-sdk.git 2ec2a1538362696118dc3fdf56f33dacaf8f4067
|
||||
hw/mcu/st/cmsis_device_f0 https://github.com/STMicroelectronics/cmsis_device_f0.git 2fc25ee22264bc27034358be0bd400b893ef837e
|
||||
hw/mcu/st/cmsis_device_f1 https://github.com/STMicroelectronics/cmsis_device_f1.git 6601104a6397299b7304fd5bcd9a491f56cb23a6
|
||||
hw/mcu/st/cmsis_device_f2 https://github.com/STMicroelectronics/cmsis_device_f2.git 182fcb3681ce116816feb41b7764f1b019ce796f
|
||||
hw/mcu/st/cmsis_device_f3 https://github.com/STMicroelectronics/cmsis_device_f3.git 5e4ee5ed7a7b6c85176bb70a9fd3c72d6eb99f1b
|
||||
hw/mcu/st/cmsis_device_f4 https://github.com/STMicroelectronics/cmsis_device_f4.git 2615e866fa48fe1ff1af9e31c348813f2b19e7ec
|
||||
hw/mcu/st/cmsis_device_f7 https://github.com/STMicroelectronics/cmsis_device_f7.git fc676ef1ad177eb874eaa06444d3d75395fc51f4
|
||||
hw/mcu/st/cmsis_device_g0 https://github.com/STMicroelectronics/cmsis_device_g0.git 08258b28ee95f50cb9624d152a1cbf084be1f9a5
|
||||
hw/mcu/st/cmsis_device_g4 https://github.com/STMicroelectronics/cmsis_device_g4.git ce822adb1dc552b3aedd13621edbc7fdae124878
|
||||
hw/mcu/st/cmsis_device_h7 https://github.com/STMicroelectronics/cmsis_device_h7.git 60dc2c913203dc8629dc233d4384dcc41c91e77f
|
||||
hw/mcu/st/cmsis_device_l0 https://github.com/STMicroelectronics/cmsis_device_l0.git 06748ca1f93827befdb8b794402320d94d02004f
|
||||
hw/mcu/st/cmsis_device_l1 https://github.com/STMicroelectronics/cmsis_device_l1.git 7f16ec0a1c4c063f84160b4cc6bf88ad554a823e
|
||||
hw/mcu/st/cmsis_device_l4 https://github.com/STMicroelectronics/cmsis_device_l4.git 6ca7312fa6a5a460b5a5a63d66da527fdd8359a6
|
||||
hw/mcu/st/cmsis_device_l5 https://github.com/STMicroelectronics/cmsis_device_l5.git d922865fc0326a102c26211c44b8e42f52c1e53d
|
||||
hw/mcu/st/cmsis_device_u5 https://github.com/STMicroelectronics/cmsis_device_u5.git bc00f3c9d8a4e25220f84c26d414902cc6bdf566
|
||||
hw/mcu/st/cmsis_device_wb https://github.com/STMicroelectronics/cmsis_device_wb.git 9c5d1920dd9fabbe2548e10561d63db829bb744f
|
||||
hw/mcu/st/stm32f0xx_hal_driver https://github.com/STMicroelectronics/stm32f0xx_hal_driver.git 0e95cd88657030f640a11e690a8a5186c7712ea5
|
||||
hw/mcu/st/stm32f1xx_hal_driver https://github.com/STMicroelectronics/stm32f1xx_hal_driver.git 1dd9d3662fb7eb2a7f7d3bc0a4c1dc7537915a29
|
||||
hw/mcu/st/stm32f2xx_hal_driver https://github.com/STMicroelectronics/stm32f2xx_hal_driver.git c75ace9b908a9aca631193ebf2466963b8ea33d0
|
||||
hw/mcu/st/stm32f3xx_hal_driver https://github.com/STMicroelectronics/stm32f3xx_hal_driver.git 1761b6207318ede021706e75aae78f452d72b6fa
|
||||
hw/mcu/st/stm32f4xx_hal_driver https://github.com/STMicroelectronics/stm32f4xx_hal_driver.git 04e99fbdabd00ab8f370f377c66b0a4570365b58
|
||||
hw/mcu/st/stm32f7xx_hal_driver https://github.com/STMicroelectronics/stm32f7xx_hal_driver.git f7ffdf6bf72110e58b42c632b0a051df5997e4ee
|
||||
hw/mcu/st/stm32g0xx_hal_driver https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git 5b53e6cee664a82b16c86491aa0060e2110c00cb
|
||||
hw/mcu/st/stm32g4xx_hal_driver https://github.com/STMicroelectronics/stm32g4xx_hal_driver.git 8b4518417706d42eef5c14e56a650005abf478a8
|
||||
hw/mcu/st/stm32h7xx_hal_driver https://github.com/STMicroelectronics/stm32h7xx_hal_driver.git d8461b980b59b1625207d8c4f2ce0a9c2a7a3b04
|
||||
hw/mcu/st/stm32l0xx_hal_driver https://github.com/STMicroelectronics/stm32l0xx_hal_driver.git fbdacaf6f8c82a4e1eb9bd74ba650b491e97e17b
|
||||
hw/mcu/st/stm32l1xx_hal_driver https://github.com/STMicroelectronics/stm32l1xx_hal_driver.git 44efc446fa69ed8344e7fd966e68ed11043b35d9
|
||||
hw/mcu/st/stm32l4xx_hal_driver https://github.com/STMicroelectronics/stm32l4xx_hal_driver.git aee3d5bf283ae5df87532b781bdd01b7caf256fc
|
||||
hw/mcu/st/stm32l5xx_hal_driver https://github.com/STMicroelectronics/stm32l5xx_hal_driver.git 675c32a75df37f39d50d61f51cb0dcf53f07e1cb
|
||||
hw/mcu/st/stm32u5xx_hal_driver https://github.com/STMicroelectronics/stm32u5xx_hal_driver.git 2e1d4cdb386e33391cb261dfff4fefa92e4aa35a
|
||||
hw/mcu/st/stm32wbxx_hal_driver https://github.com/STMicroelectronics/stm32wbxx_hal_driver.git 2c5f06638be516c1b772f768456ba637f077bac8
|
||||
hw/mcu/ti https://github.com/hathach/ti_driver.git 143ed6cc20a7615d042b03b21e070197d473e6e5
|
||||
hw/mcu/wch/ch32v307 https://github.com/openwch/ch32v307.git 17761f5cf9dbbf2dcf665b7c04934188add20082
|
||||
lib/CMSIS_5 https://github.com/ARM-software/CMSIS_5.git 20285262657d1b482d132d20d755c8c330d55c1f
|
||||
lib/FreeRTOS-Kernel https://github.com/FreeRTOS/FreeRTOS-Kernel.git def7d2df2b0506d3d249334974f51e427c17a41c
|
||||
lib/lwip https://github.com/lwip-tcpip/lwip.git 159e31b689577dbf69cf0683bbaffbd71fa5ee10
|
||||
lib/sct_neopixel https://github.com/gsteiert/sct_neopixel.git e73e04ca63495672d955f9268e003cffe168fcd8
|
||||
tools/uf2 https://github.com/microsoft/uf2.git 19615407727073e36d81bf239c52108ba92e7660
|
||||
======================================== ============================================================== ========================================
|
|
@ -37,14 +37,22 @@ It is relatively simple to incorporate tinyusb to your (existing) project
|
|||
Examples
|
||||
--------
|
||||
|
||||
For your convenience, TinyUSB contains a handful of examples for both host and device with/without RTOS to quickly test the functionality as well as demonstrate how API() should be used. Most examples will work on most of `the supported boards <supported.rst>`_. Firstly we need to ``git clone`` if not already
|
||||
For your convenience, TinyUSB contains a handful of examples for both host and device with/without RTOS to quickly test the functionality as well as demonstrate how API() should be used. Most examples will work on most of `the supported Boards <boards.md>`_. Firstly we need to ``git clone`` if not already
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ git clone https://github.com/hathach/tinyusb tinyusb
|
||||
$ cd tinyusb
|
||||
|
||||
Some ports will also require a port-specific SDK (e.g. RP2040) or binary (e.g. Sony Spresense) to build examples. They are out of scope for tinyusb, you should download/install it first according to its manufacturer guide.
|
||||
Some TinyUSB examples also requires external submodule libraries in ``/lib`` such as FreeRTOS, Lightweight IP to build. Run following command to fetch them
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ git submodule update --init lib
|
||||
|
||||
In addition, MCU driver submodule is also needed to provide low-level MCU peripheral's driver. Luckily, it will be fetched if needed when you run the ``make`` to build your board.
|
||||
|
||||
Note: some examples especially those that uses Vendor class (e.g webUSB) may requires udev permission on Linux (and/or macOS) to access usb device. It depends on your OS distro, typically copy ``/examples/device/99-tinyusb.rules`` file to /etc/udev/rules.d/ then run ``sudo udevadm control --reload-rules && sudo udevadm trigger`` is good enough.
|
||||
|
||||
Build
|
||||
^^^^^
|
||||
|
@ -55,25 +63,13 @@ To build example, first change directory to an example folder.
|
|||
|
||||
$ cd examples/device/cdc_msc
|
||||
|
||||
Before building, we firstly need to download dependencies such as: MCU low-level peripheral driver and external libraries e.g FreeRTOS (required by some examples). Run the ``get-deps`` target in one of the example folder as follow. You only need to do this once per mcu. Check out `complete list of dependencies and their designated path here <dependencies.rst>`_
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ make BOARD=raspberry_pi_pico get-deps
|
||||
|
||||
Then compile with ``make BOARD=[board_name] all``\ , for example
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ make BOARD=raspberry_pi_pico all
|
||||
$ make BOARD=feather_nrf52840_express all
|
||||
|
||||
Note: ``BOARD`` can be found as directory name in ``hw/bsp``\ , either in its family/boards or directly under bsp (no family).
|
||||
Note: some examples especially those that uses Vendor class (e.g webUSB) may requires udev permission on Linux (and/or macOS) to access usb device. It depends on your OS distro, typically copy ``99-tinyusb.rules`` and reload your udev is good to go
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ cp examples/device/99-tinyusb.rules /etc/udev/rules.d/
|
||||
$ sudo udevadm control --reload-rules && sudo udevadm trigger
|
||||
|
||||
Port Selection
|
||||
~~~~~~~~~~~~~~
|
||||
|
@ -93,15 +89,6 @@ A MCU can support multiple operational speed. By default, the example build syst
|
|||
|
||||
$ make BOARD=stm32f746disco SPEED=full all
|
||||
|
||||
Size Analysis
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
First install `linkermap tool <https://github.com/hathach/linkermap>`_ then ``linkermap`` target can be used to analyze code size. You may want to compile with ``NO_LTO=1`` since -flto merges code across .o files and make it difficult to analyze.
|
||||
|
||||
.. code-block::
|
||||
|
||||
$ make BOARD=feather_nrf52840_express NO_LTO=1 all linkermap
|
||||
|
||||
Debug
|
||||
^^^^^
|
||||
|
||||
|
@ -126,7 +113,7 @@ Logger
|
|||
By default log message is printed via on-board UART which is slow and take lots of CPU time comparing to USB speed. If your board support on-board/external debugger, it would be more efficient to use it for logging. There are 2 protocols:
|
||||
|
||||
|
||||
* `LOGGER=rtt`: use `Segger RTT protocol <https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/>`_
|
||||
* `LOGGER=rtt`: use [Segger RTT protocol](https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/)
|
||||
|
||||
* Cons: requires jlink as the debugger.
|
||||
* Pros: work with most if not all MCUs
|
||||
|
@ -164,39 +151,3 @@ Some board use uf2 bootloader for drag & drop in to mass storage device, uf2 can
|
|||
.. code-block::
|
||||
|
||||
$ make BOARD=feather_nrf52840_express all uf2
|
||||
|
||||
IAR Support
|
||||
^^^^^^^^^^^
|
||||
|
||||
IAR Project Connection files are provided to import TinyUSB stack into your project.
|
||||
|
||||
* A buldable project of your MCU need to be created in advance.
|
||||
|
||||
|
||||
* Take example of STM32F0:
|
||||
|
||||
- You need `stm32l0xx.h`, `startup_stm32f0xx.s`, `system_stm32f0xx.c`.
|
||||
|
||||
- `STM32L0xx_HAL_Driver` is only needed to run examples, TinyUSB stack itself doesn't rely on MCU's SDKs.
|
||||
|
||||
* Open `Tools -> Configure Custom Argument Variables` (Switch to `Global` tab if you want to do it for all your projects)
|
||||
Click `New Group ...`, name it to `TUSB`, Click `Add Variable ...`, name it to `TUSB_DIR`, change it's value to the path of your TinyUSB stack,
|
||||
for example `C:\\tinyusb`
|
||||
|
||||
Import stack only
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
1. Open `Project -> Add project Connection ...`, click `OK`, choose `tinyusb\\tools\\iar_template.ipcf`.
|
||||
|
||||
Run examples
|
||||
~~~~~~~~~~~~
|
||||
|
||||
1. (Python3 is needed) Run `iar_gen.py` to generate .ipcf files of examples:
|
||||
|
||||
.. code-block::
|
||||
|
||||
cd C:\tinyusb\tools
|
||||
python iar_gen.py
|
||||
|
||||
2. Open `Project -> Add project Connection ...`, click `OK`, choose `tinyusb\\examples\\(.ipcf of example)`.
|
||||
For example `C:\\tinyusb\\examples\\device\\cdc_msc\\iar_cdc_msc.ipcf`
|
||||
|
|
|
@ -25,7 +25,7 @@ Supports multiple device configurations by dynamically changing usb descriptors.
|
|||
- Vendor-specific class support with generic In & Out endpoints. Can be used with MS OS 2.0 compatible descriptor to load winUSB driver without INF file.
|
||||
- `WebUSB <https://github.com/WICG/webusb>`__ with vendor-specific class
|
||||
|
||||
If you have special need, `usbd_app_driver_get_cb()` can be used to write your own class driver without modifying the stack. Here is how RPi team add their reset interface `raspberrypi/pico-sdk#197 <https://github.com/raspberrypi/pico-sdk/pull/197>`__
|
||||
If you have special need, `usbd_app_driver_get_cb()` can be used to write your own class driver without modifying the stack. Here is how RPi team add their reset interface [raspberrypi/pico-sdk#197](https://github.com/raspberrypi/pico-sdk/pull/197)
|
||||
|
||||
Host Stack
|
||||
==========
|
||||
|
@ -41,7 +41,7 @@ TinyUSB is completely thread-safe by pushing all ISR events into a central queue
|
|||
|
||||
- **No OS**
|
||||
- **FreeRTOS**
|
||||
- **Mynewt** Due to the newt package build system, Mynewt examples are better to be on its `own repo <https://github.com/hathach/mynewt-tinyusb-example>`__
|
||||
- **Mynewt** Due to the newt package build system, Mynewt examples are better to be on its [own repo](https://github.com/hathach/mynewt-tinyusb-example)
|
||||
|
||||
License
|
||||
=======
|
||||
|
@ -56,5 +56,4 @@ Index
|
|||
|
||||
supported
|
||||
getting_started
|
||||
dependencies
|
||||
concurrency
|
||||
|
|
|
@ -2,124 +2,126 @@
|
|||
Supported Devices
|
||||
*****************
|
||||
|
||||
|
||||
Supported MCUs
|
||||
==============
|
||||
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Manufacturer | Family | Device | Host | Highspeed | Driver | Note |
|
||||
+==============+=======================+========+======+===========+===================+==============+
|
||||
| Broadcom | BCM2711, BCM2837 | ✔ | | ✔ | dwc2 | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Dialog | DA1469x | ✔ | ✖ | ✖ | da146xx | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Espressif | ESP32 S2, S3 | ✔ | | ✖ | dwc2 or esp32sx | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| GigaDevice | GD32VF103 | ✔ | | ✖ | dwc2 | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Infineon | XMC4500 | ✔ | | ✖ | dwc2 | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| MicroChip | SAM D11, D21 | ✔ | | ✖ | samd | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | SAM D51, E5x | ✔ | | ✖ | samd | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | SAM G55 | ✔ | | ✖ | samg | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | SAM L21, L22 | ✔ | | ✖ | samd | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | SAM E70,S70,V70,V71 | ✔ | | ✔ | samx7x | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| NordicSemi | nRF52833, nRF52840 | ✔ | ✖ | ✖ | nrf5x | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | nRF5340 | ✔ | ✖ | ✖ | nrf5x | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Nuvoton | NUC120 | ✔ | ✖ | ✖ | | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | NUC121/NUC125 | ✔ | ✖ | ✖ | | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | NUC126 | ✔ | ✖ | ✖ | | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | NUC505 | ✔ | | ✔ | | |
|
||||
+--------------+---------+-------------+--------+------+-----------+-------------------+--------------+
|
||||
| NXP | iMXRT | RT10xx | ✔ | ✔ | ✔ | ci_hs | |
|
||||
| | +-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | RT11xx | ✔ | ✔ | ✔ | ci_hs | |
|
||||
| +---------+-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | Kinetis | KL25 | ✔ | ⚠ | ✖ | | |
|
||||
| | +-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | K32L2 | ✔ | | ✖ | | |
|
||||
| +---------+-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | LPC | 11u, 13, 15 | ✔ | ✖ | ✖ | lpc_ip3511 | |
|
||||
| | +-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | 17, 40 | ✔ | ⚠ | ✖ | lpc17_40 | |
|
||||
| | +-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | 18, 43 | ✔ | ✔ | ✔ | ci_hs | |
|
||||
| | +-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | 51u | ✔ | ✖ | ✖ | lpc_ip3511 | |
|
||||
| | +-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | 54 | ✔ | | ✔ | lpc_ip3511 | |
|
||||
| | +-------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | 55 | ✔ | | ✔ | lpc_ip3511 | |
|
||||
+--------------+---------+-------------+--------+------+-----------+-------------------+--------------+
|
||||
| Raspberry Pi | RP2040 | ✔ | ✔ | ✖ | rp2040, pio_usb | |
|
||||
+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| Renesas | RX | 63N, 65N, 72N | ✔ | ✔ | ✖ | rusb2 | |
|
||||
| +-----+-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| | RA | XXX | ✔ | ✔ | | rusb2 | |
|
||||
+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+
|
||||
| Silabs | EFM32GG12 | ✔ | | ✖ | dwc2 | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| Sony | CXD56 | ✔ | ✖ | ✔ | cxd56 | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| ST STM32 | F0 | ✔ | ✖ | ✖ | stm32_fsdev | |
|
||||
| +----+------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | F1 | 102, 103 | ✔ | ✖ | ✖ | stm32_fsdev | |
|
||||
| | +------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | 105, 107 | ✔ | | ✖ | dwc2 | |
|
||||
| +----+------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | F2 | ✔ | | ✔ | dwc2 | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | F3 | ✔ | ✖ | ✖ | stm32_fsdev | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | F4 | ✔ | | ✔ | dwc2 | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | F7 | ✔ | | ✔ | dwc2 | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | H7 | ✔ | | ✔ | dwc2 | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | G4 | ✔ | ✖ | ✖ | stm32_fsdev | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | L0, L1 | ✔ | ✖ | ✖ | stm32_fsdev | |
|
||||
| +----+------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | L4 | 4x2, 4x3 | ✔ | ✖ | ✖ | stm32_fsdev | |
|
||||
| | +------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | | 4x5, 4x6 | ✔ | | | dwc2 | |
|
||||
| +----+------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | L4+ | ✔ | | | dwc2 | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | U5 | ⚠ | | | dwc2 | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | WBx5 | ✔ | | | stm32_fsdev | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| TI | MSP430 | ✔ | ✖ | ✖ | msp430x5xx | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | MSP432E4 | ✔ | | ✖ | musb | |
|
||||
| +-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| | TM4C123 | ✔ | | ✖ | musb | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| ValentyUSB | eptri | ✔ | ✖ | ✖ | eptri | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
| WCH | CH32V307 | ✔ | | ✔ | ch32v307 | |
|
||||
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
|
||||
.. admonition:: Warning
|
||||
:class: warning
|
||||
|
||||
This table is a WIP! the data is not correct, tho if a device is listed, it likely works as a usb full speed device at the least.
|
||||
|
||||
+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| Manufacturer | Family | Device | Host | FS | HS | Known Issues |
|
||||
+==============+====================+===================+====================+===================+===================+==============+
|
||||
| Dialog | DA1469x | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| Espressif | ESP32-S2 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | ESP32-S3 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| MicroChip | SAMD11 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | SAMD21 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | SAMD51 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | SAME5x | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | SAMG55 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | SAML21 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | SAML22 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | SAME70,S70,V70,V71 | |:green_square:| | |:red_square:| | |:green_square:| | |:green_square:| | |
|
||||
+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| NordicSemi | nRF52833 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | nRF52840 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| Nuvoton | NUC120 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | NUC121/NUC125 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | NUC126 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | NUC505 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
+--------------+-------+------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| NXP | iMX | RT1011 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | RT1015 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | RT1021 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | RT1052 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | RT1062 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | RT1064 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
|
||||
| +-------+------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | Kinetis KL25 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| +-------+------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | LPC | 11u | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | 13 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | 15 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | 17 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | 18 | | |:yellow_square:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | 40 | | |:x:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | 43 | |:green_square:| | |:yellow_square:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | 51u | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | 54 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | 55 | |:green_square:| | |:x:| | |:green_square:| | | |
|
||||
+--------------+-------+------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| Raspberry Pi | RP2040 | |:green_square:| | |:x:| | |:green_square:| | | |
|
||||
+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| Renesas | RX63N | | | | | |
|
||||
| +--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | RX65N | | | | | |
|
||||
+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| Silabs | EFM32GG12 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | #750 |
|
||||
+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| Sony | CXD56 | |:green_square:| | |:x:| | |:green_square:| | |:x:| | |
|
||||
+--------------+-------+------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| ST | STM32 | L0 | |:green_square:| | | |:green_square:| | | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | F0 | |:green_square:| | | |:green_square:| | | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | F1 | |:green_square:| | | |:green_square:| | | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | F2 | |:green_square:| | | |:green_square:| | | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | F3 | |:green_square:| | | |:green_square:| | | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | F4 | |:green_square:| | | |:green_square:| | | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | F7 | |:green_square:| | | |:green_square:| | | |
|
||||
| | +------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| | | H7 | |:green_square:| | | |:green_square:| | |:green_square:| | |
|
||||
+--------------+-------+------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| TI | MSP430 | |:green_square:| | | |:green_square:| | | |
|
||||
+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
| ValentyUSB | eptri | |:green_square:| | | |:green_square:| | | |
|
||||
+--------------+--------------------+-------------------+--------------------+-------------------+-------------------+--------------+
|
||||
|
||||
Table Legend
|
||||
------------
|
||||
|
||||
= ===================
|
||||
✔ Supported
|
||||
⚠ WIP/partial support
|
||||
✖ Not supported
|
||||
= ===================
|
||||
================= ===================
|
||||
|:x:| Not available
|
||||
|:red_square:| Not supported
|
||||
|:yellow_square:| WIP/partial support
|
||||
|:green_square:| Supported
|
||||
================= ===================
|
||||
|
||||
Supported Boards
|
||||
================
|
||||
|
@ -132,11 +134,6 @@ The board support code is only used for self-contained examples and testing. It
|
|||
|
||||
The following boards are supported (sorted alphabetically):
|
||||
|
||||
Broadcom
|
||||
--------
|
||||
|
||||
- `Raspberry Pi CM4 <https://www.raspberrypi.com/products/compute-module-4>`__
|
||||
|
||||
Dialog DA146xx
|
||||
--------------
|
||||
|
||||
|
@ -146,25 +143,12 @@ Dialog DA146xx
|
|||
Espressif ESP32-S2
|
||||
------------------
|
||||
|
||||
- `Adafruit Feather ESP32-S2 <https://www.adafruit.com/product/5000>`__
|
||||
- Adafruit Feather ESP32-S2
|
||||
- `Adafruit Magtag 2.9" E-Ink WiFi Display <https://www.adafruit.com/product/4800>`__
|
||||
- `Adafruit Metro ESP32-S2 <https://www.adafruit.com/product/4775>`__
|
||||
- `ESP32-S2-Kaluga-1 <https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-esp32-s2-kaluga-1-kit.html>`__
|
||||
- `ESP32-S2-Saola-1 <https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-saola-1-v1.2.html>`__
|
||||
|
||||
GigaDevice
|
||||
----------
|
||||
|
||||
- `Sipeed Longan Nano <https://longan.sipeed.com/en/>`__
|
||||
|
||||
Infineon
|
||||
---------
|
||||
|
||||
XMC4000
|
||||
^^^^^^^
|
||||
|
||||
- `XMC4500 Relax (Lite) Kit <https://www.infineon.com/cms/en/product/evaluation-boards/kit_xmc45_relax_lite_v1/>`__
|
||||
|
||||
MicroChip
|
||||
---------
|
||||
|
||||
|
@ -175,7 +159,7 @@ SAMD11 & SAMD21
|
|||
- `Adafruit Feather M0 Express <https://www.adafruit.com/product/3403>`__
|
||||
- `Adafruit ItsyBitsy M0 Express <https://www.adafruit.com/product/3727>`__
|
||||
- `Adafruit Metro M0 Express <https://www.adafruit.com/product/3505>`__
|
||||
- `Great Scott Gadgets Cynthion <https://greatscottgadgets.com/cynthion/>`__
|
||||
- `Great Scott Gadgets LUNA <https://greatscottgadgets.com/luna/>`__
|
||||
- `Microchip SAMD11 Xplained Pro <https://www.microchip.com/developmenttools/ProductDetails/atsamd11-xpro>`__
|
||||
- `Microchip SAMD21 Xplained Pro <https://www.microchip.com/DevelopmentTools/ProductDetails/ATSAMD21-XPRO>`__
|
||||
- `Seeeduino Xiao <https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html>`__
|
||||
|
@ -191,12 +175,6 @@ SAMD51 & SAME54
|
|||
- `D5035-01 <https://github.com/RudolphRiedel/USB_CAN-FD>`__
|
||||
- `Microchip SAME54 Xplained Pro <https://www.microchip.com/developmenttools/productdetails/atsame54-xpro>`__
|
||||
|
||||
SAME7x
|
||||
^^^^^^
|
||||
|
||||
- `Microchip SAME70 Xplained <https://www.microchip.com/en-us/development-tool/ATSAME70-XPLD>`_
|
||||
- `QMTECH ATSAME70N19 <https://www.aliexpress.com/item/1005003173783268.html>`_
|
||||
|
||||
SAMG
|
||||
^^^^
|
||||
|
||||
|
@ -247,15 +225,11 @@ iMX RT
|
|||
- `MIMX RT1060 Evaluation Kit <https://www.nxp.com/design/development-boards/i.mx-evaluation-and-development-boards/mimxrt1060-evk-i.mx-rt1060-evaluation-kit:MIMXRT1060-EVK>`__
|
||||
- `MIMX RT1064 Evaluation Kit <https://www.nxp.com/design/development-boards/i.mx-evaluation-and-development-boards/mimxrt1064-evk-i.mx-rt1064-evaluation-kit:MIMXRT1064-EVK>`__
|
||||
- `Teensy 4.0 Development Board <https://www.pjrc.com/store/teensy40.html>`__
|
||||
- `Teensy 4.1 Development Board <https://www.pjrc.com/store/teensy41.html>`__
|
||||
|
||||
Kinetis
|
||||
^^^^^^^
|
||||
|
||||
- `Freedom FRDM-KL25Z <https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/freedom-development-platform-for-kinetis-kl14-kl15-kl24-kl25-mcus:FRDM-KL25Z>`__
|
||||
- `Freedom FRDM-K32L2A4S <https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/nxp-freedom-platform-for-k32-l2a-mcus:FRDM-K32L2A4S>`__
|
||||
- `Freedom FRDM-K32L2B3 <https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/nxp-freedom-development-platform-for-k32-l2b-mcus:FRDM-K32L2B3>`__
|
||||
- `KUIIC <https://github.com/nxf58843/kuiic>`__
|
||||
- `FRDM-KL25Z <https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/freedom-development-platform-for-kinetis-kl14-kl15-kl24-kl25-mcus:FRDM-KL25Z>`__
|
||||
|
||||
LPC 11-13-15
|
||||
^^^^^^^^^^^^
|
||||
|
@ -298,17 +272,8 @@ LPC55
|
|||
- `LPCXpresso 55s69 EVK <https://www.nxp.com/design/development-boards/lpcxpresso-boards/lpcxpresso55s69-development-board:LPC55S69-EVK>`__
|
||||
- `MCU-Link <https://www.nxp.com/design/development-boards/lpcxpresso-boards/mcu-link-debug-probe:MCU-LINK>`__
|
||||
|
||||
Renesas
|
||||
-------
|
||||
|
||||
RA
|
||||
^^
|
||||
|
||||
- `Evaluation Kit for RA4M1 <https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ek-ra4m1-evaluation-kit-ra4m1-mcu-group>`__
|
||||
- `Evaluation Kit for RA4M3 <https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ek-ra4m3-evaluation-kit-ra4m3-mcu-group>`__
|
||||
|
||||
RX
|
||||
^^
|
||||
Renesas RX
|
||||
----------
|
||||
|
||||
- `GR-CITRUS <https://www.renesas.com/us/en/products/gadget-renesas/boards/gr-citrus>`__
|
||||
- `Renesas RX65N Target Board <https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rx-32-bit-performance-efficiency-mcus/rtk5rx65n0c00000br-target-board-rx65n>`__
|
||||
|
@ -334,85 +299,39 @@ Sony
|
|||
ST STM32
|
||||
--------
|
||||
|
||||
F0
|
||||
^^
|
||||
- `Adafruit Feather STM32F405 <https://www.adafruit.com/product/4382>`__
|
||||
- `Micro Python PyBoard v1.1 <https://store.micropython.org/product/PYBv1.1>`__
|
||||
- `STLink-V3 Mini <https://www.st.com/en/development-tools/stlink-v3mini.html>`__
|
||||
- `STM32 L035c8 Discovery <https://www.st.com/en/evaluation-tools/32l0538discovery.html>`__
|
||||
- `STM32 L4R5zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-l4r5zi.html>`__
|
||||
- `STM32 F070rb Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f070rb.html>`__
|
||||
- `STM32 F072 Evaluation <https://www.st.com/en/evaluation-tools/stm32072b-eval.html>`__
|
||||
- `STM32 F072rb Discovery <https://www.st.com/en/evaluation-tools/32f072bdiscovery.html>`__
|
||||
|
||||
F1
|
||||
^^
|
||||
- `STM32 F103c8 Blue Pill <https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill>`__
|
||||
- `STM32 F103rc Mini v2.0 <https://stm32-base.org/boards/STM32F103RCT6-STM32-Mini-V2.0>`__
|
||||
|
||||
F2
|
||||
^^
|
||||
- `STM32 F207zg Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f207zg.html>`__
|
||||
|
||||
F3
|
||||
^^
|
||||
- `STM32 F303vc Discovery <https://www.st.com/en/evaluation-tools/stm32f3discovery.html>`__
|
||||
|
||||
F4
|
||||
^^
|
||||
- `Adafruit Feather STM32F405 <https://www.adafruit.com/product/4382>`__
|
||||
- `Micro Python PyBoard v1.1 <https://store.micropython.org/product/PYBv1.1>`__
|
||||
- `STM32 F401cc Black Pill <https://stm32-base.org/boards/STM32F401CCU6-WeAct-Black-Pill-V1.2>`__
|
||||
- `STM32 F407vg Discovery <https://www.st.com/en/evaluation-tools/stm32f4discovery.html>`__
|
||||
- `STM32 F411ce Black Pill <https://www.adafruit.com/product/4877>`__
|
||||
- `STM32 F411ve Discovery <https://www.st.com/en/evaluation-tools/32f411ediscovery.html>`__
|
||||
- `STM32 F412zg Discovery <https://www.st.com/en/evaluation-tools/32f412gdiscovery.html>`__
|
||||
- `STM32 F412zg Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f412zg.html>`__
|
||||
- `STM32 F439zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f439zi.html>`__
|
||||
|
||||
F7
|
||||
^^
|
||||
|
||||
- `STLink-V3 Mini <https://www.st.com/en/development-tools/stlink-v3mini.html>`__
|
||||
- `STM32 F723e Discovery <https://www.st.com/en/evaluation-tools/32f723ediscovery.html>`__
|
||||
- `STM32 F746zg Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f746zg.html>`__
|
||||
- `STM32 F746g Discovery <https://www.st.com/en/evaluation-tools/32f746gdiscovery.html>`__
|
||||
- `STM32 F767zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-f767zi.html>`__
|
||||
- `STM32 F769i Discovery <https://www.st.com/en/evaluation-tools/32f769idiscovery.html>`__
|
||||
|
||||
H7
|
||||
^^
|
||||
- `STM32 H743zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-h743zi.html>`__
|
||||
- `STM32 H743i Evaluation <https://www.st.com/en/evaluation-tools/stm32h743i-eval.html>`__
|
||||
- `STM32 H745i Discovery <https://www.st.com/en/evaluation-tools/stm32h745i-disco.html>`__
|
||||
- `Waveshare OpenH743I-C <https://www.waveshare.com/openh743i-c-standard.htm>`__
|
||||
|
||||
G4
|
||||
^^
|
||||
- `STM32 G474RE Nucleo <https://www.st.com/en/evaluation-tools/nucleo-g474re.html>`__
|
||||
|
||||
L0
|
||||
^^
|
||||
- `STM32 L035c8 Discovery <https://www.st.com/en/evaluation-tools/32l0538discovery.html>`__
|
||||
|
||||
L4
|
||||
^^
|
||||
- `STM32 L476vg Discovery <https://www.st.com/en/evaluation-tools/32l476gdiscovery.html>`__
|
||||
- `STM32 L4P5zg Nucleo <https://www.st.com/en/evaluation-tools/nucleo-l4p5zg.html>`__
|
||||
- `STM32 L4R5zi Nucleo <https://www.st.com/en/evaluation-tools/nucleo-l4r5zi.html>`__
|
||||
|
||||
WB
|
||||
^^
|
||||
- `STM32 WB55 Nucleo <https://www.st.com/en/evaluation-tools/p-nucleo-wb55.html>`__
|
||||
|
||||
TI
|
||||
--
|
||||
|
||||
- `MSP430F5529 USB LaunchPad Evaluation Kit <http://www.ti.com/tool/MSP-EXP430F5529LP>`__
|
||||
- `MSP-EXP432E401Y LaunchPad Evaluation Kit <https://www.ti.com/tool/MSP-EXP432E401Y>`__
|
||||
- `TM4C123GXL LaunchPad Evaluation Kit <https://www.ti.com/tool/EK-TM4C123GXL>`__
|
||||
|
||||
Tomu
|
||||
----
|
||||
|
||||
- `Fomu <https://www.crowdsupply.com/sutajio-kosagi/fomu>`__
|
||||
|
||||
WCH
|
||||
---
|
||||
|
||||
- `CH32V307V-R1-1v0 <https://lcsc.com/product-detail/Development-Boards-Kits_WCH-Jiangsu-Qin-Heng-CH32V307V-EVT-R1_C2943980.html>`
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
sphinx>=5.0
|
||||
sphinx~=3.0
|
||||
furo>=2020.12.30.b24
|
||||
sphinxemoji>=0.1.8
|
||||
sphinx-autodoc-typehints>=1.10
|
||||
jinja2>=3.0.3
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.17)
|
||||
|
||||
#set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../hw/bsp/family_support.cmake)
|
||||
|
||||
project(tinyusb_examples C CXX ASM)
|
||||
|
||||
add_subdirectory(device)
|
||||
add_subdirectory(dual)
|
||||
add_subdirectory(host)
|
||||
add_subdirectory(typec)
|
|
@ -12,10 +12,3 @@ ATTRS{idVendor}=="cafe", MODE="0666", GROUP="dialout"
|
|||
|
||||
# Rule to blacklist TinyUSB example from being manipulated by ModemManager.
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="cafe", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
|
||||
# Xplained Pro SamG55 Device
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2111", MODE="0666", GROUP="users", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
SUBSYSTEMS=="tty", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2111", MODE="0666", GROUP="users", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
|
||||
# TI Stellaris/Tiva-C Launchpad ICDI
|
||||
SUBSYSTEM=="usb", ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666"
|
||||
|
|
|
@ -1,23 +1,20 @@
|
|||
cmake_minimum_required(VERSION 3.17)
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
|
||||
|
||||
project(tinyusb_device_examples C CXX ASM)
|
||||
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(audio_test_multi_rate)
|
||||
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(cdc_uac2)
|
||||
family_add_subdirectory(dfu)
|
||||
family_add_subdirectory(dfu_runtime)
|
||||
family_add_subdirectory(dynamic_configuration)
|
||||
family_add_subdirectory(hid_boot_interface)
|
||||
family_add_subdirectory(hid_composite)
|
||||
family_add_subdirectory(hid_composite_freertos)
|
||||
family_add_subdirectory(hid_generic_inout)
|
||||
|
@ -27,5 +24,4 @@ family_add_subdirectory(msc_dual_lun)
|
|||
family_add_subdirectory(net_lwip_webserver)
|
||||
family_add_subdirectory(uac2_headset)
|
||||
family_add_subdirectory(usbtmc)
|
||||
family_add_subdirectory(video_capture)
|
||||
family_add_subdirectory(webusb_serial)
|
||||
|
|
0
examples/device/audio_4_channel_mic/.skip.MCU_SAME5X
Normal file
0
examples/device/audio_4_channel_mic/.skip.MCU_SAME5X
Normal file
0
examples/device/audio_4_channel_mic/.skip.MCU_SAMG
Normal file
0
examples/device/audio_4_channel_mic/.skip.MCU_SAMG
Normal file
|
@ -1,38 +1,28 @@
|
|||
cmake_minimum_required(VERSION 3.17)
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
project(${PROJECT} C CXX ASM)
|
||||
project(${PROJECT})
|
||||
|
||||
# Checks this example is valid for the family and initializes the project
|
||||
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Espressif has its own cmake build system
|
||||
if(FAMILY STREQUAL "espressif")
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_executable(${PROJECT})
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||
)
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
)
|
||||
|
||||
# Add libm for GCC
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_libraries(${PROJECT} PUBLIC m)
|
||||
endif()
|
||||
|
||||
# Configure compilation flags and libraries for the example without RTOS.
|
||||
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
||||
family_configure_device_example(${PROJECT} noos)
|
||||
# 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,3 +1,4 @@
|
|||
include ../../../tools/top.mk
|
||||
include ../../make.mk
|
||||
|
||||
INC += \
|
||||
|
@ -5,10 +6,7 @@ INC += \
|
|||
$(TOP)/hw \
|
||||
|
||||
# Example source
|
||||
EXAMPLE_SOURCE += \
|
||||
src/main.c \
|
||||
src/usb_descriptors.c \
|
||||
|
||||
EXAMPLE_SOURCE += $(wildcard src/*.c)
|
||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||
|
||||
include ../../rules.mk
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
mcu:SAMD11
|
||||
mcu:SAME5X
|
||||
mcu:SAMG
|
||||
family:broadcom_64bit
|
|
@ -34,16 +34,17 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "bsp/board.h"
|
||||
#include "tusb.h"
|
||||
#include "tusb_config.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF PROTYPES
|
||||
//--------------------------------------------------------------------+
|
||||
#define AUDIO_SAMPLE_RATE CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE
|
||||
|
||||
#ifndef AUDIO_SAMPLE_RATE
|
||||
#define AUDIO_SAMPLE_RATE 48000
|
||||
#endif
|
||||
|
||||
/* Blink pattern
|
||||
* - 250 ms : device not mounted
|
||||
|
@ -69,13 +70,8 @@ uint8_t clkValid;
|
|||
audio_control_range_2_n_t(1) volumeRng[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX+1]; // Volume range state
|
||||
audio_control_range_4_n_t(1) sampleFreqRng; // Sample frequency range state
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
// Audio test data, each buffer contains 2 channels, buffer[0] for CH0-1, buffer[1] for CH1-2
|
||||
// Audio test data
|
||||
uint16_t i2s_dummy_buffer[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ/2]; // Ensure half word aligned
|
||||
#else
|
||||
// Audio test data, 4 channels muxed together, buffer[0] for CH0, buffer[1] for CH1, buffer[2] for CH2, buffer[3] for CH3
|
||||
uint16_t i2s_dummy_buffer[CFG_TUD_AUDIO_EP_SZ_IN]; // Ensure half word aligned
|
||||
#endif
|
||||
|
||||
void led_blinking_task(void);
|
||||
void audio_task(void);
|
||||
|
@ -85,12 +81,7 @@ int main(void)
|
|||
{
|
||||
board_init();
|
||||
|
||||
// init device stack on configured roothub port
|
||||
tud_init(BOARD_TUD_RHPORT);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
}
|
||||
tusb_init();
|
||||
|
||||
// Init values
|
||||
sampFreq = AUDIO_SAMPLE_RATE;
|
||||
|
@ -101,51 +92,15 @@ int main(void)
|
|||
sampleFreqRng.subrange[0].bMax = AUDIO_SAMPLE_RATE;
|
||||
sampleFreqRng.subrange[0].bRes = 0;
|
||||
|
||||
// Generate dummy data
|
||||
#if CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
uint16_t * p_buff = i2s_dummy_buffer[0];
|
||||
uint16_t dataVal = 1;
|
||||
for (uint16_t cnt = 0; cnt < AUDIO_SAMPLE_RATE/1000; cnt++)
|
||||
{
|
||||
// CH0 saw wave
|
||||
*p_buff++ = dataVal;
|
||||
// CH1 inverted saw wave
|
||||
*p_buff++ = 60 + AUDIO_SAMPLE_RATE/1000 - dataVal;
|
||||
dataVal++;
|
||||
}
|
||||
p_buff = i2s_dummy_buffer[1];
|
||||
for (uint16_t cnt = 0; cnt < AUDIO_SAMPLE_RATE/1000; cnt++)
|
||||
{
|
||||
// CH3 square wave
|
||||
*p_buff++ = cnt < (AUDIO_SAMPLE_RATE/1000/2) ? 120:170;
|
||||
// CH4 sinus wave
|
||||
float t = 2*3.1415f * cnt / (AUDIO_SAMPLE_RATE/1000);
|
||||
*p_buff++ = (uint16_t)(sinf(t) * 25) + 200;
|
||||
}
|
||||
#else
|
||||
uint16_t * p_buff = i2s_dummy_buffer;
|
||||
uint16_t dataVal = 1;
|
||||
for (uint16_t cnt = 0; cnt < AUDIO_SAMPLE_RATE/1000; cnt++)
|
||||
{
|
||||
// CH0 saw wave
|
||||
*p_buff++ = dataVal;
|
||||
// CH1 inverted saw wave
|
||||
*p_buff++ = 60 + AUDIO_SAMPLE_RATE/1000 - dataVal;
|
||||
dataVal++;
|
||||
// CH3 square wave
|
||||
*p_buff++ = cnt < (AUDIO_SAMPLE_RATE/1000/2) ? 120:170;
|
||||
// CH4 sinus wave
|
||||
float t = 2*3.1415f * cnt / (AUDIO_SAMPLE_RATE/1000);
|
||||
*p_buff++ = (uint16_t)(sinf(t) * 25) + 200;
|
||||
}
|
||||
#endif
|
||||
|
||||
while (1)
|
||||
{
|
||||
tud_task(); // tinyusb device task
|
||||
led_blinking_task();
|
||||
audio_task();
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -176,7 +131,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
|
|||
// Invoked when usb bus is resumed
|
||||
void tud_resume_cb(void)
|
||||
{
|
||||
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
|
||||
blink_interval_ms = BLINK_MOUNTED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -186,7 +141,7 @@ void tud_resume_cb(void)
|
|||
void audio_task(void)
|
||||
{
|
||||
// Yet to be filled - e.g. put meas data into TX FIFOs etc.
|
||||
// asm("nop");
|
||||
asm("nop");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -265,7 +220,7 @@ bool tud_audio_set_req_entity_cb(uint8_t rhport, tusb_control_request_t const *
|
|||
// Request uses format layout 2
|
||||
TU_VERIFY(p_request->wLength == sizeof(audio_control_cur_2_t));
|
||||
|
||||
volume[channelNum] = (uint16_t) ((audio_control_cur_2_t*) pBuff)->bCur;
|
||||
volume[channelNum] = ((audio_control_cur_2_t*) pBuff)->bCur;
|
||||
|
||||
TU_LOG2(" Set Volume: %d dB of channel: %u\r\n", volume[channelNum], channelNum);
|
||||
return true;
|
||||
|
@ -334,7 +289,7 @@ bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const *
|
|||
|
||||
// Those are dummy values for now
|
||||
ret.bNrChannels = 1;
|
||||
ret.bmChannelConfig = (audio_channel_config_t) 0;
|
||||
ret.bmChannelConfig = 0;
|
||||
ret.iChannelNames = 0;
|
||||
|
||||
TU_LOG2(" Get terminal connector\r\n");
|
||||
|
@ -407,8 +362,7 @@ bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const *
|
|||
{
|
||||
case AUDIO_CS_REQ_CUR:
|
||||
TU_LOG2(" Get Sample Freq.\r\n");
|
||||
// Buffered control transfer is needed for IN flow control to work
|
||||
return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, &sampFreq, sizeof(sampFreq));
|
||||
return tud_control_xfer(rhport, p_request, &sampFreq, sizeof(sampFreq));
|
||||
|
||||
case AUDIO_CS_REQ_RANGE:
|
||||
TU_LOG2(" Get Sample Freq. range\r\n");
|
||||
|
@ -444,24 +398,11 @@ bool tud_audio_tx_done_pre_load_cb(uint8_t rhport, uint8_t itf, uint8_t ep_in, u
|
|||
(void) ep_in;
|
||||
(void) cur_alt_setting;
|
||||
|
||||
|
||||
// In read world application data flow is driven by I2S clock,
|
||||
// both tud_audio_tx_done_pre_load_cb() & tud_audio_tx_done_post_load_cb() are hardly used.
|
||||
// For example in your I2S receive callback:
|
||||
// void I2S_Rx_Callback(int channel, const void* data, uint16_t samples)
|
||||
// {
|
||||
// tud_audio_write_support_ff(channel, data, samples * N_BYTES_PER_SAMPLE * N_CHANNEL_PER_FIFO);
|
||||
// }
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
// Write I2S buffer into FIFO
|
||||
for (uint8_t cnt=0; cnt < 2; cnt++)
|
||||
for (uint8_t cnt=0; cnt < CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO; cnt++)
|
||||
{
|
||||
tud_audio_write_support_ff(cnt, i2s_dummy_buffer[cnt], AUDIO_SAMPLE_RATE/1000 * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX);
|
||||
}
|
||||
#else
|
||||
tud_audio_write(i2s_dummy_buffer, AUDIO_SAMPLE_RATE/1000 * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -473,6 +414,22 @@ bool tud_audio_tx_done_post_load_cb(uint8_t rhport, uint16_t n_bytes_copied, uin
|
|||
(void) ep_in;
|
||||
(void) cur_alt_setting;
|
||||
|
||||
uint16_t dataVal;
|
||||
|
||||
// Generate dummy data
|
||||
for (uint16_t cnt = 0; cnt < CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO; cnt++)
|
||||
{
|
||||
uint16_t * p_buff = i2s_dummy_buffer[cnt]; // 2 bytes per sample
|
||||
dataVal = 1;
|
||||
for (uint16_t cnt2 = 0; cnt2 < AUDIO_SAMPLE_RATE/1000; cnt2++)
|
||||
{
|
||||
for (uint8_t cnt3 = 0; cnt3 < CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX; cnt3++)
|
||||
{
|
||||
*p_buff++ = dataVal;
|
||||
}
|
||||
dataVal++;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,11 +10,11 @@ if __name__ == '__main__':
|
|||
# print(sd.query_devices())
|
||||
|
||||
fs = 48000 # Sample rate
|
||||
duration = 1 # Duration of recording
|
||||
duration = 100e-3 # Duration of recording
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
# WDM-KS is needed since there are more than one MicNode device APIs (at least in Windows)
|
||||
device = 'Microphone (MicNode_4_Ch), Windows WASAPI'
|
||||
device = 'Microphone (MicNode_4_Ch), Windows WDM-KS'
|
||||
elif platform.system() == 'Darwin':
|
||||
device = 'MicNode_4_Ch'
|
||||
else:
|
||||
|
@ -25,13 +25,10 @@ if __name__ == '__main__':
|
|||
sd.wait() # Wait until recording is finished
|
||||
print('Done!')
|
||||
|
||||
|
||||
time = np.arange(0, duration, 1 / fs) # time vector
|
||||
# strip starting zero
|
||||
|
||||
plt.plot(time, myrecording)
|
||||
plt.xlabel('Time [s]')
|
||||
plt.ylabel('Amplitude')
|
||||
plt.title('MicNode 4 Channel')
|
||||
plt.legend(['CH-1', 'CH-2', 'CH-3','CH-4'])
|
||||
plt.show()
|
||||
|
|
@ -30,20 +30,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Board Specific Configuration
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// RHPort number used for device can be defined by board.mk, default to port 0
|
||||
#ifndef BOARD_TUD_RHPORT
|
||||
#define BOARD_TUD_RHPORT 0
|
||||
#endif
|
||||
|
||||
// RHPort max operational speed can defined by board.mk
|
||||
#ifndef BOARD_TUD_MAX_SPEED
|
||||
#define BOARD_TUD_MAX_SPEED OPT_MODE_DEFAULT_SPEED
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// COMMON CONFIGURATION
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -53,6 +39,12 @@ extern "C" {
|
|||
#error CFG_TUSB_MCU must be defined
|
||||
#endif
|
||||
|
||||
#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
|
||||
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED)
|
||||
#else
|
||||
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
|
||||
#endif
|
||||
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
@ -61,11 +53,8 @@ extern "C" {
|
|||
#define CFG_TUSB_DEBUG 0
|
||||
#endif
|
||||
|
||||
// Enable Device stack
|
||||
#define CFG_TUD_ENABLED 1
|
||||
|
||||
// Default is max speed that hardware controller could support with on-chip PHY
|
||||
#define CFG_TUD_MAX_SPEED BOARD_TUD_MAX_SPEED
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
||||
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
|
||||
* Tinyusb use follows macros to declare transferring memory so that they can be put
|
||||
|
@ -91,11 +80,11 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
//------------- CLASS -------------//
|
||||
#define CFG_TUD_AUDIO 1
|
||||
#define CFG_TUD_CDC 0
|
||||
#define CFG_TUD_MSC 0
|
||||
#define CFG_TUD_HID 0
|
||||
#define CFG_TUD_MIDI 0
|
||||
#define CFG_TUD_AUDIO 1
|
||||
#define CFG_TUD_VENDOR 0
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -103,7 +92,6 @@ extern "C" {
|
|||
//--------------------------------------------------------------------
|
||||
|
||||
// Have a look into audio_device.h for all configurations
|
||||
#define CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE 48000
|
||||
|
||||
#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_MIC_FOUR_CH_DESC_LEN
|
||||
|
||||
|
@ -113,27 +101,15 @@ extern "C" {
|
|||
#define CFG_TUD_AUDIO_ENABLE_EP_IN 1
|
||||
#define CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX 2 // This value is not required by the driver, it parses this information from the descriptor once the alternate interface is set by the host - we use it for the setup
|
||||
#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 4 // This value is not required by the driver, it parses this information from the descriptor once the alternate interface is set by the host - we use it for the setup
|
||||
#define CFG_TUD_AUDIO_EP_SZ_IN TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX)
|
||||
|
||||
#define CFG_TUD_AUDIO_ENABLE_ENCODING 1
|
||||
#define CFG_TUD_AUDIO_EP_IN_FLOW_CONTROL 1
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
|
||||
#define CFG_TUD_AUDIO_EP_SZ_IN (48 + 1) * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX // 48 Samples (48 kHz) x 2 Bytes/Sample x CFG_TUD_AUDIO_N_CHANNELS_TX Channels - the Windows driver always needs an extra sample per channel of space more, otherwise it complains... found by trial and error
|
||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_EP_SZ_IN
|
||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ CFG_TUD_AUDIO_EP_SZ_IN
|
||||
|
||||
#define CFG_TUD_AUDIO_ENABLE_ENCODING 1
|
||||
#define CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING 1
|
||||
#define CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX 2 // One I2S stream contains two channels, each stream is saved within one support FIFO - this value is currently fixed, the driver does not support a changing value
|
||||
#define CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO (CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX / CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX)
|
||||
#define CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ 4 * (CFG_TUD_AUDIO_EP_SZ_IN / CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO) // Minimum 4*EP size is needed for flow control
|
||||
|
||||
#else
|
||||
|
||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_EP_SZ_IN
|
||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ 4 * CFG_TUD_AUDIO_EP_SZ_IN // Minimum 4*EP size is needed for flow control
|
||||
|
||||
#endif
|
||||
#define CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ (CFG_TUD_AUDIO_EP_SZ_IN / CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
|
||||
|
@ -45,7 +44,7 @@ tusb_desc_device_t const desc_device =
|
|||
.bDescriptorType = TUSB_DESC_DEVICE,
|
||||
.bcdUSB = 0x0200,
|
||||
|
||||
// Use Interface Association Descriptor (IAD) for Audio
|
||||
// Use Interface Association Descriptor (IAD) for CDC
|
||||
// As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
|
||||
.bDeviceClass = TUSB_CLASS_MISC,
|
||||
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
|
||||
|
@ -82,23 +81,18 @@ enum
|
|||
|
||||
#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + CFG_TUD_AUDIO * TUD_AUDIO_MIC_FOUR_CH_DESC_LEN)
|
||||
|
||||
#if TU_CHECK_MCU(OPT_MCU_LPC175X_6X, OPT_MCU_LPC177X_8X, OPT_MCU_LPC40XX)
|
||||
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
|
||||
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
|
||||
#define EPNUM_AUDIO 0x03
|
||||
|
||||
#elif TU_CHECK_MCU(OPT_MCU_NRF5X)
|
||||
// nRF5x ISO can only be endpoint 8
|
||||
#define EPNUM_AUDIO 0x08
|
||||
|
||||
#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
|
||||
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
|
||||
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
|
||||
#define EPNUM_AUDIO 0x03
|
||||
#else
|
||||
#define EPNUM_AUDIO 0x01
|
||||
#define EPNUM_AUDIO 0x01
|
||||
#endif
|
||||
|
||||
uint8_t const desc_configuration[] =
|
||||
{
|
||||
// Config number, interface count, string index, total length, attribute, power in mA
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
|
||||
// Interface count, string index, total length, attribute, power in mA
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
|
||||
|
||||
// Interface number, string index, EP Out & EP In address, EP size
|
||||
TUD_AUDIO_MIC_FOUR_CH_DESCRIPTOR(/*_itfnum*/ ITF_NUM_AUDIO_CONTROL, /*_stridx*/ 0, /*_nBytesPerSample*/ CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX, /*_nBitsUsedPerSample*/ CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX*8, /*_epin*/ 0x80 | EPNUM_AUDIO, /*_epsize*/ CFG_TUD_AUDIO_EP_SZ_IN)
|
||||
|
@ -117,63 +111,50 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
|||
// String Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// String Descriptor Index
|
||||
enum {
|
||||
STRID_LANGID = 0,
|
||||
STRID_MANUFACTURER,
|
||||
STRID_PRODUCT,
|
||||
STRID_SERIAL,
|
||||
};
|
||||
|
||||
// array of pointer to string descriptors
|
||||
char const* string_desc_arr [] = {
|
||||
char const* string_desc_arr [] =
|
||||
{
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"PaniRCorp", // 1: Manufacturer
|
||||
"MicNode_4_Ch", // 2: Product
|
||||
NULL, // 3: Serials will use unique ID if possible
|
||||
"123458", // 3: Serials, should use chip ID
|
||||
"UAC2", // 4: Audio Interface
|
||||
};
|
||||
|
||||
static uint16_t _desc_str[32 + 1];
|
||||
static uint16_t _desc_str[32];
|
||||
|
||||
// Invoked when received GET STRING DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||
{
|
||||
(void) langid;
|
||||
size_t chr_count;
|
||||
|
||||
switch ( index ) {
|
||||
case STRID_LANGID:
|
||||
uint8_t chr_count;
|
||||
|
||||
if ( index == 0)
|
||||
{
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
break;
|
||||
}else
|
||||
{
|
||||
// Convert ASCII string into UTF-16
|
||||
|
||||
case STRID_SERIAL:
|
||||
chr_count = board_usb_get_serial(_desc_str + 1, 32);
|
||||
break;
|
||||
if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
|
||||
|
||||
default:
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
|
||||
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
|
||||
|
||||
const char *str = string_desc_arr[index];
|
||||
const char* str = string_desc_arr[index];
|
||||
|
||||
// Cap at max char
|
||||
chr_count = strlen(str);
|
||||
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
|
||||
if ( chr_count > max_count ) chr_count = max_count;
|
||||
if ( chr_count > 31 ) chr_count = 31;
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for ( size_t i = 0; i < chr_count; i++ ) {
|
||||
_desc_str[1 + i] = str[i];
|
||||
for(uint8_t i=0; i<chr_count; i++)
|
||||
{
|
||||
_desc_str[1+i] = str[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// first byte is length (including header), second byte is string type
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8) | (2 * chr_count + 2));
|
||||
_desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
|
||||
|
||||
return _desc_str;
|
||||
}
|
||||
|
|
0
examples/device/audio_test/.skip.MCU_SAMD11
Normal file
0
examples/device/audio_test/.skip.MCU_SAMD11
Normal file
0
examples/device/audio_test/.skip.MCU_SAME5X
Normal file
0
examples/device/audio_test/.skip.MCU_SAME5X
Normal file
0
examples/device/audio_test/.skip.MCU_SAMG
Normal file
0
examples/device/audio_test/.skip.MCU_SAMG
Normal file
|
@ -1,33 +1,28 @@
|
|||
cmake_minimum_required(VERSION 3.17)
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
project(${PROJECT} C CXX ASM)
|
||||
project(${PROJECT})
|
||||
|
||||
# Checks this example is valid for the family and initializes the project
|
||||
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Espressif has its own cmake build system
|
||||
if(FAMILY STREQUAL "espressif")
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_executable(${PROJECT})
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||
)
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
)
|
||||
|
||||
# Configure compilation flags and libraries for the example without RTOS.
|
||||
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
||||
family_configure_device_example(${PROJECT} noos)
|
||||
# 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,3 +1,4 @@
|
|||
include ../../../tools/top.mk
|
||||
include ../../make.mk
|
||||
|
||||
INC += \
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
mcu:SAMD11
|
||||
mcu:SAME5X
|
||||
mcu:SAMG
|
|
@ -35,7 +35,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "bsp/board.h"
|
||||
#include "tusb.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -71,7 +71,7 @@ audio_control_range_2_n_t(1) volumeRng[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX+1];
|
|||
audio_control_range_4_n_t(1) sampleFreqRng; // Sample frequency range state
|
||||
|
||||
// Audio test data
|
||||
uint16_t test_buffer_audio[(CFG_TUD_AUDIO_EP_SZ_IN - 2) / 2];
|
||||
uint16_t test_buffer_audio[CFG_TUD_AUDIO_EP_SZ_IN/2];
|
||||
uint16_t startVal = 0;
|
||||
|
||||
void led_blinking_task(void);
|
||||
|
@ -82,12 +82,7 @@ int main(void)
|
|||
{
|
||||
board_init();
|
||||
|
||||
// init device stack on configured roothub port
|
||||
tud_init(BOARD_TUD_RHPORT);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
}
|
||||
tusb_init();
|
||||
|
||||
// Init values
|
||||
sampFreq = AUDIO_SAMPLE_RATE;
|
||||
|
@ -104,6 +99,9 @@ int main(void)
|
|||
led_blinking_task();
|
||||
audio_task();
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -134,7 +132,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
|
|||
// Invoked when usb bus is resumed
|
||||
void tud_resume_cb(void)
|
||||
{
|
||||
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
|
||||
blink_interval_ms = BLINK_MOUNTED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -144,7 +142,7 @@ void tud_resume_cb(void)
|
|||
void audio_task(void)
|
||||
{
|
||||
// Yet to be filled - e.g. put meas data into TX FIFOs etc.
|
||||
// asm("nop");
|
||||
asm("nop");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -223,7 +221,7 @@ bool tud_audio_set_req_entity_cb(uint8_t rhport, tusb_control_request_t const *
|
|||
// Request uses format layout 2
|
||||
TU_VERIFY(p_request->wLength == sizeof(audio_control_cur_2_t));
|
||||
|
||||
volume[channelNum] = (uint16_t) ((audio_control_cur_2_t*) pBuff)->bCur;
|
||||
volume[channelNum] = ((audio_control_cur_2_t*) pBuff)->bCur;
|
||||
|
||||
TU_LOG2(" Set Volume: %d dB of channel: %u\r\n", volume[channelNum], channelNum);
|
||||
return true;
|
||||
|
@ -292,7 +290,7 @@ bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const *
|
|||
|
||||
// Those are dummy values for now
|
||||
ret.bNrChannels = 1;
|
||||
ret.bmChannelConfig = (audio_channel_config_t) 0;
|
||||
ret.bmChannelConfig = 0;
|
||||
ret.iChannelNames = 0;
|
||||
|
||||
TU_LOG2(" Get terminal connector\r\n");
|
||||
|
@ -401,7 +399,7 @@ bool tud_audio_tx_done_pre_load_cb(uint8_t rhport, uint8_t itf, uint8_t ep_in, u
|
|||
(void) ep_in;
|
||||
(void) cur_alt_setting;
|
||||
|
||||
tud_audio_write ((uint8_t *)test_buffer_audio, CFG_TUD_AUDIO_EP_SZ_IN - 2);
|
||||
tud_audio_write ((uint8_t *)test_buffer_audio, CFG_TUD_AUDIO_EP_SZ_IN);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -414,7 +412,7 @@ bool tud_audio_tx_done_post_load_cb(uint8_t rhport, uint16_t n_bytes_copied, uin
|
|||
(void) ep_in;
|
||||
(void) cur_alt_setting;
|
||||
|
||||
for (size_t cnt = 0; cnt < (CFG_TUD_AUDIO_EP_SZ_IN - 2) / 2; cnt++)
|
||||
for (size_t cnt = 0; cnt < CFG_TUD_AUDIO_EP_SZ_IN/2; cnt++)
|
||||
{
|
||||
test_buffer_audio[cnt] = startVal++;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ import sounddevice as sd
|
|||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import platform
|
||||
import csv
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
|
@ -33,5 +32,3 @@ if __name__ == '__main__':
|
|||
plt.title('MicNode')
|
||||
plt.show()
|
||||
|
||||
samples = np.array(myrecording)
|
||||
np.savetxt('Output.csv', samples, delimiter=",", fmt='%s')
|
||||
|
|
|
@ -30,20 +30,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Board Specific Configuration
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// RHPort number used for device can be defined by board.mk, default to port 0
|
||||
#ifndef BOARD_TUD_RHPORT
|
||||
#define BOARD_TUD_RHPORT 0
|
||||
#endif
|
||||
|
||||
// RHPort max operational speed can defined by board.mk
|
||||
#ifndef BOARD_TUD_MAX_SPEED
|
||||
#define BOARD_TUD_MAX_SPEED OPT_MODE_DEFAULT_SPEED
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// COMMON CONFIGURATION
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -53,6 +39,12 @@ extern "C" {
|
|||
#error CFG_TUSB_MCU must be defined
|
||||
#endif
|
||||
|
||||
#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
|
||||
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED)
|
||||
#else
|
||||
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
|
||||
#endif
|
||||
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
@ -61,12 +53,6 @@ extern "C" {
|
|||
#define CFG_TUSB_DEBUG 0
|
||||
#endif
|
||||
|
||||
// Enable Device stack
|
||||
#define CFG_TUD_ENABLED 1
|
||||
|
||||
// Default is max speed that hardware controller could support with on-chip PHY
|
||||
#define CFG_TUD_MAX_SPEED BOARD_TUD_MAX_SPEED
|
||||
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
||||
|
@ -94,11 +80,11 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
//------------- CLASS -------------//
|
||||
#define CFG_TUD_AUDIO 1
|
||||
#define CFG_TUD_CDC 0
|
||||
#define CFG_TUD_MSC 0
|
||||
#define CFG_TUD_HID 0
|
||||
#define CFG_TUD_MIDI 0
|
||||
#define CFG_TUD_AUDIO 1
|
||||
#define CFG_TUD_VENDOR 0
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -114,7 +100,7 @@ extern "C" {
|
|||
#define CFG_TUD_AUDIO_ENABLE_EP_IN 1
|
||||
#define CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX 2 // Driver gets this info from the descriptors - we define it here to use it to setup the descriptors and to do calculations with it below
|
||||
#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 1 // Driver gets this info from the descriptors - we define it here to use it to setup the descriptors and to do calculations with it below - be aware: for different number of channels you need another descriptor!
|
||||
#define CFG_TUD_AUDIO_EP_SZ_IN (48 + 1) * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX // 48 Samples (48 kHz) x 2 Bytes/Sample x CFG_TUD_AUDIO_N_CHANNELS_TX Channels - One extra sample is needed for asynchronous transfer adjustment, see feedback EP
|
||||
#define CFG_TUD_AUDIO_EP_SZ_IN 48 * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX // 48 Samples (48 kHz) x 2 Bytes/Sample x 1 Channel
|
||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_EP_SZ_IN // Maximum EP IN size for all AS alternate settings used
|
||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ CFG_TUD_AUDIO_EP_SZ_IN + 1
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
|
||||
|
@ -45,7 +44,7 @@ tusb_desc_device_t const desc_device =
|
|||
.bDescriptorType = TUSB_DESC_DEVICE,
|
||||
.bcdUSB = 0x0200,
|
||||
|
||||
// Use Interface Association Descriptor (IAD) for Audio
|
||||
// Use Interface Association Descriptor (IAD) for CDC
|
||||
// As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
|
||||
.bDeviceClass = TUSB_CLASS_MISC,
|
||||
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
|
||||
|
@ -83,22 +82,17 @@ enum
|
|||
#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + CFG_TUD_AUDIO * TUD_AUDIO_MIC_ONE_CH_DESC_LEN)
|
||||
|
||||
#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
|
||||
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
|
||||
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
|
||||
#define EPNUM_AUDIO 0x03
|
||||
|
||||
#elif TU_CHECK_MCU(OPT_MCU_NRF5X)
|
||||
// nRF5x ISO can only be endpoint 8
|
||||
#define EPNUM_AUDIO 0x08
|
||||
|
||||
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
|
||||
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
|
||||
#define EPNUM_AUDIO 0x03
|
||||
#else
|
||||
#define EPNUM_AUDIO 0x01
|
||||
#define EPNUM_AUDIO 0x01
|
||||
#endif
|
||||
|
||||
uint8_t const desc_configuration[] =
|
||||
{
|
||||
// Config number, interface count, string index, total length, attribute, power in mA
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
|
||||
// Interface count, string index, total length, attribute, power in mA
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
|
||||
|
||||
// Interface number, string index, EP Out & EP In address, EP size
|
||||
TUD_AUDIO_MIC_ONE_CH_DESCRIPTOR(/*_itfnum*/ ITF_NUM_AUDIO_CONTROL, /*_stridx*/ 0, /*_nBytesPerSample*/ CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX, /*_nBitsUsedPerSample*/ CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX*8, /*_epin*/ 0x80 | EPNUM_AUDIO, /*_epsize*/ CFG_TUD_AUDIO_EP_SZ_IN)
|
||||
|
@ -117,65 +111,50 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
|||
// String Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// String Descriptor Index
|
||||
enum {
|
||||
STRID_LANGID = 0,
|
||||
STRID_MANUFACTURER,
|
||||
STRID_PRODUCT,
|
||||
STRID_SERIAL,
|
||||
};
|
||||
|
||||
// array of pointer to string descriptors
|
||||
char const* string_desc_arr [] =
|
||||
{
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"PaniRCorp", // 1: Manufacturer
|
||||
"MicNode", // 2: Product
|
||||
NULL, // 3: Serials will use unique ID if possible
|
||||
"123456", // 3: Serials, should use chip ID
|
||||
"UAC2", // 4: Audio Interface
|
||||
|
||||
};
|
||||
|
||||
static uint16_t _desc_str[32 + 1];
|
||||
static uint16_t _desc_str[32];
|
||||
|
||||
// Invoked when received GET STRING DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||
{
|
||||
(void) langid;
|
||||
size_t chr_count;
|
||||
|
||||
switch ( index ) {
|
||||
case STRID_LANGID:
|
||||
uint8_t chr_count;
|
||||
|
||||
if ( index == 0)
|
||||
{
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
break;
|
||||
}else
|
||||
{
|
||||
// Convert ASCII string into UTF-16
|
||||
|
||||
case STRID_SERIAL:
|
||||
chr_count = board_usb_get_serial(_desc_str + 1, 32);
|
||||
break;
|
||||
if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
|
||||
|
||||
default:
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
|
||||
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
|
||||
|
||||
const char *str = string_desc_arr[index];
|
||||
const char* str = string_desc_arr[index];
|
||||
|
||||
// Cap at max char
|
||||
chr_count = strlen(str);
|
||||
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
|
||||
if ( chr_count > max_count ) chr_count = max_count;
|
||||
if ( chr_count > 31 ) chr_count = 31;
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for ( size_t i = 0; i < chr_count; i++ ) {
|
||||
_desc_str[1 + i] = str[i];
|
||||
for(uint8_t i=0; i<chr_count; i++)
|
||||
{
|
||||
_desc_str[1+i] = str[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// first byte is length (including header), second byte is string type
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8) | (2 * chr_count + 2));
|
||||
_desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
|
||||
|
||||
return _desc_str;
|
||||
}
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.17)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
project(${PROJECT} C CXX ASM)
|
||||
|
||||
# Checks this example is valid for the family and initializes the project
|
||||
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Espressif has its own cmake build system
|
||||
if(FAMILY STREQUAL "espressif")
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_executable(${PROJECT})
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Configure compilation flags and libraries for the example without RTOS.
|
||||
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
||||
family_configure_device_example(${PROJECT} noos)
|
|
@ -1,11 +0,0 @@
|
|||
include ../../make.mk
|
||||
|
||||
INC += \
|
||||
src \
|
||||
$(TOP)/hw \
|
||||
|
||||
# Example source
|
||||
EXAMPLE_SOURCE += $(wildcard src/*.c)
|
||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||
|
||||
include ../../rules.mk
|
|
@ -1,3 +0,0 @@
|
|||
mcu:SAMD11
|
||||
mcu:SAME5X
|
||||
mcu:SAMG
|
|
@ -1,525 +0,0 @@
|
|||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Reinhard Panhuber
|
||||
* Copyright (c) 2022 HiFiPhile
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
/* plot_audio_samples.py requires following modules:
|
||||
* $ sudo apt install libportaudio
|
||||
* $ pip3 install sounddevice matplotlib
|
||||
*
|
||||
* Then run
|
||||
* $ python3 plot_audio_samples.py
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
#include "usb_descriptors.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF PROTYPES
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
/* Blink pattern
|
||||
* - 250 ms : device not mounted
|
||||
* - 1000 ms : device mounted
|
||||
* - 2500 ms : device is suspended
|
||||
*/
|
||||
enum {
|
||||
BLINK_NOT_MOUNTED = 250,
|
||||
BLINK_MOUNTED = 1000,
|
||||
BLINK_SUSPENDED = 2500,
|
||||
};
|
||||
|
||||
static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
|
||||
|
||||
// Audio controls
|
||||
// Current states
|
||||
bool mute[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX + 1]; // +1 for master channel 0
|
||||
uint16_t volume[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX + 1]; // +1 for master channel 0
|
||||
uint32_t sampFreq;
|
||||
uint8_t bytesPerSample;
|
||||
uint8_t clkValid;
|
||||
|
||||
// Range states
|
||||
// List of supported sample rates
|
||||
static const uint32_t sampleRatesList[] =
|
||||
{
|
||||
32000, 48000, 96000
|
||||
};
|
||||
|
||||
#define N_sampleRates TU_ARRAY_SIZE(sampleRatesList)
|
||||
|
||||
// Bytes per format of every Alt settings
|
||||
static const uint8_t bytesPerSampleAltList[CFG_TUD_AUDIO_FUNC_1_N_FORMATS] =
|
||||
{
|
||||
CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX,
|
||||
CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX,
|
||||
};
|
||||
|
||||
audio_control_range_2_n_t(1) volumeRng[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX+1]; // Volume range state
|
||||
|
||||
|
||||
// Audio test data
|
||||
CFG_TUSB_MEM_ALIGN uint8_t test_buffer_audio[CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX];
|
||||
uint16_t startVal = 0;
|
||||
|
||||
void led_blinking_task(void);
|
||||
void audio_task(void);
|
||||
|
||||
/*------------- MAIN -------------*/
|
||||
int main(void)
|
||||
{
|
||||
board_init();
|
||||
|
||||
// init device stack on configured roothub port
|
||||
tud_init(BOARD_TUD_RHPORT);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
}
|
||||
|
||||
// Init values
|
||||
sampFreq = sampleRatesList[0];
|
||||
clkValid = 1;
|
||||
|
||||
while (1)
|
||||
{
|
||||
tud_task(); // tinyusb device task
|
||||
led_blinking_task();
|
||||
audio_task();
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Device callbacks
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// Invoked when device is mounted
|
||||
void tud_mount_cb(void)
|
||||
{
|
||||
blink_interval_ms = BLINK_MOUNTED;
|
||||
}
|
||||
|
||||
// Invoked when device is unmounted
|
||||
void tud_umount_cb(void)
|
||||
{
|
||||
blink_interval_ms = BLINK_NOT_MOUNTED;
|
||||
}
|
||||
|
||||
// Invoked when usb bus is suspended
|
||||
// remote_wakeup_en : if host allow us to perform remote wakeup
|
||||
// Within 7ms, device must draw an average of current less than 2.5 mA from bus
|
||||
void tud_suspend_cb(bool remote_wakeup_en)
|
||||
{
|
||||
(void) remote_wakeup_en;
|
||||
blink_interval_ms = BLINK_SUSPENDED;
|
||||
}
|
||||
|
||||
// Invoked when usb bus is resumed
|
||||
void tud_resume_cb(void)
|
||||
{
|
||||
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// AUDIO Task
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
void audio_task(void)
|
||||
{
|
||||
// Yet to be filled - e.g. put meas data into TX FIFOs etc.
|
||||
// asm("nop");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Application Callback API Implementations
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// Invoked when set interface is called, typically on start/stop streaming or format change
|
||||
bool tud_audio_set_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request)
|
||||
{
|
||||
(void)rhport;
|
||||
//uint8_t const itf = tu_u16_low(tu_le16toh(p_request->wIndex));
|
||||
uint8_t const alt = tu_u16_low(tu_le16toh(p_request->wValue));
|
||||
|
||||
// Clear buffer when streaming format is changed
|
||||
if(alt != 0)
|
||||
{
|
||||
bytesPerSample = bytesPerSampleAltList[alt-1];
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Invoked when audio class specific set request received for an EP
|
||||
bool tud_audio_set_req_ep_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff)
|
||||
{
|
||||
(void) rhport;
|
||||
(void) pBuff;
|
||||
|
||||
// We do not support any set range requests here, only current value requests
|
||||
TU_VERIFY(p_request->bRequest == AUDIO_CS_REQ_CUR);
|
||||
|
||||
// Page 91 in UAC2 specification
|
||||
uint8_t channelNum = TU_U16_LOW(p_request->wValue);
|
||||
uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
|
||||
uint8_t ep = TU_U16_LOW(p_request->wIndex);
|
||||
|
||||
(void) channelNum; (void) ctrlSel; (void) ep;
|
||||
|
||||
return false; // Yet not implemented
|
||||
}
|
||||
|
||||
// Invoked when audio class specific set request received for an interface
|
||||
bool tud_audio_set_req_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff)
|
||||
{
|
||||
(void) rhport;
|
||||
(void) pBuff;
|
||||
|
||||
// We do not support any set range requests here, only current value requests
|
||||
TU_VERIFY(p_request->bRequest == AUDIO_CS_REQ_CUR);
|
||||
|
||||
// Page 91 in UAC2 specification
|
||||
uint8_t channelNum = TU_U16_LOW(p_request->wValue);
|
||||
uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
|
||||
uint8_t itf = TU_U16_LOW(p_request->wIndex);
|
||||
|
||||
(void) channelNum; (void) ctrlSel; (void) itf;
|
||||
|
||||
return false; // Yet not implemented
|
||||
}
|
||||
|
||||
// Invoked when audio class specific set request received for an entity
|
||||
bool tud_audio_set_req_entity_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff)
|
||||
{
|
||||
(void) rhport;
|
||||
|
||||
// Page 91 in UAC2 specification
|
||||
uint8_t channelNum = TU_U16_LOW(p_request->wValue);
|
||||
uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
|
||||
uint8_t itf = TU_U16_LOW(p_request->wIndex);
|
||||
uint8_t entityID = TU_U16_HIGH(p_request->wIndex);
|
||||
|
||||
(void) itf;
|
||||
|
||||
// We do not support any set range requests here, only current value requests
|
||||
TU_VERIFY(p_request->bRequest == AUDIO_CS_REQ_CUR);
|
||||
|
||||
// If request is for our feature unit
|
||||
if ( entityID == UAC2_ENTITY_FEATURE_UNIT )
|
||||
{
|
||||
switch ( ctrlSel )
|
||||
{
|
||||
case AUDIO_FU_CTRL_MUTE:
|
||||
// Request uses format layout 1
|
||||
TU_VERIFY(p_request->wLength == sizeof(audio_control_cur_1_t));
|
||||
|
||||
mute[channelNum] = ((audio_control_cur_1_t*) pBuff)->bCur;
|
||||
|
||||
TU_LOG2(" Set Mute: %d of channel: %u\r\n", mute[channelNum], channelNum);
|
||||
return true;
|
||||
|
||||
case AUDIO_FU_CTRL_VOLUME:
|
||||
// Request uses format layout 2
|
||||
TU_VERIFY(p_request->wLength == sizeof(audio_control_cur_2_t));
|
||||
|
||||
volume[channelNum] = (uint16_t) ((audio_control_cur_2_t*) pBuff)->bCur;
|
||||
|
||||
TU_LOG2(" Set Volume: %d dB of channel: %u\r\n", volume[channelNum], channelNum);
|
||||
return true;
|
||||
|
||||
// Unknown/Unsupported control
|
||||
default:
|
||||
TU_BREAKPOINT();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Clock Source unit
|
||||
if ( entityID == UAC2_ENTITY_CLOCK )
|
||||
{
|
||||
switch ( ctrlSel )
|
||||
{
|
||||
case AUDIO_CS_CTRL_SAM_FREQ:
|
||||
TU_VERIFY(p_request->wLength == sizeof(audio_control_cur_4_t));
|
||||
|
||||
sampFreq = (uint32_t)((audio_control_cur_4_t *)pBuff)->bCur;
|
||||
|
||||
TU_LOG2("Clock set current freq: %lu\r\n", sampFreq);
|
||||
|
||||
return true;
|
||||
break;
|
||||
|
||||
// Unknown/Unsupported control
|
||||
default:
|
||||
TU_BREAKPOINT();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false; // Yet not implemented
|
||||
}
|
||||
|
||||
// Invoked when audio class specific get request received for an EP
|
||||
bool tud_audio_get_req_ep_cb(uint8_t rhport, tusb_control_request_t const * p_request)
|
||||
{
|
||||
(void) rhport;
|
||||
|
||||
// Page 91 in UAC2 specification
|
||||
uint8_t channelNum = TU_U16_LOW(p_request->wValue);
|
||||
uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
|
||||
uint8_t ep = TU_U16_LOW(p_request->wIndex);
|
||||
|
||||
(void) channelNum; (void) ctrlSel; (void) ep;
|
||||
|
||||
// return tud_control_xfer(rhport, p_request, &tmp, 1);
|
||||
|
||||
return false; // Yet not implemented
|
||||
}
|
||||
|
||||
// Invoked when audio class specific get request received for an interface
|
||||
bool tud_audio_get_req_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request)
|
||||
{
|
||||
(void) rhport;
|
||||
|
||||
// Page 91 in UAC2 specification
|
||||
uint8_t channelNum = TU_U16_LOW(p_request->wValue);
|
||||
uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
|
||||
uint8_t itf = TU_U16_LOW(p_request->wIndex);
|
||||
|
||||
(void) channelNum; (void) ctrlSel; (void) itf;
|
||||
|
||||
return false; // Yet not implemented
|
||||
}
|
||||
|
||||
// Invoked when audio class specific get request received for an entity
|
||||
bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const * p_request)
|
||||
{
|
||||
(void) rhport;
|
||||
|
||||
// Page 91 in UAC2 specification
|
||||
uint8_t channelNum = TU_U16_LOW(p_request->wValue);
|
||||
uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
|
||||
// uint8_t itf = TU_U16_LOW(p_request->wIndex); // Since we have only one audio function implemented, we do not need the itf value
|
||||
uint8_t entityID = TU_U16_HIGH(p_request->wIndex);
|
||||
|
||||
// Input terminal (Microphone input)
|
||||
if (entityID == UAC2_ENTITY_INPUT_TERMINAL)
|
||||
{
|
||||
switch ( ctrlSel )
|
||||
{
|
||||
case AUDIO_TE_CTRL_CONNECTOR:
|
||||
{
|
||||
// The terminal connector control only has a get request with only the CUR attribute.
|
||||
audio_desc_channel_cluster_t ret;
|
||||
|
||||
// Those are dummy values for now
|
||||
ret.bNrChannels = 1;
|
||||
ret.bmChannelConfig = 0;
|
||||
ret.iChannelNames = 0;
|
||||
|
||||
TU_LOG2(" Get terminal connector\r\n");
|
||||
|
||||
return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, (void*) &ret, sizeof(ret));
|
||||
}
|
||||
break;
|
||||
|
||||
// Unknown/Unsupported control selector
|
||||
default:
|
||||
TU_BREAKPOINT();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Feature unit
|
||||
if (entityID == UAC2_ENTITY_FEATURE_UNIT)
|
||||
{
|
||||
switch ( ctrlSel )
|
||||
{
|
||||
case AUDIO_FU_CTRL_MUTE:
|
||||
// Audio control mute cur parameter block consists of only one byte - we thus can send it right away
|
||||
// There does not exist a range parameter block for mute
|
||||
TU_LOG2(" Get Mute of channel: %u\r\n", channelNum);
|
||||
return tud_control_xfer(rhport, p_request, &mute[channelNum], 1);
|
||||
|
||||
case AUDIO_FU_CTRL_VOLUME:
|
||||
switch ( p_request->bRequest )
|
||||
{
|
||||
case AUDIO_CS_REQ_CUR:
|
||||
TU_LOG2(" Get Volume of channel: %u\r\n", channelNum);
|
||||
return tud_control_xfer(rhport, p_request, &volume[channelNum], sizeof(volume[channelNum]));
|
||||
|
||||
case AUDIO_CS_REQ_RANGE:
|
||||
TU_LOG2(" Get Volume range of channel: %u\r\n", channelNum);
|
||||
|
||||
// Copy values - only for testing - better is version below
|
||||
audio_control_range_2_n_t(1)
|
||||
ret;
|
||||
|
||||
ret.wNumSubRanges = 1;
|
||||
ret.subrange[0].bMin = -90; // -90 dB
|
||||
ret.subrange[0].bMax = 30; // +30 dB
|
||||
ret.subrange[0].bRes = 1; // 1 dB steps
|
||||
|
||||
return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, (void*) &ret, sizeof(ret));
|
||||
|
||||
// Unknown/Unsupported control
|
||||
default:
|
||||
TU_BREAKPOINT();
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
// Unknown/Unsupported control
|
||||
default:
|
||||
TU_BREAKPOINT();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Clock Source unit
|
||||
if ( entityID == UAC2_ENTITY_CLOCK )
|
||||
{
|
||||
switch ( ctrlSel )
|
||||
{
|
||||
case AUDIO_CS_CTRL_SAM_FREQ:
|
||||
// channelNum is always zero in this case
|
||||
switch ( p_request->bRequest )
|
||||
{
|
||||
case AUDIO_CS_REQ_CUR:
|
||||
TU_LOG2(" Get Sample Freq.\r\n");
|
||||
return tud_control_xfer(rhport, p_request, &sampFreq, sizeof(sampFreq));
|
||||
|
||||
case AUDIO_CS_REQ_RANGE:
|
||||
{
|
||||
TU_LOG2(" Get Sample Freq. range\r\n");
|
||||
audio_control_range_4_n_t(N_sampleRates) rangef =
|
||||
{
|
||||
.wNumSubRanges = tu_htole16(N_sampleRates)
|
||||
};
|
||||
TU_LOG1("Clock get %d freq ranges\r\n", N_sampleRates);
|
||||
for(uint8_t i = 0; i < N_sampleRates; i++)
|
||||
{
|
||||
rangef.subrange[i].bMin = (int32_t)sampleRatesList[i];
|
||||
rangef.subrange[i].bMax = (int32_t)sampleRatesList[i];
|
||||
rangef.subrange[i].bRes = 0;
|
||||
TU_LOG1("Range %d (%d, %d, %d)\r\n", i, (int)rangef.subrange[i].bMin, (int)rangef.subrange[i].bMax, (int)rangef.subrange[i].bRes);
|
||||
}
|
||||
return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, &rangef, sizeof(rangef));
|
||||
}
|
||||
// Unknown/Unsupported control
|
||||
default:
|
||||
TU_BREAKPOINT();
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case AUDIO_CS_CTRL_CLK_VALID:
|
||||
// Only cur attribute exists for this request
|
||||
TU_LOG2(" Get Sample Freq. valid\r\n");
|
||||
return tud_control_xfer(rhport, p_request, &clkValid, sizeof(clkValid));
|
||||
|
||||
// Unknown/Unsupported control
|
||||
default:
|
||||
TU_BREAKPOINT();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
TU_LOG2(" Unsupported entity: %d\r\n", entityID);
|
||||
return false; // Yet not implemented
|
||||
}
|
||||
|
||||
bool tud_audio_tx_done_pre_load_cb(uint8_t rhport, uint8_t itf, uint8_t ep_in, uint8_t cur_alt_setting)
|
||||
{
|
||||
(void) rhport;
|
||||
(void) itf;
|
||||
(void) ep_in;
|
||||
(void) cur_alt_setting;
|
||||
|
||||
tud_audio_write((uint8_t *)test_buffer_audio, (uint16_t)(sampFreq / (TUD_OPT_HIGH_SPEED ? 8000 : 1000) * bytesPerSample));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool tud_audio_tx_done_post_load_cb(uint8_t rhport, uint16_t n_bytes_copied, uint8_t itf, uint8_t ep_in, uint8_t cur_alt_setting)
|
||||
{
|
||||
(void) rhport;
|
||||
(void) n_bytes_copied;
|
||||
(void) itf;
|
||||
(void) ep_in;
|
||||
(void) cur_alt_setting;
|
||||
|
||||
// 16bit
|
||||
if(bytesPerSample == 2)
|
||||
{
|
||||
uint16_t* pData_16 = (uint16_t*)((void*)test_buffer_audio);
|
||||
for (size_t cnt = 0; cnt < sampFreq / (TUD_OPT_HIGH_SPEED ? 8000 : 1000); cnt++)
|
||||
{
|
||||
pData_16[cnt] = startVal++;
|
||||
}
|
||||
}
|
||||
// 24bit in 32bit slot
|
||||
else if(bytesPerSample == 4)
|
||||
{
|
||||
uint32_t* pData_32 = (uint32_t*)((void*)test_buffer_audio);
|
||||
for (size_t cnt = 0; cnt < sampFreq / (TUD_OPT_HIGH_SPEED ? 8000 : 1000); cnt++)
|
||||
{
|
||||
pData_32[cnt] = (uint32_t)startVal++ << 16U;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool tud_audio_set_itf_close_EP_cb(uint8_t rhport, tusb_control_request_t const * p_request)
|
||||
{
|
||||
(void) rhport;
|
||||
(void) p_request;
|
||||
startVal = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// BLINKING TASK
|
||||
//--------------------------------------------------------------------+
|
||||
void led_blinking_task(void)
|
||||
{
|
||||
static uint32_t start_ms = 0;
|
||||
static bool led_state = false;
|
||||
|
||||
// Blink every interval ms
|
||||
if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
|
||||
start_ms += blink_interval_ms;
|
||||
|
||||
board_led_write(led_state);
|
||||
led_state = 1 - led_state; // toggle
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
import sounddevice as sd
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import platform
|
||||
import csv
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
# If you got "ValueError: No input device matching", that is because your PC name example device
|
||||
# differently from tested list below. Uncomment the next line to see full list and try to pick correct one
|
||||
# print(sd.query_devices())
|
||||
|
||||
fs = 96000 # Sample rate
|
||||
duration = 100e-3 # Duration of recording
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
# MME is needed since there are more than one MicNode device APIs (at least in Windows)
|
||||
device = 'Microphone (MicNode) MME'
|
||||
elif platform.system() == 'Darwin':
|
||||
device = 'MicNode'
|
||||
else:
|
||||
device ='default'
|
||||
|
||||
myrecording = sd.rec(int(duration * fs), samplerate=fs, channels=1, dtype='int16', device=device)
|
||||
print('Waiting...')
|
||||
sd.wait() # Wait until recording is finished
|
||||
print('Done!')
|
||||
|
||||
time = np.arange(0, duration, 1 / fs) # time vector
|
||||
plt.plot(time, myrecording)
|
||||
plt.xlabel('Time [s]')
|
||||
plt.ylabel('Amplitude')
|
||||
plt.title('MicNode')
|
||||
plt.show()
|
||||
|
||||
samples = np.array(myrecording)
|
||||
np.savetxt('Output.csv', samples, delimiter=",", fmt='%s')
|
|
@ -1,141 +0,0 @@
|
|||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2019 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _TUSB_CONFIG_H_
|
||||
#define _TUSB_CONFIG_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "usb_descriptors.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Board Specific Configuration
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// RHPort number used for device can be defined by board.mk, default to port 0
|
||||
#ifndef BOARD_TUD_RHPORT
|
||||
#define BOARD_TUD_RHPORT 0
|
||||
#endif
|
||||
|
||||
// RHPort max operational speed can defined by board.mk
|
||||
#ifndef BOARD_TUD_MAX_SPEED
|
||||
#define BOARD_TUD_MAX_SPEED OPT_MODE_DEFAULT_SPEED
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// COMMON CONFIGURATION
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
// defined by compiler flags for flexibility
|
||||
#ifndef CFG_TUSB_MCU
|
||||
#error CFG_TUSB_MCU must be defined
|
||||
#endif
|
||||
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
||||
#ifndef CFG_TUSB_DEBUG
|
||||
#define CFG_TUSB_DEBUG 0
|
||||
#endif
|
||||
|
||||
// Enable Device stack
|
||||
#define CFG_TUD_ENABLED 1
|
||||
|
||||
// Default is max speed that hardware controller could support with on-chip PHY
|
||||
#define CFG_TUD_MAX_SPEED BOARD_TUD_MAX_SPEED
|
||||
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
||||
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
|
||||
* Tinyusb use follows macros to declare transferring memory so that they can be put
|
||||
* into those specific section.
|
||||
* e.g
|
||||
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
|
||||
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
|
||||
*/
|
||||
#ifndef CFG_TUSB_MEM_SECTION
|
||||
#define CFG_TUSB_MEM_SECTION
|
||||
#endif
|
||||
|
||||
#ifndef CFG_TUSB_MEM_ALIGN
|
||||
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// DEVICE CONFIGURATION
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#ifndef CFG_TUD_ENDPOINT0_SIZE
|
||||
#define CFG_TUD_ENDPOINT0_SIZE 64
|
||||
#endif
|
||||
|
||||
//------------- CLASS -------------//
|
||||
#define CFG_TUD_AUDIO 1
|
||||
#define CFG_TUD_CDC 0
|
||||
#define CFG_TUD_MSC 0
|
||||
#define CFG_TUD_HID 0
|
||||
#define CFG_TUD_MIDI 0
|
||||
#define CFG_TUD_VENDOR 0
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// AUDIO CLASS DRIVER CONFIGURATION
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 96000
|
||||
|
||||
// How many formats are used, need to adjust USB descriptor if changed
|
||||
#define CFG_TUD_AUDIO_FUNC_1_N_FORMATS 2
|
||||
|
||||
// 16bit in 16bit slots
|
||||
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX 2
|
||||
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_RX 16
|
||||
|
||||
// 24bit in 32bit slots
|
||||
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX 4
|
||||
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_RX 24
|
||||
|
||||
// Have a look into audio_device.h for all configurations
|
||||
|
||||
#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_MIC_ONE_CH_2_FORMAT_DESC_LEN
|
||||
#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 1 // Number of Standard AS Interface Descriptors (4.9.1) defined per audio function - this is required to be able to remember the current alternate settings of these interfaces - We restrict us here to have a constant number for all audio functions (which means this has to be the maximum number of AS interfaces an audio function has and a second audio function with less AS interfaces just wastes a few bytes)
|
||||
#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64 // Size of control request buffer
|
||||
|
||||
#define CFG_TUD_AUDIO_ENABLE_EP_IN 1
|
||||
#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 1 // Driver gets this info from the descriptors - we define it here to use it to setup the descriptors and to do calculations with it below - be aware: for different number of channels you need another descriptor!
|
||||
|
||||
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_IN TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX)
|
||||
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_EP_SZ_IN TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX)
|
||||
|
||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX TU_MAX(CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_IN, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_EP_SZ_IN) // Maximum EP IN size for all AS alternate settings used
|
||||
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _TUSB_CONFIG_H_ */
|
|
@ -1,185 +0,0 @@
|
|||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2019 Ha Thach (tinyusb.org)
|
||||
* Copyright (c) 2022 HiFiPhile
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
#include "usb_descriptors.h"
|
||||
|
||||
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
|
||||
* Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
|
||||
*
|
||||
* Auto ProductID layout's Bitmap:
|
||||
* [MSB] AUDIO | MIDI | HID | MSC | CDC [LSB]
|
||||
*/
|
||||
#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
|
||||
#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
|
||||
_PID_MAP(MIDI, 3) | _PID_MAP(AUDIO, 4) | _PID_MAP(VENDOR, 5) )
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Device Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
tusb_desc_device_t const desc_device =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_device_t),
|
||||
.bDescriptorType = TUSB_DESC_DEVICE,
|
||||
.bcdUSB = 0x0200,
|
||||
|
||||
// Use Interface Association Descriptor (IAD) for Audio
|
||||
// As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
|
||||
.bDeviceClass = TUSB_CLASS_MISC,
|
||||
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
|
||||
.bDeviceProtocol = MISC_PROTOCOL_IAD,
|
||||
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
|
||||
|
||||
.idVendor = 0xCafe,
|
||||
.idProduct = USB_PID,
|
||||
.bcdDevice = 0x0100,
|
||||
|
||||
.iManufacturer = 0x01,
|
||||
.iProduct = 0x02,
|
||||
.iSerialNumber = 0x03,
|
||||
|
||||
.bNumConfigurations = 0x01
|
||||
};
|
||||
|
||||
// Invoked when received GET DEVICE DESCRIPTOR
|
||||
// Application return pointer to descriptor
|
||||
uint8_t const * tud_descriptor_device_cb(void)
|
||||
{
|
||||
return (uint8_t const *) &desc_device;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Configuration Descriptor
|
||||
//--------------------------------------------------------------------+
|
||||
enum
|
||||
{
|
||||
ITF_NUM_AUDIO_CONTROL = 0,
|
||||
ITF_NUM_AUDIO_STREAMING,
|
||||
ITF_NUM_TOTAL
|
||||
};
|
||||
|
||||
#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + CFG_TUD_AUDIO * TUD_AUDIO_MIC_ONE_CH_2_FORMAT_DESC_LEN)
|
||||
|
||||
#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
|
||||
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
|
||||
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
|
||||
#define EPNUM_AUDIO 0x03
|
||||
|
||||
#elif TU_CHECK_MCU(OPT_MCU_NRF5X)
|
||||
// nRF5x ISO can only be endpoint 8
|
||||
#define EPNUM_AUDIO 0x08
|
||||
|
||||
#else
|
||||
#define EPNUM_AUDIO 0x01
|
||||
#endif
|
||||
|
||||
uint8_t const desc_configuration[] =
|
||||
{
|
||||
// Config number, interface count, string index, total length, attribute, power in mA
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
|
||||
|
||||
// Interface number, string index, EP Out & EP In address, EP size
|
||||
TUD_AUDIO_MIC_ONE_CH_2_FORMAT_DESCRIPTOR(/*_itfnum*/ ITF_NUM_AUDIO_CONTROL, /*_stridx*/ 0, /*_epin*/ 0x80 | EPNUM_AUDIO)
|
||||
};
|
||||
|
||||
TU_VERIFY_STATIC(sizeof(desc_configuration) == CONFIG_TOTAL_LEN, "Incorrect size");
|
||||
|
||||
// Invoked when received GET CONFIGURATION DESCRIPTOR
|
||||
// Application return pointer to descriptor
|
||||
// Descriptor contents must exist long enough for transfer to complete
|
||||
uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
||||
{
|
||||
(void) index; // for multiple configurations
|
||||
return desc_configuration;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// String Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// String Descriptor Index
|
||||
enum {
|
||||
STRID_LANGID = 0,
|
||||
STRID_MANUFACTURER,
|
||||
STRID_PRODUCT,
|
||||
STRID_SERIAL,
|
||||
};
|
||||
|
||||
// array of pointer to string descriptors
|
||||
char const* string_desc_arr [] =
|
||||
{
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"PaniRCorp", // 1: Manufacturer
|
||||
"MicNode", // 2: Product
|
||||
NULL, // 3: Serials will use unique ID if possible
|
||||
"UAC2", // 4: Audio Interface
|
||||
|
||||
};
|
||||
|
||||
static uint16_t _desc_str[32 + 1];
|
||||
|
||||
// Invoked when received GET STRING DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
(void) langid;
|
||||
size_t chr_count;
|
||||
|
||||
switch ( index ) {
|
||||
case STRID_LANGID:
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
break;
|
||||
|
||||
case STRID_SERIAL:
|
||||
chr_count = board_usb_get_serial(_desc_str + 1, 32);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
|
||||
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
|
||||
|
||||
const char *str = string_desc_arr[index];
|
||||
|
||||
// Cap at max char
|
||||
chr_count = strlen(str);
|
||||
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
|
||||
if ( chr_count > max_count ) chr_count = max_count;
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for ( size_t i = 0; i < chr_count; i++ ) {
|
||||
_desc_str[1 + i] = str[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// first byte is length (including header), second byte is string type
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8) | (2 * chr_count + 2));
|
||||
|
||||
return _desc_str;
|
||||
}
|
|
@ -1,102 +0,0 @@
|
|||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2022 HiFiPhile
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _USB_DESCRIPTORS_H_
|
||||
#define _USB_DESCRIPTORS_H_
|
||||
|
||||
// #include "tusb.h"
|
||||
|
||||
// Unit numbers are arbitrary selected
|
||||
#define UAC2_ENTITY_CLOCK 0x04
|
||||
#define UAC2_ENTITY_INPUT_TERMINAL 0x01
|
||||
#define UAC2_ENTITY_OUTPUT_TERMINAL 0x03
|
||||
#define UAC2_ENTITY_FEATURE_UNIT 0x02
|
||||
|
||||
|
||||
#define TUD_AUDIO_MIC_ONE_CH_2_FORMAT_DESC_LEN (TUD_AUDIO_DESC_IAD_LEN\
|
||||
+ TUD_AUDIO_DESC_STD_AC_LEN\
|
||||
+ TUD_AUDIO_DESC_CS_AC_LEN\
|
||||
+ TUD_AUDIO_DESC_CLK_SRC_LEN\
|
||||
+ TUD_AUDIO_DESC_INPUT_TERM_LEN\
|
||||
+ TUD_AUDIO_DESC_OUTPUT_TERM_LEN\
|
||||
+ TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL_LEN\
|
||||
/* Interface 1, Alternate 0 */\
|
||||
+ TUD_AUDIO_DESC_STD_AS_INT_LEN\
|
||||
/* Interface 1, Alternate 1 */\
|
||||
+ TUD_AUDIO_DESC_STD_AS_INT_LEN\
|
||||
+ TUD_AUDIO_DESC_CS_AS_INT_LEN\
|
||||
+ TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN\
|
||||
+ TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN\
|
||||
+ TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN\
|
||||
/* Interface 1, Alternate 2 */\
|
||||
+ TUD_AUDIO_DESC_STD_AS_INT_LEN\
|
||||
+ TUD_AUDIO_DESC_CS_AS_INT_LEN\
|
||||
+ TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN\
|
||||
+ TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN\
|
||||
+ TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN)
|
||||
|
||||
|
||||
#define TUD_AUDIO_MIC_ONE_CH_2_FORMAT_DESCRIPTOR(_itfnum, _stridx, _epin) \
|
||||
/* Standard Interface Association Descriptor (IAD) */\
|
||||
TUD_AUDIO_DESC_IAD(/*_firstitf*/ _itfnum, /*_nitfs*/ 0x02, /*_stridx*/ 0x00),\
|
||||
/* Standard AC Interface Descriptor(4.7.1) */\
|
||||
TUD_AUDIO_DESC_STD_AC(/*_itfnum*/ _itfnum, /*_nEPs*/ 0x00, /*_stridx*/ _stridx),\
|
||||
/* Class-Specific AC Interface Header Descriptor(4.7.2) */\
|
||||
TUD_AUDIO_DESC_CS_AC(/*_bcdADC*/ 0x0200, /*_category*/ AUDIO_FUNC_MICROPHONE, /*_totallen*/ TUD_AUDIO_DESC_CLK_SRC_LEN+TUD_AUDIO_DESC_INPUT_TERM_LEN+TUD_AUDIO_DESC_OUTPUT_TERM_LEN+TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL_LEN, /*_ctrl*/ AUDIO_CS_AS_INTERFACE_CTRL_LATENCY_POS),\
|
||||
/* Clock Source Descriptor(4.7.2.1) */\
|
||||
TUD_AUDIO_DESC_CLK_SRC(/*_clkid*/ UAC2_ENTITY_CLOCK, /*_attr*/ AUDIO_CLOCK_SOURCE_ATT_INT_PRO_CLK, /*_ctrl*/ AUDIO_CTRL_RW << AUDIO_CLOCK_SOURCE_CTRL_CLK_FRQ_POS | AUDIO_CTRL_R << AUDIO_CLOCK_SOURCE_CTRL_CLK_VAL_POS, /*_assocTerm*/ 0x01, /*_stridx*/ 0x00),\
|
||||
/* Input Terminal Descriptor(4.7.2.4) */\
|
||||
TUD_AUDIO_DESC_INPUT_TERM(/*_termid*/ UAC2_ENTITY_INPUT_TERMINAL, /*_termtype*/ AUDIO_TERM_TYPE_IN_GENERIC_MIC, /*_assocTerm*/ UAC2_ENTITY_OUTPUT_TERMINAL, /*_clkid*/ UAC2_ENTITY_CLOCK, /*_nchannelslogical*/ 0x01, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_idxchannelnames*/ 0x00, /*_ctrl*/ AUDIO_CTRL_R << AUDIO_IN_TERM_CTRL_CONNECTOR_POS, /*_stridx*/ 0x00),\
|
||||
/* Output Terminal Descriptor(4.7.2.5) */\
|
||||
TUD_AUDIO_DESC_OUTPUT_TERM(/*_termid*/ UAC2_ENTITY_OUTPUT_TERMINAL, /*_termtype*/ AUDIO_TERM_TYPE_USB_STREAMING, /*_assocTerm*/ UAC2_ENTITY_INPUT_TERMINAL, /*_srcid*/ UAC2_ENTITY_FEATURE_UNIT, /*_clkid*/ UAC2_ENTITY_CLOCK, /*_ctrl*/ 0x0000, /*_stridx*/ 0x00),\
|
||||
/* Feature Unit Descriptor(4.7.2.8) */\
|
||||
TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL(/*_unitid*/ UAC2_ENTITY_FEATURE_UNIT, /*_srcid*/ 0x01, /*_ctrlch0master*/ AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS, /*_ctrlch1*/ AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS, /*_stridx*/ 0x00),\
|
||||
/* Standard AS Interface Descriptor(4.9.1) */\
|
||||
/* Interface 1, Alternate 0 - default alternate setting with 0 bandwidth */\
|
||||
TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)((_itfnum)+1), /*_altset*/ 0x00, /*_nEPs*/ 0x00, /*_stridx*/ 0x00),\
|
||||
/* Standard AS Interface Descriptor(4.9.1) */\
|
||||
/* Interface 1, Alternate 1 - alternate interface for data streaming */\
|
||||
TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)((_itfnum)+1), /*_altset*/ 0x01, /*_nEPs*/ 0x01, /*_stridx*/ 0x00),\
|
||||
/* Class-Specific AS Interface Descriptor(4.9.2) */\
|
||||
TUD_AUDIO_DESC_CS_AS_INT(/*_termid*/ UAC2_ENTITY_OUTPUT_TERMINAL, /*_ctrl*/ AUDIO_CTRL_NONE, /*_formattype*/ AUDIO_FORMAT_TYPE_I, /*_formats*/ AUDIO_DATA_FORMAT_TYPE_I_PCM, /*_nchannelsphysical*/ 0x01, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_stridx*/ 0x00),\
|
||||
/* Type I Format Type Descriptor(2.3.1.6 - Audio Formats) */\
|
||||
TUD_AUDIO_DESC_TYPE_I_FORMAT(CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_RX),\
|
||||
/* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
|
||||
TUD_AUDIO_DESC_STD_AS_ISO_EP(/*_ep*/ _epin, /*_attr*/ (TUSB_XFER_ISOCHRONOUS | TUSB_ISO_EP_ATT_ASYNCHRONOUS | TUSB_ISO_EP_ATT_DATA), /*_maxEPsize*/ CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_IN, /*_interval*/ 0x01),\
|
||||
/* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
|
||||
TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_UNDEFINED, /*_lockdelay*/ 0x0000),\
|
||||
/* Interface 1, Alternate 2 - alternate interface for data streaming */\
|
||||
TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)((_itfnum)+1), /*_altset*/ 0x02, /*_nEPs*/ 0x01, /*_stridx*/ 0x00),\
|
||||
/* Class-Specific AS Interface Descriptor(4.9.2) */\
|
||||
TUD_AUDIO_DESC_CS_AS_INT(/*_termid*/ UAC2_ENTITY_OUTPUT_TERMINAL, /*_ctrl*/ AUDIO_CTRL_NONE, /*_formattype*/ AUDIO_FORMAT_TYPE_I, /*_formats*/ AUDIO_DATA_FORMAT_TYPE_I_PCM, /*_nchannelsphysical*/ 0x01, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_stridx*/ 0x00),\
|
||||
/* Type I Format Type Descriptor(2.3.1.6 - Audio Formats) */\
|
||||
TUD_AUDIO_DESC_TYPE_I_FORMAT(CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_RX),\
|
||||
/* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
|
||||
TUD_AUDIO_DESC_STD_AS_ISO_EP(/*_ep*/ _epin, /*_attr*/ (TUSB_XFER_ISOCHRONOUS | TUSB_ISO_EP_ATT_ASYNCHRONOUS | TUSB_ISO_EP_ATT_DATA), /*_maxEPsize*/ CFG_TUD_AUDIO_FUNC_1_FORMAT_2_EP_SZ_IN, /*_interval*/ 0x01),\
|
||||
/* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
|
||||
TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_UNDEFINED, /*_lockdelay*/ 0x0000)
|
||||
|
||||
|
||||
#endif
|
|
@ -1,32 +1,42 @@
|
|||
cmake_minimum_required(VERSION 3.17)
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||
# Check for -DFAMILY=
|
||||
if(FAMILY MATCHES "^esp32s[2-3]")
|
||||
# use BOARD-Directory name for project id
|
||||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
set(PROJECT ${BOARD}-${PROJECT})
|
||||
|
||||
project(${PROJECT} C CXX ASM)
|
||||
# TOP is absolute path to root directory of TinyUSB git repo
|
||||
set(TOP "../../..")
|
||||
get_filename_component(TOP "${TOP}" REALPATH)
|
||||
|
||||
# Checks this example is valid for the family and initializes the project
|
||||
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||
project(${PROJECT})
|
||||
|
||||
# Espressif has its own cmake build system
|
||||
if(FAMILY STREQUAL "espressif")
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
|
||||
add_executable(${PROJECT})
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
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})
|
||||
|
||||
# Example source
|
||||
target_sources(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
||||
)
|
||||
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
# Example include
|
||||
target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Configure compilation flags and libraries for the example without RTOS.
|
||||
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
||||
family_configure_device_example(${PROJECT} noos)
|
||||
# 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,3 +1,4 @@
|
|||
include ../../../tools/top.mk
|
||||
include ../../make.mk
|
||||
|
||||
INC += \
|
||||
|
@ -8,4 +9,10 @@ INC += \
|
|||
EXAMPLE_SOURCE += $(wildcard src/*.c)
|
||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||
|
||||
# board_test example is special example that doesn't enable device or host stack
|
||||
# This can cause some TinyUSB API missing, this hack to allow us to fill those API
|
||||
# to pass the compilation process
|
||||
CFLAGS += \
|
||||
-D"tud_int_handler(x)= " \
|
||||
|
||||
include ../../rules.mk
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
# FAMILY = esp32sx
|
||||
idf_component_register(SRCS "main.c"
|
||||
INCLUDE_DIRS "."
|
||||
REQUIRES boards tinyusb_src)
|
||||
REQUIRES freertos soc)
|
||||
|
||||
file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake)
|
||||
|
||||
if(EXISTS ${board_cmake})
|
||||
include(${board_cmake})
|
||||
endif()
|
||||
|
||||
idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
|
||||
target_include_directories(${COMPONENT_TARGET} PUBLIC
|
||||
"${FREERTOS_ORIG_INCLUDE_PATH}"
|
||||
"${TOP}/hw"
|
||||
"${TOP}/src"
|
||||
)
|
||||
|
|
|
@ -27,10 +27,10 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "bsp/board.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF PROTOTYPES
|
||||
// MACRO CONSTANT TYPEDEF PROTYPES
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
/* Blink pattern
|
||||
|
@ -47,7 +47,6 @@ enum {
|
|||
int main(void)
|
||||
{
|
||||
board_init();
|
||||
board_led_write(true);
|
||||
|
||||
uint32_t start_ms = 0;
|
||||
bool led_state = false;
|
||||
|
@ -56,7 +55,7 @@ int main(void)
|
|||
{
|
||||
uint32_t interval_ms = board_button_read() ? BLINK_PRESSED : BLINK_UNPRESSED;
|
||||
|
||||
// Blink and print every interval ms
|
||||
// Blink every interval ms
|
||||
if ( !(board_millis() - start_ms < interval_ms) )
|
||||
{
|
||||
board_uart_write(HELLO_STR, strlen(HELLO_STR));
|
||||
|
@ -66,14 +65,9 @@ int main(void)
|
|||
board_led_write(led_state);
|
||||
led_state = 1 - led_state; // toggle
|
||||
}
|
||||
}
|
||||
|
||||
// echo
|
||||
uint8_t ch;
|
||||
if ( board_uart_read(&ch, 1) > 0 )
|
||||
{
|
||||
board_uart_write(&ch, 1);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
|
||||
|
|
|
@ -30,11 +30,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
// board_test example is special example that doesn't enable device or host stack
|
||||
// This can cause some TinyUSB API missing, this define hack to allow us to fill those API
|
||||
// to pass the compilation process
|
||||
#define tud_int_handler(x)
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// COMMON CONFIGURATION
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -48,9 +43,7 @@
|
|||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
||||
// This example only test LED & GPIO, disable both device and host stack
|
||||
#define CFG_TUD_ENABLED 0
|
||||
#define CFG_TUH_ENABLED 0
|
||||
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_NONE
|
||||
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
@ -70,6 +63,21 @@
|
|||
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// DEVICE CONFIGURATION
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
#ifndef CFG_TUD_ENDPOINT0_SIZE
|
||||
#define CFG_TUD_ENDPOINT0_SIZE 64
|
||||
#endif
|
||||
|
||||
//------------- CLASS -------------//
|
||||
#define CFG_TUD_CDC 0
|
||||
#define CFG_TUD_MSC 0
|
||||
#define CFG_TUD_HID 0
|
||||
#define CFG_TUD_MIDI 0
|
||||
#define CFG_TUD_VENDOR 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
cmake_minimum_required(VERSION 3.17)
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
project(${PROJECT} C CXX ASM)
|
||||
project(${PROJECT})
|
||||
|
||||
# Checks this example is valid for the family and initializes the project
|
||||
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Espressif has its own cmake build system
|
||||
if(FAMILY STREQUAL "espressif")
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_executable(${PROJECT})
|
||||
|
||||
# Example source
|
||||
|
@ -28,6 +23,6 @@ target_include_directories(${PROJECT} PUBLIC
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Configure compilation flags and libraries for the example without RTOS.
|
||||
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
||||
family_configure_device_example(${PROJECT} noos)
|
||||
# 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,3 +1,4 @@
|
|||
include ../../../tools/top.mk
|
||||
include ../../make.mk
|
||||
|
||||
INC += \
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "bsp/board.h"
|
||||
#include "tusb.h"
|
||||
|
||||
//------------- prototypes -------------//
|
||||
|
@ -39,37 +39,32 @@ int main(void)
|
|||
{
|
||||
board_init();
|
||||
|
||||
// init device stack on configured roothub port
|
||||
tud_init(BOARD_TUD_RHPORT);
|
||||
|
||||
if (board_init_after_tusb) {
|
||||
board_init_after_tusb();
|
||||
}
|
||||
tusb_init();
|
||||
|
||||
while (1)
|
||||
{
|
||||
tud_task(); // tinyusb device task
|
||||
cdc_task();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// echo to either Serial0 or Serial1
|
||||
// with Serial0 as all lower case, Serial1 as all upper case
|
||||
static void echo_serial_port(uint8_t itf, uint8_t buf[], uint32_t count)
|
||||
{
|
||||
uint8_t const case_diff = 'a' - 'A';
|
||||
|
||||
for(uint32_t i=0; i<count; i++)
|
||||
{
|
||||
if (itf == 0)
|
||||
{
|
||||
// echo back 1st port as lower case
|
||||
if (isupper(buf[i])) buf[i] += case_diff;
|
||||
if (isupper(buf[i])) buf[i] += 'a' - 'A';
|
||||
}
|
||||
else
|
||||
{
|
||||
// echo back 2nd port as upper case
|
||||
if (islower(buf[i])) buf[i] -= case_diff;
|
||||
if (islower(buf[i])) buf[i] -= 'a' - 'A';
|
||||
}
|
||||
|
||||
tud_cdc_n_write_char(itf, buf[i]);
|
||||
|
|
|
@ -30,42 +30,46 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Board Specific Configuration
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// RHPort number used for device can be defined by board.mk, default to port 0
|
||||
#ifndef BOARD_TUD_RHPORT
|
||||
#define BOARD_TUD_RHPORT 0
|
||||
#endif
|
||||
|
||||
// RHPort max operational speed can defined by board.mk
|
||||
#ifndef BOARD_TUD_MAX_SPEED
|
||||
#define BOARD_TUD_MAX_SPEED OPT_MODE_DEFAULT_SPEED
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// COMMON CONFIGURATION
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
// defined by board.mk
|
||||
#ifndef CFG_TUSB_MCU
|
||||
#error CFG_TUSB_MCU must be defined
|
||||
#error CFG_TUSB_MCU must be defined
|
||||
#endif
|
||||
|
||||
// RHPort number used for device can be defined by board.mk, default to port 0
|
||||
#ifndef BOARD_DEVICE_RHPORT_NUM
|
||||
#define BOARD_DEVICE_RHPORT_NUM 0
|
||||
#endif
|
||||
|
||||
// RHPort max operational speed can defined by board.mk
|
||||
// Default to Highspeed for MCU with internal HighSpeed PHY (can be port specific), otherwise FullSpeed
|
||||
#ifndef BOARD_DEVICE_RHPORT_SPEED
|
||||
#if (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX || \
|
||||
CFG_TUSB_MCU == OPT_MCU_NUC505 || CFG_TUSB_MCU == OPT_MCU_CXD56 || CFG_TUSB_MCU == OPT_MCU_SAMX7X)
|
||||
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_HIGH_SPEED
|
||||
#else
|
||||
#define BOARD_DEVICE_RHPORT_SPEED OPT_MODE_FULL_SPEED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Device mode with rhport and speed defined by board.mk
|
||||
#if BOARD_DEVICE_RHPORT_NUM == 0
|
||||
#define CFG_TUSB_RHPORT0_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
|
||||
#elif BOARD_DEVICE_RHPORT_NUM == 1
|
||||
#define CFG_TUSB_RHPORT1_MODE (OPT_MODE_DEVICE | BOARD_DEVICE_RHPORT_SPEED)
|
||||
#else
|
||||
#error "Incorrect RHPort configuration"
|
||||
#endif
|
||||
|
||||
#ifndef CFG_TUSB_OS
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
#endif
|
||||
|
||||
#ifndef CFG_TUSB_DEBUG
|
||||
#define CFG_TUSB_DEBUG 0
|
||||
#endif
|
||||
|
||||
// Enable Device stack
|
||||
#define CFG_TUD_ENABLED 1
|
||||
|
||||
// Default is max speed that hardware controller could support with on-chip PHY
|
||||
#define CFG_TUD_MAX_SPEED BOARD_TUD_MAX_SPEED
|
||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||
// #define CFG_TUSB_DEBUG 0
|
||||
|
||||
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
|
||||
* Tinyusb use follows macros to declare transferring memory so that they can be put
|
||||
|
|
|
@ -23,22 +23,18 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
|
||||
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
|
||||
* Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
|
||||
*
|
||||
* Auto ProductID layout's Bitmap:
|
||||
* [MSB] HID | MSC | CDC [LSB]
|
||||
* [MSB] MIDI | HID | MSC | CDC [LSB]
|
||||
*/
|
||||
#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
|
||||
#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
|
||||
_PID_MAP(MIDI, 3) | _PID_MAP(VENDOR, 4) )
|
||||
|
||||
#define USB_VID 0xCafe
|
||||
#define USB_BCD 0x0200
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Device Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -46,7 +42,7 @@ tusb_desc_device_t const desc_device =
|
|||
{
|
||||
.bLength = sizeof(tusb_desc_device_t),
|
||||
.bDescriptorType = TUSB_DESC_DEVICE,
|
||||
.bcdUSB = USB_BCD,
|
||||
.bcdUSB = 0x0200,
|
||||
|
||||
// Use Interface Association Descriptor (IAD) for CDC
|
||||
// As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
|
||||
|
@ -55,7 +51,7 @@ tusb_desc_device_t const desc_device =
|
|||
.bDeviceProtocol = MISC_PROTOCOL_IAD,
|
||||
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
|
||||
|
||||
.idVendor = USB_VID,
|
||||
.idVendor = 0xCafe,
|
||||
.idProduct = USB_PID,
|
||||
.bcdDevice = 0x0100,
|
||||
|
||||
|
@ -109,17 +105,6 @@ enum
|
|||
#define EPNUM_CDC_1_OUT 0x05
|
||||
#define EPNUM_CDC_1_IN 0x86
|
||||
|
||||
#elif CFG_TUSB_MCU == OPT_MCU_FT90X || CFG_TUSB_MCU == OPT_MCU_FT93X
|
||||
// FT9XX doesn't support a same endpoint number with different direction IN and OUT
|
||||
// e.g EP1 OUT & EP1 IN cannot exist together
|
||||
#define EPNUM_CDC_0_NOTIF 0x81
|
||||
#define EPNUM_CDC_0_OUT 0x02
|
||||
#define EPNUM_CDC_0_IN 0x83
|
||||
|
||||
#define EPNUM_CDC_1_NOTIF 0x84
|
||||
#define EPNUM_CDC_1_OUT 0x05
|
||||
#define EPNUM_CDC_1_IN 0x86
|
||||
|
||||
#else
|
||||
#define EPNUM_CDC_0_NOTIF 0x81
|
||||
#define EPNUM_CDC_0_OUT 0x02
|
||||
|
@ -133,7 +118,7 @@ enum
|
|||
uint8_t const desc_fs_configuration[] =
|
||||
{
|
||||
// Config number, interface count, string index, total length, attribute, power in mA
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
|
||||
|
||||
// 1st CDC: Interface number, string index, EP notification address and size, EP data address (out, in) and size.
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC_0, 4, EPNUM_CDC_0_NOTIF, 8, EPNUM_CDC_0_OUT, EPNUM_CDC_0_IN, 64),
|
||||
|
@ -143,12 +128,10 @@ uint8_t const desc_fs_configuration[] =
|
|||
};
|
||||
|
||||
#if TUD_OPT_HIGH_SPEED
|
||||
// Per USB specs: high speed capable device must report device_qualifier and other_speed_configuration
|
||||
|
||||
uint8_t const desc_hs_configuration[] =
|
||||
{
|
||||
// Config number, interface count, string index, total length, attribute, power in mA
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
|
||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),
|
||||
|
||||
// 1st CDC: Interface number, string index, EP notification address and size, EP data address (out, in) and size.
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC_0, 4, EPNUM_CDC_0_NOTIF, 8, EPNUM_CDC_0_OUT, EPNUM_CDC_0_IN, 512),
|
||||
|
@ -156,44 +139,7 @@ uint8_t const desc_hs_configuration[] =
|
|||
// 2nd CDC: Interface number, string index, EP notification address and size, EP data address (out, in) and size.
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC_1, 4, EPNUM_CDC_1_NOTIF, 8, EPNUM_CDC_1_OUT, EPNUM_CDC_1_IN, 512),
|
||||
};
|
||||
|
||||
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
|
||||
tusb_desc_device_qualifier_t const desc_device_qualifier =
|
||||
{
|
||||
.bLength = sizeof(tusb_desc_device_t),
|
||||
.bDescriptorType = TUSB_DESC_DEVICE,
|
||||
.bcdUSB = USB_BCD,
|
||||
|
||||
.bDeviceClass = TUSB_CLASS_MISC,
|
||||
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
|
||||
.bDeviceProtocol = MISC_PROTOCOL_IAD,
|
||||
|
||||
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
|
||||
.bNumConfigurations = 0x01,
|
||||
.bReserved = 0x00
|
||||
};
|
||||
|
||||
// Invoked when received GET DEVICE QUALIFIER DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete.
|
||||
// device_qualifier descriptor describes information about a high-speed capable device that would
|
||||
// change if the device were operating at the other speed. If not highspeed capable stall this request.
|
||||
uint8_t const* tud_descriptor_device_qualifier_cb(void)
|
||||
{
|
||||
return (uint8_t const*) &desc_device_qualifier;
|
||||
}
|
||||
|
||||
// Invoked when received GET OTHER SEED CONFIGURATION DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||
// Configuration descriptor in the other speed e.g if high speed then this is for full speed and vice versa
|
||||
uint8_t const* tud_descriptor_other_speed_configuration_cb(uint8_t index)
|
||||
{
|
||||
(void) index; // for multiple configurations
|
||||
|
||||
// if link speed is high return fullspeed config, and vice versa
|
||||
return (tud_speed_get() == TUSB_SPEED_HIGH) ? desc_fs_configuration : desc_hs_configuration;
|
||||
}
|
||||
|
||||
#endif // highspeed
|
||||
#endif
|
||||
|
||||
// Invoked when received GET CONFIGURATION DESCRIPTOR
|
||||
// Application return pointer to descriptor
|
||||
|
@ -214,64 +160,52 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
|||
// String Descriptors
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// String Descriptor Index
|
||||
enum {
|
||||
STRID_LANGID = 0,
|
||||
STRID_MANUFACTURER,
|
||||
STRID_PRODUCT,
|
||||
STRID_SERIAL,
|
||||
};
|
||||
|
||||
// array of pointer to string descriptors
|
||||
char const *string_desc_arr[] =
|
||||
char const* string_desc_arr [] =
|
||||
{
|
||||
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
|
||||
"TinyUSB", // 1: Manufacturer
|
||||
"TinyUSB Device", // 2: Product
|
||||
NULL, // 3: Serials will use unique ID if possible
|
||||
"123456", // 3: Serials, should use chip ID
|
||||
"TinyUSB CDC", // 4: CDC Interface
|
||||
};
|
||||
|
||||
static uint16_t _desc_str[32 + 1];
|
||||
static uint16_t _desc_str[32];
|
||||
|
||||
// Invoked when received GET STRING DESCRIPTOR request
|
||||
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
|
||||
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
|
||||
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||
{
|
||||
(void) langid;
|
||||
size_t chr_count;
|
||||
|
||||
switch ( index ) {
|
||||
case STRID_LANGID:
|
||||
uint8_t chr_count;
|
||||
|
||||
if ( index == 0)
|
||||
{
|
||||
memcpy(&_desc_str[1], string_desc_arr[0], 2);
|
||||
chr_count = 1;
|
||||
break;
|
||||
|
||||
case STRID_SERIAL:
|
||||
chr_count = board_usb_get_serial(_desc_str + 1, 32);
|
||||
break;
|
||||
|
||||
default:
|
||||
}else
|
||||
{
|
||||
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
|
||||
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
|
||||
|
||||
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
|
||||
if ( !(index < sizeof(string_desc_arr)/sizeof(string_desc_arr[0])) ) return NULL;
|
||||
|
||||
const char *str = string_desc_arr[index];
|
||||
const char* str = string_desc_arr[index];
|
||||
|
||||
// Cap at max char
|
||||
chr_count = strlen(str);
|
||||
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
|
||||
if ( chr_count > max_count ) chr_count = max_count;
|
||||
if ( chr_count > 31 ) chr_count = 31;
|
||||
|
||||
// Convert ASCII string into UTF-16
|
||||
for ( size_t i = 0; i < chr_count; i++ ) {
|
||||
_desc_str[1 + i] = str[i];
|
||||
for(uint8_t i=0; i<chr_count; i++)
|
||||
{
|
||||
_desc_str[1+i] = str[i];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// first byte is length (including header), second byte is string type
|
||||
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8) | (2 * chr_count + 2));
|
||||
_desc_str[0] = (TUSB_DESC_STRING << 8 ) | (2*chr_count + 2);
|
||||
|
||||
return _desc_str;
|
||||
}
|
||||
|
|
0
examples/device/cdc_msc/.skip.MCU_SAMD11
Normal file
0
examples/device/cdc_msc/.skip.MCU_SAMD11
Normal file
|
@ -1,21 +1,15 @@
|
|||
cmake_minimum_required(VERSION 3.17)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
project(${PROJECT} C CXX ASM)
|
||||
project(${PROJECT})
|
||||
|
||||
# Checks this example is valid for the family and initializes the project
|
||||
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Espressif has its own cmake build system
|
||||
if(FAMILY STREQUAL "espressif")
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_executable(${PROJECT})
|
||||
|
||||
# Example source
|
||||
|
@ -32,4 +26,4 @@ target_include_directories(${PROJECT} PUBLIC
|
|||
|
||||
# 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} noos)
|
||||
family_configure_device_example(${PROJECT})
|
|
@ -1,3 +1,4 @@
|
|||
include ../../../tools/top.mk
|
||||
include ../../make.mk
|
||||
|
||||
INC += \
|
||||
|
@ -5,11 +6,7 @@ INC += \
|
|||
$(TOP)/hw \
|
||||
|
||||
# Example source
|
||||
EXAMPLE_SOURCE += \
|
||||
src/main.c \
|
||||
src/msc_disk.c \
|
||||
src/usb_descriptors.c \
|
||||
|
||||
EXAMPLE_SOURCE += $(wildcard src/*.c)
|
||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||
|
||||
include ../../rules.mk
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue