ds3502

Crates.iods3502
lib.rsds3502
version0.1.0
created_at2025-10-21 07:32:22.517364+00
updated_at2025-10-21 07:32:22.517364+00
descriptionDriver for the Analog Devices Inc./Maxim Integrated DS3502 digital potentiometer
homepage
repositoryhttp://www.github.com/bsaintjo/ds3502
max_upload_size
id1893383
size34,240
Brandon Saint-John (bsaintjo)

documentation

README

I2C Digitial Potentiometer DS3502 driver in Rust

Crates.io License Crates.io Version docs.rs Crates.io MSRV embedded-hal Version

Rust embedded driver for the DS3502 Digital Potentiometer by Analog Devices Inc./Maxim Integrated. Supports block and async APIs.

Usage

use ds3502::{Ds3502, Wiper, ControlRegisterMode};
let mut digipot = Ds3502::blocking_init(i2c, Default::default())?;

// By default, driver initialized with Control Register in Mode 1 (Don't save to EEPROM)
assert_eq!(digipot.mode(), ControlRegisterMode::WiperOnly);

let wv = Wiper::try_from(88)?;
digipot.write_wiper(wv)?;

// Set wiper value and save to EEPROM
let wv = Wiper::try_from(123)?;
digipot.write_and_save_wiper(wv);

For a complete example that builds and flashes to a Raspberry Pi Pico using the embassy framework, checkout the pico-example directory.

Installation

Add to your Cargo.toml:

ds3502 = "0.1"

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 0

cargo fmt