7 releases (stable)
1.2.0 | Feb 17, 2023 |
---|---|
1.1.4 | Oct 11, 2022 |
1.1.3 | Aug 19, 2022 |
0.1.1 | Aug 11, 2022 |
#1245 in Hardware support
22 downloads per month
31KB
752 lines
pirate-midi-rs
Description
Rust library for sending serial commands to Pirate MIDI Bridge devices
Usage
Make sure your bridge device is connected via USB before running a command.
// create our test device
let device = PirateMIDIDevice::new();
// get device details
let response = device.send(Command::Check).unwrap(); // use a `match` instead of `.unwrap()`
// enter the bootloader
// the device will detach and then reattach in bootloader mode, and the serial port will no longer be available.
// will return `ok`, but any subsequent commands will throw an error
match PirateMIDIDevice::new().send(Command::Control(ControlArgs::EnterBootloader)) {
Ok(_) => Ok(()),
Err(err) => panic!("unable to enter bootloader: {}", err),
}
Dependencies
~3.5–5MB
~102K SLoC