Struct person_sensor::PersonSensorBuilder
source · pub struct PersonSensorBuilder<I2C, INT, MODE> { /* private fields */ }Expand description
Builder for the PersonSensor driver
Use this to create a new instance of the PersonSensor driver
Implementations§
source§impl<I2C> PersonSensorBuilder<I2C, (), ()>where
I2C: I2c,
impl<I2C> PersonSensorBuilder<I2C, (), ()>where
I2C: I2c,
sourcepub fn new_standby(i2c: I2C) -> PersonSensorBuilder<I2C, (), StandbyMode>
pub fn new_standby(i2c: I2C) -> PersonSensorBuilder<I2C, (), StandbyMode>
Create a new driver instance without an interrupt, initialized in standby mode
sourcepub fn new_continuous(
i2c: I2C,
) -> PersonSensorBuilder<I2C, (), ContinuousCaptureMode>
pub fn new_continuous( i2c: I2C, ) -> PersonSensorBuilder<I2C, (), ContinuousCaptureMode>
Create a new driver instance without an interrupt, initialized in continuous mode
source§impl<I2C, MODE> PersonSensorBuilder<I2C, (), MODE>where
I2C: I2c,
impl<I2C, MODE> PersonSensorBuilder<I2C, (), MODE>where
I2C: I2c,
sourcepub fn with_interrupt<INT: Wait>(
self,
interrupt: INT,
) -> PersonSensorBuilder<I2C, INT, MODE>
pub fn with_interrupt<INT: Wait>( self, interrupt: INT, ) -> PersonSensorBuilder<I2C, INT, MODE>
Sets an interrupt pin
source§impl<I2C, INT> PersonSensorBuilder<I2C, INT, ContinuousCaptureMode>where
I2C: I2c,
impl<I2C, INT> PersonSensorBuilder<I2C, INT, ContinuousCaptureMode>where
I2C: I2c,
sourcepub async fn build(
self,
) -> Result<PersonSensor<I2C, INT, ContinuousCaptureMode>, I2C::Error>
pub async fn build( self, ) -> Result<PersonSensor<I2C, INT, ContinuousCaptureMode>, I2C::Error>
Initialize the sensor in continuous mode
source§impl<I2C, INT> PersonSensorBuilder<I2C, INT, StandbyMode>where
I2C: I2c,
impl<I2C, INT> PersonSensorBuilder<I2C, INT, StandbyMode>where
I2C: I2c,
sourcepub async fn build(
self,
) -> Result<PersonSensor<I2C, INT, StandbyMode>, I2C::Error>
pub async fn build( self, ) -> Result<PersonSensor<I2C, INT, StandbyMode>, I2C::Error>
Initialize the sensor in standby mode
Auto Trait Implementations§
impl<I2C, INT, MODE> Freeze for PersonSensorBuilder<I2C, INT, MODE>
impl<I2C, INT, MODE> RefUnwindSafe for PersonSensorBuilder<I2C, INT, MODE>
impl<I2C, INT, MODE> Send for PersonSensorBuilder<I2C, INT, MODE>
impl<I2C, INT, MODE> Sync for PersonSensorBuilder<I2C, INT, MODE>
impl<I2C, INT, MODE> Unpin for PersonSensorBuilder<I2C, INT, MODE>
impl<I2C, INT, MODE> UnwindSafe for PersonSensorBuilder<I2C, INT, MODE>
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