Move relay drivers from common to controller
This commit is contained in:
parent
e9ea0b625d
commit
340c4e9f15
9 changed files with 193 additions and 33 deletions
22
src/drivers/null.rs
Normal file
22
src/drivers/null.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
use crate::drivers::RelayDriver;
|
||||
use crate::errors::EmgauwaControllerError;
|
||||
|
||||
pub struct NullDriver {
|
||||
pub pin: u8,
|
||||
}
|
||||
|
||||
impl NullDriver {
|
||||
pub fn new(pin: u8) -> Self {
|
||||
Self { pin }
|
||||
}
|
||||
}
|
||||
|
||||
impl RelayDriver for NullDriver {
|
||||
fn set(&mut self, _value: bool) -> Result<(), EmgauwaControllerError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_inverted(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue