use crate::hardware::mcp23017::Mcp23017; use crate::hardware::mct8316a::Mct8316a; use anyhow::Result; use embedded_hal::pwm::SetDutyCycle; pub trait Hardware { type Pwm: SetDutyCycle + Sync; fn new_mcp23017_a(&self) -> Result; fn new_mcp23017_b(&self) -> Result; fn new_pwm0(&self) -> Result; fn new_mct8316a(&self) -> Result; fn get_battery_voltage(&self) -> Result; } #[cfg(feature = "raspi")] mod raspi; #[cfg(feature = "raspi")] pub fn initialize() -> Result { raspi::RaspiHardware::new() } #[cfg(not(feature = "raspi"))] #[allow(unreachable_code)] pub fn initialize() -> Result { panic!("Can not Initialize"); Ok(()) } #[cfg(not(feature = "raspi"))] mod bno085; #[cfg(not(feature = "raspi"))] mod imu; mod error; pub mod mcp23017; mod mcp3208; pub mod channelization; pub(crate) mod mct8316a;