[][src]Struct veml6040::Veml6040

pub struct Veml6040<I2C> { /* fields omitted */ }

VEML6040 device driver.

Implementations

impl<I2C, E> Veml6040<I2C> where
    I2C: Write<Error = E>, 
[src]

pub fn enable(&mut self) -> Result<(), Error<E>>[src]

Enable the sensor.

pub fn disable(&mut self) -> Result<(), Error<E>>[src]

Disable the sensor (shutdown).

pub fn set_integration_time(
    &mut self,
    it: IntegrationTime
) -> Result<(), Error<E>>
[src]

Set the integration time.

pub fn set_measurement_mode(
    &mut self,
    mode: MeasurementMode
) -> Result<(), Error<E>>
[src]

Set the measurement mode: Auto/Manual.

pub fn trigger_measurement(&mut self) -> Result<(), Error<E>>[src]

Trigger a measurement when on Manual measurement mode.

This is not necessary on Auto measurement mode.

impl<I2C, E> Veml6040<I2C> where
    I2C: WriteRead<Error = E>, 
[src]

pub fn read_red_channel(&mut self) -> Result<u16, Error<E>>[src]

Read the red channel measurement data.

pub fn read_green_channel(&mut self) -> Result<u16, Error<E>>[src]

Read the green channel measurement data.

pub fn read_blue_channel(&mut self) -> Result<u16, Error<E>>[src]

Read the blue channel measurement data.

pub fn read_white_channel(&mut self) -> Result<u16, Error<E>>[src]

Read the white channel measurement data.

pub fn read_all_channels(&mut self) -> Result<AllChannelMeasurement, Error<E>>[src]

Read the measurement data of all channels at once.

impl<I2C, E> Veml6040<I2C> where
    I2C: Write<Error = E>, 
[src]

pub fn new(i2c: I2C) -> Self[src]

Create new instance of the VEML6040 device.

pub fn destroy(self) -> I2C[src]

Destroy driver instance, return I²C bus instance.

Trait Implementations

impl<I2C: Debug> Debug for Veml6040<I2C>[src]

impl<I2C: Default> Default for Veml6040<I2C>[src]

Auto Trait Implementations

impl<I2C> RefUnwindSafe for Veml6040<I2C> where
    I2C: RefUnwindSafe
[src]

impl<I2C> Send for Veml6040<I2C> where
    I2C: Send
[src]

impl<I2C> Sync for Veml6040<I2C> where
    I2C: Sync
[src]

impl<I2C> Unpin for Veml6040<I2C> where
    I2C: Unpin
[src]

impl<I2C> UnwindSafe for Veml6040<I2C> where
    I2C: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.