Common

Trait Common 

Source
pub trait Common<T: I2c> {
    // Required methods
    fn read_chip_id(&mut self) -> Result<u8, CustomError<T::Error>>;
    fn reset(&mut self) -> Result<(), CustomError<T::Error>>;

    // Provided method
    fn check_connection(&mut self) -> Result<(), CustomError<T::Error>> { ... }
}
Expand description

A trait representing common functionalities shared between BMP180 and InitializedBMP180.

Required Methods§

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.

Provided Methods§

Source

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

Tests the connection to the device.

It checks whether the device responds with the expected identifier 0x55.

Implementors§

Source§

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

Source§

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