pub struct BMP180<T, D> { /* private fields */ }Expand description
Represents an uninitialized version of the sensor.
Implementations§
Source§impl<T: I2c, D: DelayNs> BMP180<T, D>
impl<T: I2c, D: DelayNs> BMP180<T, D>
Sourcepub fn initialize(
self,
) -> Result<InitializedBMP180<T, D>, CustomError<T::Error>>
pub fn initialize( self, ) -> Result<InitializedBMP180<T, D>, CustomError<T::Error>>
Initializes the BMP180 sensor.
Sourcepub fn set_address(&mut self, address: u8)
pub fn set_address(&mut self, address: u8)
Sets the I2C address of the sensor.
Sourcepub fn write_and_read_exact_bytes<const BYTES: usize>(
&mut self,
command: &[u8],
) -> Result<[u8; BYTES], CustomError<T::Error>>
pub fn write_and_read_exact_bytes<const BYTES: usize>( &mut self, command: &[u8], ) -> Result<[u8; BYTES], CustomError<T::Error>>
Writes data to the sensor and reads back exactly the specified number of bytes.
Sourcepub fn write_and_read_range(
&mut self,
command: &[u8],
buffer: &mut [u8],
) -> Result<(), CustomError<T::Error>>
pub fn write_and_read_range( &mut self, command: &[u8], buffer: &mut [u8], ) -> Result<(), CustomError<T::Error>>
Writes data to the sensor and reads back a range of bytes.
Sourcepub fn write_and_read_single_byte(
&mut self,
command: &[u8],
) -> Result<u8, CustomError<T::Error>>
pub fn write_and_read_single_byte( &mut self, command: &[u8], ) -> Result<u8, CustomError<T::Error>>
Write and read a single byte back.
Trait Implementations§
Source§impl<T: I2c, D: DelayNs> Common<T> for BMP180<T, D>
impl<T: I2c, D: DelayNs> Common<T> for BMP180<T, D>
Source§fn 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.
Source§fn check_connection(&mut self) -> Result<(), CustomError<T::Error>>
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 BMP180<T, D>
impl<T, D> RefUnwindSafe for BMP180<T, D>where
T: RefUnwindSafe,
D: RefUnwindSafe,
impl<T, D> Send for BMP180<T, D>
impl<T, D> Sync for BMP180<T, D>
impl<T, D> Unpin for BMP180<T, D>
impl<T, D> UnwindSafe for BMP180<T, D>where
T: UnwindSafe,
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more