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§
Sourcefn read_chip_id(&mut self) -> Result<u8, CustomError<T::Error>>
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.
Provided Methods§
Sourcefn check_connection(&mut self) -> Result<(), CustomError<T::Error>>
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.