Struct esp_ward::peripherals::tsl2591::Tsl2591Sensor

source ·
pub struct Tsl2591Sensor {
    pub inner: Driver<I2C<'static, I2C0>>,
    pub delay: Delay,
}
Expand description

Represents a TSL2591 ambient light sensor.

Fields§

§inner: Driver<I2C<'static, I2C0>>

The internal TSL2591 driver instance.

§delay: Delay

Delay provider for timing-sensitive operations.

Trait Implementations§

source§

impl I2cPeriph for Tsl2591Sensor

source§

fn create_on_i2c( bus: I2C<'static, I2C0>, delay: Delay ) -> Result<Self::Returnable, PeripheralError>

Initializes the TSL2591 sensor over the I2C bus.

This function configures the sensor and enables it for ambient light measurements.

§Arguments
  • bus - The I2C bus instance to communicate with the sensor.
  • delay - A delay provider for timing-sensitive operations during initialization.
§Returns

A result containing the initialized Tsl2591Sensor or an error of type PeripheralError if initialization fails.

§

type Returnable = Tsl2591Sensor

source§

impl LumiSensor for Tsl2591Sensor

source§

fn get_lux(&mut self) -> Result<f32, PeripheralError>

Measures the ambient light intensity.

§Returns

A result containing the light intensity in lux if successful, or an error of type PeripheralError if the measurement fails.

source§

impl UnifiedData for Tsl2591Sensor

source§

fn read(&mut self, _delay: Delay) -> Result<f32, PeripheralError>

Measures the ambient light intensity.

§Returns

A result containing the light intensity in lux if successful, or an error of type PeripheralError if the measurement fails.

§

type Output = f32

Auto Trait Implementations§

§

impl Freeze for Tsl2591Sensor

§

impl RefUnwindSafe for Tsl2591Sensor

§

impl Send for Tsl2591Sensor

§

impl Sync for Tsl2591Sensor

§

impl Unpin for Tsl2591Sensor

§

impl !UnwindSafe for Tsl2591Sensor

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.