diff options
author | Diego Barrios Romero <eldruin@gmail.com> | 2019-03-30 13:36:06 +0200 |
---|---|---|
committer | Diego Barrios Romero <eldruin@gmail.com> | 2019-03-31 13:41:26 +0200 |
commit | 50223ad02e2f487540107e320c8bef40a9849582 (patch) | |
tree | 58b4e44e2261940d07aba96b8d8e83457e641f53 /src/channels.rs | |
parent | ab1221e175f2da577c7a3fb510b5ae5cf41b0697 (diff) | |
download | ads1x1x-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.rs | 40 |
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), } } } |