| Crates.io | daisy-embassy |
| lib.rs | daisy-embassy |
| version | 0.2.1 |
| created_at | 2025-05-06 14:02:33.078555+00 |
| updated_at | 2025-06-12 15:20:32.852139+00 |
| description | async audio development with daisy seed and embassy |
| homepage | |
| repository | https://github.com/daisy-embassy/daisy-embassy |
| max_upload_size | |
| id | 1662405 |
| size | 163,583 |
daisy-embassy is a Rust crate for building embedded async audio applications on the Daisy Seed using the Embassy framework. It provides a streamlined interface to initialize and configure Daisy Seed hardware for both low-latency, non-blocking audio processing and powerful asynchronous application processing, making it an ideal starting point for embedded audio projects in Rust.
This crate is designed for developers familiar with embedded systems and audio processing, but new to Rust's embedded ecosystem. It enables safe and flexible audio application development, leveraging Rust's type system to prevent common peripheral configuration errors at compile time.
daisy-embassy(and embassy) supports async handling of GPIO interrupts, MIDI message stream reading/writing, OLED display updates, AD/DA streaming, and other application logic, allowing developers to create complex, event-driven audio projects with ease.new_daisy_board! macro to initialize Daisy Seed peripherals with minimal boilerplate.daisy_embassy::default_rcc, and avoid the usual headaches of manual peripheral and DMA setup.To demonstrate the ease of use, here's a simplified version of the passthrough.rs example, which sets up an audio passthrough (input to output) using the new_daisy_board! macro:
// safe clock configuration
let config = daisy_embassy::default_rcc();
// initialize the "board"
let p = hal::init(config);
let board: DaisyBoard<'_> = new_daisy_board!(p);
// build the "interface"
let mut interface = board
.audio_peripherals
.prepare_interface(Default::default())
.await;
// start audio interface
let mut interface = unwrap!(interface.start_interface().await);
// start audio callback
unwrap!(
interface
.start_callback(|input, output| {
// process audio data
// here, we just copy input to output
output.copy_from_slice(input);
})
.await
);
new_daisy_board! macro moves necessary objects from embassy_stm32::Peripherals into builders like daisy_embassy::AudioPeripherals or daisy_embassy::FlashBuilder and so on, streamlining peripheral initialization.XXXBuilder struct, which provides builder methods (in the case above, .prepare_interface()) for safe configuration.pub accessors, allowing advanced users to bypass our building and implement custom initialization logic for peripherals.See the examples/ directory for more demos, such as blinky.rs or triangle_wave_tx.rs.
| Board | Revision | Codec | Status |
|---|---|---|---|
| Daisy Seed 1.1 | Rev5 | WM8731 | ✅ Supported |
| Daisy Seed 1.2 | Rev7 | PCM3060 | ✅ Supported |
| Daisy Seed (AK4556) | - | AK4556 | 🚧 Not yet |
| Daisy Patch SM | - | PCM3060 | ✅ Supported |
Note: Additional board support is planned. Contributions are welcome; see the Issues page for details.
Rust Toolchain: Install via rustup:
rustup target add thumbv7em-none-eabihf
probe-rs: For flashing and debugging, install probe-rs.
Hardware: Supported board (Daisy Seed Rev5 or Rev7, or Daisy Patch SM) and USB cable.
Tip: If probe-rs fails, verify your board connection and check probe-rs docs.
Clone the Repository:
git clone https://github.com/daisy-embassy/daisy-embassy.git
cd daisy-embassy
Identify Your Board:
--features=seed_1_2 --no-default-features.--features=patch_sm --no-default-features.Run an Example:
# Rev5: Blinky example
cargo run --example blinky --release
# Rev7: Triangle wave example
cargo run --example triangle_wave_tx --features=seed_1_2 --no-default-features --release
Build and Customize:
examples/ for demos like passthrough.rs or triangle_wave_tx.rs.This project is licensed under the MIT License.