InitializedBMP180

Struct InitializedBMP180 

Source
pub struct InitializedBMP180<T, D> { /* private fields */ }
Expand description

Represents an initialized version of the sensor.

Implementations§

Source§

impl<T: I2c, D: DelayNs> InitializedBMP180<T, D>

Source

pub fn temperature(&mut self) -> Result<f32, CustomError<T::Error>>

Measures temperature.

Source

pub fn pressure( &mut self, resolution: Resolution, ) -> Result<i32, CustomError<T::Error>>

Measures pressure.

Source

pub fn altitude( &mut self, resolution: Resolution, ) -> Result<f32, CustomError<T::Error>>

Calculates altitude.

Source

pub fn read_all( &mut self, resolution: Resolution, ) -> Result<(f32, i32, f32), CustomError<T::Error>>

Reads all data including temperature, pressure, and altitude.

Trait Implementations§

Source§

impl<T: I2c, D: DelayNs> Common<T> for InitializedBMP180<T, D>

Source§

fn read_chip_id(&mut self) -> Result<u8, CustomError<T::Error>>

Reads the chip identifier.

The returned value is hardcoded by the manufacturer and should be equivalent to 0x55.

Source§

fn reset(&mut self) -> Result<(), CustomError<T::Error>>

Resets the device.

Source§

fn check_connection(&mut self) -> Result<(), CustomError<T::Error>>

Tests the connection to the device. Read more

Auto Trait Implementations§

§

impl<T, D> Freeze for InitializedBMP180<T, D>
where T: Freeze, D: Freeze,

§

impl<T, D> RefUnwindSafe for InitializedBMP180<T, D>

§

impl<T, D> Send for InitializedBMP180<T, D>
where T: Send, D: Send,

§

impl<T, D> Sync for InitializedBMP180<T, D>
where T: Sync, D: Sync,

§

impl<T, D> Unpin for InitializedBMP180<T, D>
where T: Unpin, D: Unpin,

§

impl<T, D> UnwindSafe for InitializedBMP180<T, D>
where T: UnwindSafe, D: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.