Rename Bme680_dev struct to Bme680

This commit is contained in:
marcelbuesing 2018-05-31 12:13:36 +02:00
parent 650db10d69
commit 833f892e6b
No known key found for this signature in database
GPG key ID: E51C4F8A2B7FF43E
2 changed files with 7 additions and 7 deletions

View file

@ -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)

View file

@ -319,7 +319,7 @@ impl I2CUtil {
/// Driver for the BME680 environmental sensor
#[repr(C)]
pub struct Bme680_dev<I2C, D> {
pub struct Bme680<I2C, D> {
i2c: I2C,
delay: D,
dev_id: I2CAddress,
@ -357,7 +357,7 @@ where
Ok(value)
}
impl<I2C, D> Bme680_dev<I2C, D>
impl<I2C, D> Bme680<I2C, D>
where
D: DelayMs<u8>,
I2C: Read + Write,
@ -380,8 +380,8 @@ where
mut i2c: I2C,
mut delay: D,
dev_id: I2CAddress,
) -> Result<Bme680_dev<I2C, D>, <I2C as Read>::Error, <I2C as Write>::Error> {
Bme680_dev::soft_reset(&mut i2c, &mut delay, dev_id)?;
) -> Result<Bme680<I2C, D>, <I2C as Read>::Error, <I2C as Write>::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::<I2C, D>::get_calib_data::<I2C>(&mut i2c, dev_id)?;
let calib = Bme680::<I2C, D>::get_calib_data::<I2C>(&mut i2c, dev_id)?;
debug!("Calib data {:?}", calib);
let dev = Bme680_dev {
let dev = Bme680 {
i2c: i2c,
delay: delay,
dev_id: dev_id,