Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
978398e
Added additional S2DFM pins and ergonomic API
CorvusPrudens Oct 10, 2023
5633b20
Added runtime Seed version detection
CorvusPrudens Oct 10, 2023
2babfc3
Removed unused asm use
CorvusPrudens Oct 10, 2023
c716c67
Removed examples from CI checks
CorvusPrudens Dec 7, 2023
4a6b433
chore(style): rustfmt
CorvusPrudens Dec 7, 2023
5b9fed6
chore(ci): removed broken clippy action
CorvusPrudens Dec 7, 2023
3a39b88
align blinky example with new system init macro
libesz Dec 6, 2023
30880cf
Seed onboard (BOOT) button support and example.
libesz Dec 6, 2023
7ae9d8f
Merge pull request #2 from libesz/fix-blinky
CorvusPrudens Dec 7, 2023
d7e0ca9
Merge pull request #1 from libesz/button
CorvusPrudens Dec 7, 2023
6212ab7
feat: use slices for changing block sizes (#6)
nathansbradshaw Aug 22, 2024
72e2828
Fixed Seed version codec init
CorvusPrudens Aug 22, 2024
cdf86cf
Merge pull request #7 from CorvusPrudens/codec-version-fix
CorvusPrudens Aug 22, 2024
58ae5e6
Exposed internal USB pins for user-space
CorvusPrudens Aug 26, 2024
8306e00
Removed formatting configuration
CorvusPrudens Aug 26, 2024
ca56638
Merge pull request #8 from CorvusPrudens/expose-usb
CorvusPrudens Aug 26, 2024
4140d73
Corrected Rev4 and Rev7 CODEC initialization
CorvusPrudens Sep 25, 2024
a04b80e
Merge pull request #9 from CorvusPrudens/rev7-fix
CorvusPrudens Sep 25, 2024
958b4ea
Provided for_each audio API
CorvusPrudens Oct 24, 2024
a00b067
Merge pull request #10 from CorvusPrudens/for-each-api
CorvusPrudens Oct 24, 2024
a9d95bd
Added bootloader support (#11)
CorvusPrudens Oct 29, 2024
f67de58
Improved bootloader robustness
CorvusPrudens Oct 30, 2024
e1c4486
Merge pull request #12 from CorvusPrudens/boot-robustness
CorvusPrudens Oct 30, 2024
9fd1fd9
Started working on multiplexer API
CorvusPrudens Dec 9, 2024
78f9b14
Suppressed mutable static warning
CorvusPrudens Dec 11, 2024
a064be3
Resolved passthrough issue on newer CODECs
CorvusPrudens Dec 13, 2024
88b358c
Resolved incorrect SAI DMA ordering
CorvusPrudens Dec 17, 2024
a2d720a
Started work on mpr121 device
CorvusPrudens Feb 12, 2025
f0fc9a7
Improved mpr121 driver
CorvusPrudens Feb 12, 2025
e6c59db
Implemented simple shift register driver
CorvusPrudens Feb 14, 2025
9fbb859
Introduced simple encoder driver
CorvusPrudens Feb 17, 2025
1ab8d81
Improved semihosting configurability
CorvusPrudens Feb 19, 2025
8470911
Improved version detection
CorvusPrudens Mar 4, 2025
3b6c0f6
Added special backup region
CorvusPrudens Mar 13, 2025
bb83fe1
Added additional boot capabilities
CorvusPrudens Mar 14, 2025
1053e93
Add function to expose a block-by-block buffer write
void-scape Jul 17, 2025
41c2e06
Renamed functions
void-scape Jul 17, 2025
a9f544e
Added PatchSmSystem. Renamed System to SeedSystem and friends.
void-scape Jul 30, 2025
8426166
Added special audio initialization for the PatchSm
void-scape Aug 1, 2025
89549aa
Fixed compiler errors
void-scape Aug 1, 2025
8680866
Removed hard-coded sample rates
CorvusPrudens Sep 15, 2025
116820b
Provided sample rate input
CorvusPrudens Sep 15, 2025
3c06cc2
initial version of pca9685 using blocking writes.
stephenhensley Dec 23, 2025
f79ca72
fixed MODE2 register weirdness, and did not choose to invert at the d…
stephenhensley Dec 23, 2025
ea4cfab
removed unnecessary transmute, and removed gamma table
stephenhensley Dec 23, 2025
46071e0
Merge pull request #14 from stephenhensley/pca9685
CorvusPrudens Dec 23, 2025
d70c880
Added new seed version
CorvusPrudens Jan 26, 2026
e25ee27
Merge pull request #15 from CorvusPrudens/new-version
CorvusPrudens Jan 26, 2026
fef5958
initial addition of Pca9555 i/o expander driver.
stephenhensley Jan 28, 2026
3c2be35
pca9555 - fix obvious issues/missing bits
stephenhensley Jan 28, 2026
61ac43b
potentially functional driver after latest changes/cleanup.
stephenhensley Jan 30, 2026
224d842
Merge pull request #16 from stephenhensley/device-pca9555
CorvusPrudens Feb 5, 2026
c50724a
Fixed initial switch state
CorvusPrudens Mar 5, 2026
c6e7544
Made initial state configurable
CorvusPrudens Mar 5, 2026
bf879b4
initial fix: blanket i/o channel swap for mismatch in expected SAI/I2…
stephenhensley Mar 23, 2026
78c83f1
secondary fix: resolves secondary channel-swap, and audio input buzz …
stephenhensley Mar 23, 2026
ce69ed8
Merge pull request #17 from stephenhensley/audio-io-dir
CorvusPrudens Mar 23, 2026
1f25e96
dac initialization methods for the seed, and methods for taking dac p…
stephenhensley Apr 30, 2026
22a4cb8
refactor DAC management to its own struct to prevent borrow/ownership…
stephenhensley May 1, 2026
78cf89f
Merge pull request #18 from stephenhensley/seed-dac-rework
CorvusPrudens May 1, 2026
622431c
remaps PatchSM CV input pins to match documented order in datasheet, …
stephenhensley Jun 25, 2026
657768e
Merge pull request #19 from stephenhensley/patchsm-ADC-remap
CorvusPrudens Jun 26, 2026
65e1b46
fixed seed_minimal_init macro bug
void-scape Aug 3, 2026
17dae0a
Merge pull request #20 from CorvusPrudens/seed-min-init
CorvusPrudens Aug 3, 2026
a25ca2c
Added halting i2c driver
CorvusPrudens Sep 30, 2026
59ee4ea
configure pll2r
void-scape Oct 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
48 changes: 48 additions & 0 deletions .github/workflows/build_examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build LibDaisy Examples

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Install target
run: rustup target add thumbv7em-none-eabihf

- name: Cache cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Build examples
run: |
excluded_examples="sdmmc usb_midi" # List of examples to exclude
for example in $(ls examples/*.rs); do
example_name=$(basename $example .rs)
if [[ ! " $excluded_examples " =~ " $example_name " ]]; then
cargo build --example $example_name
else
echo "Skipping $example_name"
fi
done
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
with:
use-cross: true
command: build
args: --verbose --release --examples --target thumbv7em-none-eabihf --features ${{ matrix.logger }}
args: --verbose --release --target thumbv7em-none-eabihf --features ${{ matrix.logger }}
22 changes: 0 additions & 22 deletions .github/workflows/clippy.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
with:
use-cross: true
command: build
args: --verbose --release --examples --target thumbv7em-none-eabihf
args: --verbose --release --target thumbv7em-none-eabihf
5 changes: 0 additions & 5 deletions .rustfmt.toml

This file was deleted.

58 changes: 38 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Hardware Abstraction Layer implementation for Daisy boards"
keywords = ["cortex-m", "stm32h7xx", "stm32h750", "hal", "daisy"]
readme = "README.md"
name = "libdaisy"
version = "0.1.0"
version = "0.2.0"
license = "MIT"
repository = "https://github.com/mtthw-meyer/libdaisy-rust.git"
documentation = "https://docs.rs/libdaisy"
Expand All @@ -14,28 +14,45 @@ exclude = [".gitignore"]
[dependencies]
cfg-if = "1"
cortex-m = "0.7"
cortex-m-log = { version = "0.8", features = ["itm", "semihosting", "log-integration"], optional = true }
cortex-m-rtic = "1"
cortex-m-semihosting = { version = "0.5", optional = true }
cortex-m-log = { version = "0.8", features = [
"itm",
"semihosting",
"log-integration",
], optional = true }
cortex-m-semihosting = { version = "0.5", optional = true }
debouncr = "0.2.2"
lazy_static = { version = "1.4.0", features = ["spin_no_std"], optional = true }
lazy_static = { version = "1.4.0", features = ["spin_no_std"], optional = true }
log = "0.4"
micromath = "2"
panic-halt = "0.2.0"
panic-itm = { version = "0.4", optional = true }
panic-rtt-target = { version = "0.1.2", features = ["cortex-m"], optional = true }
panic-semihosting = { version = "0.6", optional = true }
rtt-target = { version = "0.4.0", optional = true }
panic-itm = { version = "0.4", optional = true }
panic-rtt-target = { version = "0.1.3", optional = true }
panic-semihosting = { version = "0.6", optional = true }
rtt-target = { version = "0.5.0", optional = true }
stm32-fmc = "0.3.0"
stm32h7xx-hal = { version = "0.14.0", features = ["stm32h750v","rt","fmc", "xspi", "sdmmc", "sdmmc-fatfs", "usb_hs"] }
stm32h7xx-hal = { version = "0.16.0", features = [
"stm32h750v",
"rt",
"fmc",
"xspi",
"sdmmc",
"sdmmc-fatfs",
"usb_hs",
] }
embedded-hal = "0.2"

[features]
default = []

log-itm = ["panic-itm", "lazy_static", "cortex-m-log"]
log-itm = ["dep:panic-itm", "dep:lazy_static", "dep:cortex-m-log"]
log-none = []
log-rtt = ["rtt-target", "panic-rtt-target"]
log-semihosting = ["panic-semihosting", "lazy_static", "cortex-m-log", "cortex-m-semihosting"]
log-rtt = ["dep:rtt-target", "dep:panic-rtt-target"]
log-semihosting = [
"dep:lazy_static",
"dep:cortex-m-log",
"dep:cortex-m-semihosting",
]
panic-semihosting = ["dep:panic-semihosting"]

# this lets you use `cargo fix`!
#[[bin]]
Expand All @@ -44,18 +61,19 @@ log-semihosting = ["panic-semihosting", "lazy_static", "cortex-m-log", "cortex-m
#bench = false

[profile.dev]
codegen-units = 1 # better optimizations
debug = true # symbols are nice and they don't increase the size in flash
codegen-units = 1 # better optimizations
debug = true # symbols are nice and they don't increase the size in flash
incremental = false
opt-level = "s" # optimize for binary size
opt-level = "s" # optimize for binary size

[profile.release]
codegen-units = 1 # better optimizations
debug = true # symbols are nice and they don't increase the size in flash
lto = true # better optimizations
opt-level = "s" # optimize for binary size
debug = true # symbols are nice and they don't increase the size in flash
lto = true # better optimizations
opt-level = "s" # optimize for binary size

[dev_dependencies]
[dev-dependencies]
cortex-m-rtic = "1"
embedded-sdmmc = "0.4"
libm = "0.2"
num_enum = { version = "0.5", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ One of:
```bash
cargo embed --features log-rtt --example passthru
```
**note** You will need to specify the board IE `--chip stm32h750v` for the daisy seed, or create an `Embed.toml` that specifies the chip.

## Build Examples

Expand Down
21 changes: 14 additions & 7 deletions examples/blinky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
)]
mod app {
// Includes a panic handler and optional logging facilities
use libdaisy::logger;
use libdaisy::{gpio, system};
use libdaisy::{gpio, logger, system};
use log::info;
use stm32h7xx_hal::{stm32, time::MilliSeconds, timer::Timer};

Expand All @@ -25,18 +24,26 @@ mod app {
#[init]
fn init(ctx: init::Context) -> (Shared, Local, init::Monotonics) {
logger::init();
let mut system = system::System::init(ctx.core, ctx.device);
let mut core = ctx.core;
let device = ctx.device;
let ccdr = system::SeedSystem::init_clocks(device.PWR, device.RCC, &device.SYSCFG);
let system = libdaisy::seed_system_init!(core, device, ccdr);
info!("Startup done!");
let mut timer2 = stm32h7xx_hal::timer::TimerExt::timer(
device.TIM2,
MilliSeconds::from_ticks(100).into_rate(),
ccdr.peripheral.TIM2,
&ccdr.clocks,
);
timer2.listen(stm32h7xx_hal::timer::Event::TimeOut);

system
.timer2
.set_freq(MilliSeconds::from_ticks(500).into_rate());
timer2.set_freq(MilliSeconds::from_ticks(500).into_rate());

(
Shared {},
Local {
seed_led: system.gpio.led,
timer2: system.timer2,
timer2,
},
init::Monotonics(),
)
Expand Down
56 changes: 56 additions & 0 deletions examples/button.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#![deny(warnings)]
#![deny(unsafe_code)]
#![no_std]
#![no_main]

#[rtic::app(device = stm32h7xx_hal::stm32, peripherals = true)]
mod app {
use libdaisy::{
gpio,
hal::gpio::{Edge, ExtiPin},
logger, system,
};
use log::info;

#[shared]
struct Shared {}

#[local]
struct Local {
button: gpio::SeedButton,
led: gpio::SeedLed,
}

#[init]
fn init(ctx: init::Context) -> (Shared, Local, init::Monotonics) {
logger::init();
let mut core = ctx.core;
let mut device = ctx.device;
let ccdr = system::SeedSeedSystem::init_clocks(device.PWR, device.RCC, &device.SYSCFG);
let mut system = libdaisy::seed_seed_system_init!(core, device, ccdr);
info!("Startup done!");

// Button
system.gpio.button.make_interrupt_source(&mut device.SYSCFG);
system
.gpio
.button
.trigger_on_edge(&mut device.EXTI, Edge::Rising);
system.gpio.button.enable_interrupt(&mut device.EXTI);

(
Shared {},
Local {
button: system.gpio.button,
led: system.gpio.led,
},
init::Monotonics(),
)
}

#[task(binds = EXTI3, local = [button, led])]
fn button_click(ctx: button_click::Context) {
ctx.local.button.clear_interrupt_pending_bit();
ctx.local.led.toggle();
}
}
13 changes: 10 additions & 3 deletions examples/delay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
peripherals = true,
)]
mod app {
use libdaisy::{audio, logger, system};
use libdaisy::{
audio::{self, AudioBuffer},
logger, system,
};
use log::info;

#[shared]
Expand All @@ -16,14 +19,18 @@ mod app {
#[local]
struct Local {
audio: audio::Audio,
buffer: audio::AudioBuffer,
buffer: AudioBuffer,
sdram: &'static mut [f32],
}

#[init]
fn init(ctx: init::Context) -> (Shared, Local, init::Monotonics) {
logger::init();
let system = system::System::init(ctx.core, ctx.device);

let mut core = ctx.core;
let device = ctx.device;
let ccdr = system::SeedSystem::init_clocks(device.PWR, device.RCC, &device.SYSCFG);
let system = libdaisy::seed_system_init!(core, device, ccdr);
let buffer = [(0.0, 0.0); audio::BLOCK_SIZE_MAX];

info!("Startup done!");
Expand Down
19 changes: 14 additions & 5 deletions examples/flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,21 @@ mod app {
#[init]
fn init(ctx: init::Context) -> (Shared, Local, init::Monotonics) {
logger::init();
let mut system = system::System::init(ctx.core, ctx.device);
let mut core = ctx.core;
let device = ctx.device;
let ccdr = system::SeedSystem::init_clocks(device.PWR, device.RCC, &device.SYSCFG);
let system = libdaisy::seed_system_init!(core, device, ccdr);
info!("Startup done!");
let mut timer2 = stm32h7xx_hal::timer::TimerExt::timer(
device.TIM2,
MilliSeconds::from_ticks(100).into_rate(),
ccdr.peripheral.TIM2,
&ccdr.clocks,
);

system
.timer2
.set_freq(MilliSeconds::from_ticks(500).into_rate());
timer2.listen(stm32h7xx_hal::timer::Event::TimeOut);

timer2.set_freq(MilliSeconds::from_ticks(500).into_rate());

let mut flash = system.flash;

Expand Down Expand Up @@ -79,7 +88,7 @@ mod app {
Shared {},
Local {
seed_led: system.gpio.led,
timer2: system.timer2,
timer2,
},
init::Monotonics(),
)
Expand Down
21 changes: 16 additions & 5 deletions examples/hid_blinky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,22 @@ mod app {
#[init]
fn init(ctx: init::Context) -> (Shared, Local, init::Monotonics) {
logger::init();
let mut system = system::System::init(ctx.core, ctx.device);
let mut core = ctx.core;
let device = ctx.device;
let ccdr = system::SeedSystem::init_clocks(device.PWR, device.RCC, &device.SYSCFG);
let mut system = libdaisy::seed_system_init!(core, device, ccdr);
info!("Startup done!");

system
.timer2
.set_freq(MilliSeconds::from_ticks(1).into_rate());
let mut timer2 = stm32h7xx_hal::timer::TimerExt::timer(
device.TIM2,
MilliSeconds::from_ticks(100).into_rate(),
ccdr.peripheral.TIM2,
&ccdr.clocks,
);

timer2.listen(stm32h7xx_hal::timer::Event::TimeOut);

timer2.set_freq(MilliSeconds::from_ticks(1).into_rate());

let mut led1 = hid::Led::new(system.gpio.led, false, 1000);
led1.set_brightness(0.5);
Expand All @@ -55,7 +66,7 @@ mod app {
led1,
adc1,
control1,
timer2: system.timer2,
timer2,
},
init::Monotonics(),
)
Expand Down
Loading