summaryrefslogtreecommitdiffstats
path: root/src/construction.rs
diff options
context:
space:
mode:
authorMarkus Reiter <me@reitermark.us>2024-02-13 09:38:01 +0100
committerGitHub <noreply@github.com>2024-02-13 09:38:01 +0100
commit0ff4c7b448fd388015d4903b774c63991356b954 (patch)
treeefadd00a0534ed0c86e456c9b65d67e6c63c5fae /src/construction.rs
parent3c2805fdb499202d4f52d0775de8837cded97131 (diff)
downloadads1x1x-async-0ff4c7b448fd388015d4903b774c63991356b954.tar.gz
ads1x1x-async-0ff4c7b448fd388015d4903b774c63991356b954.tar.xz
ads1x1x-async-0ff4c7b448fd388015d4903b774c63991356b954.zip
Simplify `SlaveAddr`. (#21)
* Simplify `SlaveAddr`. * Update changelog. * Update CHANGELOG.md --------- Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
Diffstat (limited to 'src/construction.rs')
-rw-r--r--src/construction.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/construction.rs b/src/construction.rs
index 7ac128f..13a2350 100644
--- a/src/construction.rs
+++ b/src/construction.rs
@@ -1,6 +1,6 @@
//! Constructor/destructor functions.
-use crate::{ic, mode, Ads1x1x, Config, FullScaleRange, SlaveAddr, DEVICE_BASE_ADDRESS};
+use crate::{ic, mode, Ads1x1x, Config, FullScaleRange, SlaveAddr};
use core::marker::PhantomData;
macro_rules! impl_new_destroy {
@@ -13,7 +13,7 @@ macro_rules! impl_new_destroy {
pub fn $create(i2c: I2C, address: SlaveAddr) -> Self {
Ads1x1x {
i2c,
- address: address.addr(DEVICE_BASE_ADDRESS),
+ address: address.bits(),
config: Config::default(),
fsr: FullScaleRange::default(),
a_conversion_was_started: false,