Skip to content

Commit

Permalink
Document Pi Pico W BLE support
Browse files Browse the repository at this point in the history
  • Loading branch information
tttapa committed Jan 23, 2024
1 parent 4309ae7 commit 9ec4373
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 4 deletions.
1 change: 1 addition & 0 deletions doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@ RECURSIVE = YES

EXCLUDE = ../src/AH/STL \
../src/MIDI_Interfaces/BLEMIDI/ESP32/README.md \
../src/MIDI_Interfaces/BLEMIDI/ESP32-NimBLE/README.md \
../src/Submodules/Encoder/README.md

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
Expand Down
15 changes: 14 additions & 1 deletion doxygen/pages/MIDI-over-BLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ backend for the particular board.
| Arduino MKR 1010 WiFi | @ref ArduinoBLEBackend | |
| Arduino UNO R4 WiFi | @ref ArduinoBLEBackend | |
| Arduino GIGA R1 WiFi | @ref ArduinoBLEBackend | |
| Raspberry Pi Pico W (RP2040) | Not yet supported | |
| Raspberry Pi Pico W (RP2040) | @ref BTstackBackgroundBackend | |
| ESP32 | @ref ESP32BluedroidBackend | @ref ESP32NimBLEBackend |
| ESP32-S3 | @ref ESP32BluedroidBackend | @ref ESP32NimBLEBackend |
| ESP32-C3, ESP32-C6, ESP32-H2 | @ref ESP32BluedroidBackend | @ref ESP32NimBLEBackend |
Expand Down Expand Up @@ -67,3 +67,16 @@ library in order to use this backend.

Defining @ref CS_USE_NIMBLE before including Control Surface changes the default
backend for ESP32 to the @ref ESP32NimBLEBackend.

### BTstackBackgroundBackend

This backend uses the [BTstack](https://github.com/bluekitchen/btstack) stack
that ships with the [pico-sdk](https://github.com/raspberrypi/pico-sdk).

All Bluetooth events are handled asynchronously (using the background
[`async_context`](https://www.raspberrypi.com/documentation/pico-sdk/networking.html#ga092b97e879be5b9aa9121abda23e1337)).
Currently, buffering outgoing MIDI messages still requires polling, although
this could be replaced by a BTstack timer in the future.

To use the @ref BluetoothMIDI_Interface on the Pico W, you have to enable the
Bluetooth stack in the _Tools > IP/Bluetooth Stack_ menu in the IDE: <https://arduino-pico.readthedocs.io/en/latest/bluetooth.html#enabling-bluetooth>
2 changes: 1 addition & 1 deletion doxygen/pages/MIDI-over-USB.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ There are some differences in MIDI over USB implementation between different typ
| Teensy LC, 3.0, 3.1, 3.2, 3.5, 4.0 |||||
| Teensy 3.6, 4.1 |||||
| Raspberry Pi Pico (RP2040) |||||
| Raspberry Pi Pico W (RP2040) |||| |
| Raspberry Pi Pico W (RP2040) |||| |
| ESP8266 |||||
| ESP32 |||||
| ESP32-S2 || 🔼 |||
Expand Down
13 changes: 12 additions & 1 deletion examples/3. MIDI Interfaces/BLEMIDI-Adapter/BLEMIDI-Adapter.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/**
* Turns an Arduino into a Bluetooth Low Energy (BLE) to 5-pin DIN MIDI adapter.
*
* @boards Nano 33 IoT, Nano 33 BLE, ESP32, ESP32-S3
* @boards Nano 33 IoT, Nano 33 BLE, ESP32, ESP32-S3, Pi Pico W
*
* Configuration
* -------------
*
* - If you're using a Pi Pico W, you'll have to enable the Bluetooth stack
* from the _Tools > IP/Bluetooth Stack_ menu in the IDE.
* - If you're using an ESP32, you can optionally switch to the NimBLE backend
* by installing the [h2zero/NimBLE-Arduino](https://github.com/h2zero/NimBLE-Arduino)
* library, and adding `#define CS_USE_NIMBLE` at the top of this sketch.
* - If you're not using a Pico or an ESP32, you'll have to install the
* [ArduinoBLE](https://github.com/arduino-libraries/ArduinoBLE) library.
*
* Connections
* -----------
Expand Down
13 changes: 12 additions & 1 deletion examples/examples.dox
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,18 @@
*
* Turns an Arduino into a Bluetooth Low Energy (BLE) to 5-pin DIN MIDI adapter.
*
* @boards Nano 33 IoT, Nano 33 BLE, ESP32, ESP32-S3
* @boards Nano 33 IoT, Nano 33 BLE, ESP32, ESP32-S3, Pi Pico W
*
* Configuration
* -------------
*
* - If you're using a Pi Pico W, you'll have to enable the Bluetooth stack
* from the _Tools > IP/Bluetooth Stack_ menu in the IDE.
* - If you're using an ESP32, you can optionally switch to the NimBLE backend
* by installing the [h2zero/NimBLE-Arduino](https://github.com/h2zero/NimBLE-Arduino)
* library, and adding `#define CS_USE_NIMBLE` at the top of this sketch.
* - If you're not using a Pico or an ESP32, you'll have to install the
* [ArduinoBLE](https://github.com/arduino-libraries/ArduinoBLE) library.
*
* Connections
* -----------
Expand Down
1 change: 1 addition & 0 deletions test/examples-board-fqbns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ nano 33 iot: arduino:samd:nano_33_iot
nano 33 ble: arduino:mbed_nano:nano33ble
nano every: arduino:megaavr:nona4809:mode=off
pi pico: arduino:mbed_rp2040:pico
pi pico w: rp2040:rp2040:rpipicow:ipbtstack=ipv4btcble
uno r4: arduino:renesas_uno:minima

0 comments on commit 9ec4373

Please sign in to comment.