68 lines
1.8 KiB
Markdown
68 lines
1.8 KiB
Markdown
# Installation
|
|
|
|
> Original: [Installation](https://tttapa.github.io/Control-Surface/Doxygen/d8/da8/md_pages_Installation.html)
|
|
|
|
cs-midi is a CMake static library included as a subdirectory of your pico-sdk project.
|
|
|
|
## Prerequisites
|
|
|
|
- [pico-sdk](https://github.com/raspberrypi/pico-sdk) (1.5.1+)
|
|
- CMake 3.13+
|
|
- ARM GCC toolchain (`arm-none-eabi-gcc`)
|
|
|
|
## Adding cs-midi to your project
|
|
|
|
Place cs-midi under `lib/` (or any subdirectory) and add it from your project's `CMakeLists.txt`:
|
|
|
|
```cmake pico
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
include(pico_sdk_import.cmake)
|
|
|
|
project(my_controller C CXX ASM)
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
pico_sdk_init()
|
|
|
|
# Enable desired transports before add_subdirectory
|
|
set(CS_MIDI_BLE ON)
|
|
set(CS_MIDI_USB OFF)
|
|
set(CS_MIDI_SERIAL OFF)
|
|
set(CS_MIDI_APPLEMIDI OFF)
|
|
|
|
add_subdirectory(lib/cs-midi)
|
|
|
|
add_executable(my_controller main.cpp)
|
|
target_link_libraries(my_controller cs_midi)
|
|
|
|
pico_add_extra_outputs(my_controller)
|
|
```
|
|
|
|
## Board configuration
|
|
|
|
For RP2350 boards with the RM2 radio module, cs-midi provides a board header:
|
|
|
|
```cmake pico
|
|
set(PICO_BOARD waveshare_rp2350b_plus_w)
|
|
set(PICO_BOARD_HEADER_DIRS ${CMAKE_SOURCE_DIR}/lib/cs-midi/boards)
|
|
```
|
|
|
|
For Pico W (RP2040), use the built-in `pico_w` board:
|
|
|
|
```cmake pico
|
|
set(PICO_BOARD pico_w)
|
|
```
|
|
|
|
## CMake options
|
|
|
|
| Option | Default | Description |
|
|
|--------|---------|-------------|
|
|
| `CS_MIDI_BLE` | ON | BLE MIDI via BTstack |
|
|
| `CS_MIDI_USB` | OFF | USB MIDI via TinyUSB |
|
|
| `CS_MIDI_SERIAL` | OFF | Serial MIDI over UART |
|
|
| `CS_MIDI_APPLEMIDI` | OFF | AppleMIDI (RTP-MIDI over WiFi) |
|
|
| `CS_MIDI_HID_KEYBOARD` | OFF | HID keyboard + Battery Service for BLE auto-reconnect |
|
|
|
|
USB MIDI requires `tusb_config.h` and `usb_descriptors.c` in your project — see `templates/` for reference files.
|