nils afb07dd1c0 Hardware plan: deepen + design bipolar ±10V CV from the start
- Power budget (BLE-only, never WiFi TX) with concrete mA table.
- Bipolar CV section: ±12V rails (boost + inverter), DAC 0-4.096V -> ±10V
  via difference amp with 2.048V mid-ref, per-channel gain/offset trim,
  OPA4192 on ±12V, bidirectional TVS. Function+polarity decides mapping
  (pitch stays 0..+10V standard on a bipolar output).
- Concrete BOM table (part numbers, packages, alternates).
- Risks updated for bipolar calibration + ±12V rail noise.
- Build order updated.
2026-08-21 11:02:11 +02:00
2026-08-21 09:34:59 +02:00

pico-pi-midi (Rust)

BLE-MIDI keypad firmware for the Raspberry Pi Pico W (RP2040 + CYW43439), written in Rust using embassy, the cyw43 driver (Bluetooth), and the TrouBLE BLE host.

This is the Rust port of the original C/BTstack firmware (now kept separately as pico-pi-midi-c). It talks BLE-MIDI 1.0 to iOS / macOS Core MIDI, turning the Pimoroni Pico RGB Keypad into a 16-pad wireless MIDI controller.

What it does

  • 16-pad keypad (Pimoroni RGB Keypad Base): reads buttons over I²C (GPIO expander @ 0x20) and drives APA102 RGB LEDs over SPI (CS=17, SCK=18, MOSI=19).
  • BLE-MIDI 1.0 GATT server (MIDI Service 03B80E5A-…), advertised so Core MIDI discovers it as a MIDI device. Pad presses → Note On/Off over Bluetooth; incoming Note On lights the pad.
  • Octave display: the BOOTSEL button cycles the keypad's note offset by +12 and flashes the active octave as a digit on the 4×4 grid for 500 ms.
  • Onboard LED heartbeat (driven via the CYW43 chip — the Pico W's LED is on the wireless chip, not an RP2040 pin).
  • USB serial logging via embassy-usb-logger — connect and read with screen /dev/cu.usbmodem* 115200 to see boot/advertising logs.

Roadmap

This is v1: a BLE-MIDI keypad. The goal is a flexible MIDI router — MIDI over USB, BLE, keypad, TRS, and 4 stereo CV outputs, with channels configurable at runtime via an LCD. See the architecture notes (kept in the session memory) for the plan.

Building

Requires Rust stable (≥1.93) and the thumbv6m-none-eabi target:

rustup target add thumbv6m-none-eabi
cargo build --release

The CYW43 firmware blobs (cyw43-firmware/*.bin) are committed here so no network access is needed at build time. They are redistributable under the permissive binary license in the upstream embassy cyw43-firmware directory.

Flashing

cargo build --release
elf2uf2-rs convert target/thumbv6m-none-eabi/release/rgb-keypad target/uf2/rgb-keypad.uf2
# hold BOOTSEL + plug in the Pico W, then:
picotool load target/uf2/rgb-keypad.uf2 -x

License

GPL-3.0-or-later (see LICENSE).

src/codec.rs is a Rust port of the BLE-MIDI 1.0 packet codec from rppicomidi/pico-w-ble-midi-lib, which is MIT-licensed; that attribution is retained in the file header. MIT is GPL-3.0-compatible, so the repository as a whole is GPL-3.0-or-later while that file preserves its MIT provenance.

S
Description
No description provided
Readme GPL-3.0
306 KiB
Languages
Rust 99.6%
RPC 0.4%