diff options
| author | hathach <[email protected]> | 2026-06-29 10:16:25 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-06-29 10:16:25 +0700 |
| commit | 4b1c8d16f72bb5d8f2eb8a2e8dde35abdd2f2a88 (patch) | |
| tree | 3db175aa3d96c92a44fab764dba59f473096c4b4 /examples/device/cdc_uac2 | |
| parent | 0a25cc27d7d3699536f6df01e80af3eb0423ce58 (diff) | |
docs: add build-doc tooling and a README for every example
Documentation tooling:
- Add the `build-doc` skill and `tools/build_doc.py` wrapper for local
Sphinx builds (clean / -W / open).
- Enable Markdown (MyST) in conf.py and auto-collect
examples/{device,host,dual}/*/README.md into a 3-level Examples nav
(Examples > Device/Host/Dual > example), noting each page's source
location and normalizing headings to a single H1.
- Remove the stale `.claude/commands/build-doc.md`; point the AGENTS.md
Documentation section at the skill.
Example docs:
- Add a README.md for every device/host/dual example: what it does, USB
interface table, notable tusb_config.h settings, generic CMake + Make
build steps, and how to try it.
- Fold each *_freertos variant into its base README, noting the FreeRTOS
source path and any RTOS-specific behavior.
Generated docs/examples/ output is git-ignored. Builds clean with
`sphinx-build -W`.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'examples/device/cdc_uac2')
| -rw-r--r-- | examples/device/cdc_uac2/README.md | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/examples/device/cdc_uac2/README.md b/examples/device/cdc_uac2/README.md index 5d120be7d..193060f10 100644 --- a/examples/device/cdc_uac2/README.md +++ b/examples/device/cdc_uac2/README.md @@ -1,10 +1,8 @@ -#### Composite CDC + UAC2 on Pico +# CDC + UAC2 -This example provides a composite CDC + UAC2 device on top of a Raspberry Pi -Pico board. +This example provides a composite CDC + UAC2 device. - -#### Use Cases +## Use Cases - The CDC + UAC2 composite device happens to be important, especially in the amateur radio community. @@ -18,35 +16,55 @@ Pico board. the amateur radio community to build (`homebrew`) radios with similar functionality as the (expensive) commercial rigs. - This PR is important in bridging this specific gap between the commercial - rigs and homebrew equipment. - - https://digirig.net/digirig-mobile-rev-1-9/ is a digital interface for interfacing radios (that lack an inbuilt digital interface) with computers. Digirig Mobile works brilliantly (is OSS!) and is a big improvement over traditional digital interfaces (like the SignaLink USB Interface). By using a - Raspberry Pi Pico powered CDC + UAC2 composite device, we can simplify the + CDC + UAC2 composite device, we can simplify the Digirig Mobile schematic, drastically reduce the manufacturing cost, and (again) enable the homebrewers community to homebrew a modern digital interface with ease themselves. -#### Build Steps +## Build Steps +```bash +mkdir build && cd build +cmake -DBOARD=raspberry_pi_pico .. +cmake --build . ``` -cd examples/device/cdc_uac2 -export PICO_SDK_PATH=$HOME/pico-sdk +Make: -cmake -DFAMILY=rp2040 pico . +```bash +make BOARD=raspberry_pi_pico all +``` -cmake -DFAMILY=rp2040 -DCMAKE_BUILD_TYPE=Debug # use this for debugging +## USB Descriptors -make BOARD=raspberry_pi_pico all +| Interface | Class driver | +|-----------|--------------| +| 0–2 | UAC2 audio (control, speaker streaming, mic streaming) | +| 3–4 | CDC (virtual serial) | + +## Configuration + +Notable `tusb_config.h` settings: + +```c +#define CFG_TUD_CDC 1 +#define CFG_TUD_AUDIO 1 +#define CFG_TUD_AUDIO_FUNC_1_N_FORMATS 2 // two audio formats +#define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 96000 // 48000 on Renesas RX +#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64) +#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64) ``` +## How to use + +After flashing, the device enumerates as both a USB sound card and a serial port: -#### Development Notes +- **Audio:** appears as a standard UAC2 sound card — list it with `arecord -l` / `aplay -l` on Linux, or find it in the OS sound settings. Audio is sourced/sunk by the example's `audio_task`. +- **Serial:** the CDC port shows up as `/dev/ttyACMx` (Linux/macOS) or a COM port (Windows); open it with any terminal. -Please try to keep this code synchronized with the `uac2_headset` example -included in this repository. +In the amateur-radio setup, digital-mode software (WSJT-X, fldigi, …) uses the sound card for audio and the serial port for CAT/PTT control — both over the one cable. |
