Skip to content

Commit fa124f6

Browse files
committed
Added a DummyPin that can be used if EN is run to GND.
1 parent eed7b0f commit fa124f6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
7575
extern crate embedded_hal as hal;
7676

77+
use core::convert::Infallible;
7778
use hal::digital::v2::OutputPin;
7879

7980
/// Provides an interface for setting the active channel
@@ -249,3 +250,16 @@ impl<Pins: Output> Multiplexer<Pins> {
249250
self.enabled = false;
250251
}
251252
}
253+
254+
/// A DummyPin for when you've got your EN (enable) pin run to GND
255+
/// (the analog multiplexer is always enabled)
256+
pub struct DummyPin;
257+
impl OutputPin for DummyPin {
258+
type Error = Infallible;
259+
fn set_low(&mut self) -> Result<(), Self::Error> {
260+
Ok(())
261+
}
262+
fn set_high(&mut self) -> Result<(), Self::Error> {
263+
Ok(())
264+
}
265+
}

0 commit comments

Comments
 (0)