use bmi270::*; use linux_embedded_hal::spidev::{SpiModeFlags, SpidevOptions}; pub fn main() { let spi_conf = SpidevOptions::new() .bits_per_word(8) .max_speed_hz(10_000_000) .mode(SpiModeFlags::SPI_MODE_0) .build(); let mut spi = Spidev::open("/dev/spidev0.0").unwrap(); spi.configure(&spi_conf).unwrap(); let imu_conf = Bmi270Config::new() .acc( Bmi270AccOdr::Odr200Hz, Bmi270AccBwp::NormAvg4, Bmi270AccRange::Range8g, ) .gyr( Bmi270GyrOdr::Odr200Hz, Bmi270GyrBwp::Norm, Bmi270GyrRange::Range2000Dps, ); let mut imu = Bmi270::new(spi, imu_conf); loop { println!("{:?}", imu.acc_gyr()); } }