| Crates.io | cs43l22-embedded |
| lib.rs | cs43l22-embedded |
| version | 1.0.0-alpha |
| created_at | 2025-03-23 20:16:48.27023+00 |
| updated_at | 2025-03-23 20:16:48.27023+00 |
| description | A cs43l22 DAC driver using embedded-hal |
| homepage | |
| repository | https://github.com/l1g4v/cs43l22-embedded |
| max_upload_size | |
| id | 1603007 |
| size | 72,352 |
A Rust crate for interfacing with the CS43L22 DAC on embedded platforms.
The cs43l22-embedded crate provides a driver for the CS43L22 DAC. Designed for embedded applications, it allows you to initialize, configure, and control the DAC.
Add the following to your Cargo.toml file:
[dependencies]
cs43l22-embedded = "1.0.0-alpha"
Here's a basic example to get started:
// Import the CS43L22 driver
use cs43l22_embedded::Cs43l22;
fn main() {
// Initialize the driver (adjust parameters as needed)
let mut cs43l22 = Cs43l22::new(
&mut i2c_device,
reset_pin,
delay_handler,
cs43l22_embedded::Config::default(),
cs43l22_embedded::BeepConfig::default(),
false,
)
.unwrap();
// Start audio playback
cs43l22.play().ok();
loop{
// Write pcm audio to the device using I2S
i2s.write(&audio_buffer);
}
}
Refer to the crate documentation for the available API methods.
For embedded targets, configure your build environment accordingly. Check the Embedded Book for additional guidance. Or check the examples for the STM32F407G-DISC1 dev board.
Not everything as been tested so alpha stage until I make sure everything works as expected.
Distributed under the GPL-3 License. See LICENSE for more information.