use crate::hardware::mcp23017::Mcp23017; use anyhow::Result; pub trait Hardware { fn get_mcp23017_a(&self) -> impl Mcp23017; fn get_mcp23017_b(&self) -> impl Mcp23017; fn get_battery_voltage(&self) -> Result; } // impl Hardware for () { // fn get_i2c0_bus(&self) -> impl I2c { // panic!() // } // } #[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;