summaryrefslogtreecommitdiffstats
path: root/src/channels.rs
diff options
context:
space:
mode:
authorDiego Barrios Romero <eldruin@gmail.com>2019-03-30 13:36:06 +0200
committerDiego Barrios Romero <eldruin@gmail.com>2019-03-31 13:41:26 +0200
commit50223ad02e2f487540107e320c8bef40a9849582 (patch)
tree58b4e44e2261940d07aba96b8d8e83457e641f53 /src/channels.rs
parentab1221e175f2da577c7a3fb510b5ae5cf41b0697 (diff)
downloadads1x1x-async-50223ad02e2f487540107e320c8bef40a9849582.tar.gz
ads1x1x-async-50223ad02e2f487540107e320c8bef40a9849582.tar.xz
ads1x1x-async-50223ad02e2f487540107e320c8bef40a9849582.zip
Format code
Diffstat (limited to 'src/channels.rs')
-rw-r--r--src/channels.rs40
1 files changed, 32 insertions, 8 deletions
diff --git a/src/channels.rs b/src/channels.rs
index d5ae7bc..90b9b5d 100644
--- a/src/channels.rs
+++ b/src/channels.rs
@@ -74,14 +74,38 @@ impl Config {
pub(crate) fn with_mux_bits(&self, ch: ChannelSelection) -> Self {
use self::ChannelSelection as CS;
match ch {
- CS::DifferentialA0A1 => self.with_low( BF::MUX2).with_low( BF::MUX1).with_low( BF::MUX0),
- CS::DifferentialA0A3 => self.with_low( BF::MUX2).with_low( BF::MUX1).with_high(BF::MUX0),
- CS::DifferentialA1A3 => self.with_low( BF::MUX2).with_high(BF::MUX1).with_low( BF::MUX0),
- CS::DifferentialA2A3 => self.with_low( BF::MUX2).with_high(BF::MUX1).with_high(BF::MUX0),
- CS::SingleA0 => self.with_high(BF::MUX2).with_low( BF::MUX1).with_low( BF::MUX0),
- CS::SingleA1 => self.with_high(BF::MUX2).with_low( BF::MUX1).with_high(BF::MUX0),
- CS::SingleA2 => self.with_high(BF::MUX2).with_high(BF::MUX1).with_low( BF::MUX0),
- CS::SingleA3 => self.with_high(BF::MUX2).with_high(BF::MUX1).with_high(BF::MUX0),
+ CS::DifferentialA0A1 => self
+ .with_low(BF::MUX2)
+ .with_low(BF::MUX1)
+ .with_low(BF::MUX0),
+ CS::DifferentialA0A3 => self
+ .with_low(BF::MUX2)
+ .with_low(BF::MUX1)
+ .with_high(BF::MUX0),
+ CS::DifferentialA1A3 => self
+ .with_low(BF::MUX2)
+ .with_high(BF::MUX1)
+ .with_low(BF::MUX0),
+ CS::DifferentialA2A3 => self
+ .with_low(BF::MUX2)
+ .with_high(BF::MUX1)
+ .with_high(BF::MUX0),
+ CS::SingleA0 => self
+ .with_high(BF::MUX2)
+ .with_low(BF::MUX1)
+ .with_low(BF::MUX0),
+ CS::SingleA1 => self
+ .with_high(BF::MUX2)
+ .with_low(BF::MUX1)
+ .with_high(BF::MUX0),
+ CS::SingleA2 => self
+ .with_high(BF::MUX2)
+ .with_high(BF::MUX1)
+ .with_low(BF::MUX0),
+ CS::SingleA3 => self
+ .with_high(BF::MUX2)
+ .with_high(BF::MUX1)
+ .with_high(BF::MUX0),
}
}
}