| Crates.io | ds3502 |
| lib.rs | ds3502 |
| version | 0.1.0 |
| created_at | 2025-10-21 07:32:22.517364+00 |
| updated_at | 2025-10-21 07:32:22.517364+00 |
| description | Driver for the Analog Devices Inc./Maxim Integrated DS3502 digital potentiometer |
| homepage | |
| repository | http://www.github.com/bsaintjo/ds3502 |
| max_upload_size | |
| id | 1893383 |
| size | 34,240 |
Rust embedded driver for the DS3502 Digital Potentiometer by Analog Devices Inc./Maxim Integrated. Supports block and async APIs.
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.
Add to your Cargo.toml:
ds3502 = "0.1"
Licensed under either of
at your option.
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.