Move relay drivers from common to controller

This commit is contained in:
Tobias Reisinger 2024-05-05 23:46:38 +02:00
parent e9ea0b625d
commit 340c4e9f15
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
9 changed files with 193 additions and 33 deletions

22
src/drivers/null.rs Normal file
View 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
}
}