diff --git a/examples/reading_temperature.rs b/examples/reading_temperature.rs index 40ac605..8b76ae7 100644 --- a/examples/reading_temperature.rs +++ b/examples/reading_temperature.rs @@ -19,7 +19,7 @@ fn main( let i2c = I2cdev::new("/dev/i2c-1").unwrap(); - let mut dev = Bme680_dev::init(i2c, Delay {}, I2CAddress::Primary)?; + let mut dev = Bme680::init(i2c, Delay {}, I2CAddress::Primary)?; let settings = SettingsBuilder::new() .with_humidity_oversampling(OversamplingSetting::OS2x) diff --git a/src/lib.rs b/src/lib.rs index 17291a7..72f9926 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -319,7 +319,7 @@ impl I2CUtil { /// Driver for the BME680 environmental sensor #[repr(C)] -pub struct Bme680_dev { +pub struct Bme680 { i2c: I2C, delay: D, dev_id: I2CAddress, @@ -357,7 +357,7 @@ where Ok(value) } -impl Bme680_dev +impl Bme680 where D: DelayMs, I2C: Read + Write, @@ -380,8 +380,8 @@ where mut i2c: I2C, mut delay: D, dev_id: I2CAddress, - ) -> Result, ::Error, ::Error> { - Bme680_dev::soft_reset(&mut i2c, &mut delay, dev_id)?; + ) -> Result, ::Error, ::Error> { + Bme680::soft_reset(&mut i2c, &mut delay, dev_id)?; debug!("Reading chip id"); /* Soft reset to restore it to default values*/ @@ -390,9 +390,9 @@ where if chip_id == BME680_CHIP_ID { debug!("Reading calib data"); - let calib = Bme680_dev::::get_calib_data::(&mut i2c, dev_id)?; + let calib = Bme680::::get_calib_data::(&mut i2c, dev_id)?; debug!("Calib data {:?}", calib); - let dev = Bme680_dev { + let dev = Bme680 { i2c: i2c, delay: delay, dev_id: dev_id,