initial work on bno085
This commit is contained in:
36
flight/src/hardware/raspi/mod.rs
Normal file
36
flight/src/hardware/raspi/mod.rs
Normal file
@@ -0,0 +1,36 @@
|
||||
use crate::hardware::Hardware;
|
||||
use anyhow::Result;
|
||||
use log::info;
|
||||
use rppal::gpio::Gpio;
|
||||
use rppal::spi::SimpleHalSpiDevice;
|
||||
|
||||
const CLOCK_3MHZ: u32 = 3_000_000;
|
||||
|
||||
pub struct RaspiHardware {
|
||||
gpio: Gpio,
|
||||
}
|
||||
|
||||
impl RaspiHardware {
|
||||
pub fn new() -> Result<Self> {
|
||||
let device = rppal::system::DeviceInfo::new()?;
|
||||
info!(
|
||||
"Running on Raspberry Pi Emulated Hardware Model {} with {}",
|
||||
device.model(),
|
||||
device.soc()
|
||||
);
|
||||
|
||||
Ok(Self {
|
||||
gpio: Gpio::new()?,
|
||||
// spi_bno085: Spi::new(
|
||||
// Bus::Spi1,
|
||||
// SlaveSelect::Ss0,
|
||||
// CLOCK_3MHZ,
|
||||
// Mode::Mode3,
|
||||
// )?
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl Hardware for RaspiHardware {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user