Initial rough-in of motor controller

This commit is contained in:
2024-08-17 15:10:06 -04:00
parent 3633f636c6
commit 3185746213
11 changed files with 653 additions and 62 deletions

View File

@ -0,0 +1,29 @@
/// Handles the actual hardware interface with motor or its controller.
use log::*; //{trace, debug, info, warn, error}
use anyhow::Result;
pub trait MotorDriver: Send + Sync {
fn start_up(&mut self) -> Result<()>;
fn start_down(&mut self) -> Result<()>;
fn stop(&mut self) -> Result<()>;
}
pub struct MotorDriverDebug {}
impl MotorDriver for MotorDriverDebug {
fn start_up(&mut self) -> Result<()> {
warn!("Starting motor, direction: Up");
Ok(())
}
fn start_down(&mut self) -> Result<()> {
warn!("Starting motor, direction: Down");
Ok(())
}
fn stop(&mut self) ->Result<()> {
warn!("Stopping motor");
Ok(())
}
}
//unsafe impl Send for MotorDriverDebug {}