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> { ... }
}
Available on crate feature async only.
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.

Object Safety§

This trait is not object safe.

Implementors§

source§

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

§

type Error = <SPI as ErrorType>::Error