Trait Bme280BusAsync

Source
pub trait Bme280BusAsync {
    type Error;

    // Required methods
    async fn read_regs(
        &mut self,
        reg: u8,
        buf: &mut [u8],
    ) -> Result<(), Self::Error>;
    async fn write_reg(&mut self, reg: u8, data: u8) -> Result<(), Self::Error>;

    // Provided method
    async fn calibration(&mut self) -> Result<Calibration, Self::Error> { ... }
}
Expand description

Asynchronous BME280 bus.

Required Associated Types§

Source

type Error

BME280 bus error.

Required Methods§

Source

async fn read_regs( &mut self, reg: u8, buf: &mut [u8], ) -> Result<(), Self::Error>

Read from the BME280.

See Bme280Bus::read_regs for more information.

Source

async fn write_reg(&mut self, reg: u8, data: u8) -> Result<(), Self::Error>

Write a single register to the BME280.

See Bme280Bus::write_reg for more information.

Provided Methods§

Source

async fn calibration(&mut self) -> Result<Calibration, Self::Error>

Read the calibration from the chip.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<SPI> Bme280BusAsync for Bme280Bus<SPI>
where SPI: SpiDevice,

Source§

type Error = <SPI as ErrorType>::Error