summaryrefslogtreecommitdiff
path: root/examples/device/cdc_uac2
diff options
context:
space:
mode:
Diffstat (limited to 'examples/device/cdc_uac2')
-rw-r--r--examples/device/cdc_uac2/README.md54
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.