[−][src]Struct veml6040::Veml6040
VEML6040 device driver.
Implementations
impl<I2C, E> Veml6040<I2C> where
I2C: Write<Error = E>,
[src]
I2C: Write<Error = E>,
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]
&mut self,
it: IntegrationTime
) -> Result<(), Error<E>>
Set the integration time.
pub fn set_measurement_mode(
&mut self,
mode: MeasurementMode
) -> Result<(), Error<E>>
[src]
&mut self,
mode: MeasurementMode
) -> Result<(), Error<E>>
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]
I2C: WriteRead<Error = E>,
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]
I2C: Write<Error = E>,
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
Auto Trait Implementations
impl<I2C> RefUnwindSafe for Veml6040<I2C> where
I2C: RefUnwindSafe,
[src]
I2C: RefUnwindSafe,
impl<I2C> Send for Veml6040<I2C> where
I2C: Send,
[src]
I2C: Send,
impl<I2C> Sync for Veml6040<I2C> where
I2C: Sync,
[src]
I2C: Sync,
impl<I2C> Unpin for Veml6040<I2C> where
I2C: Unpin,
[src]
I2C: Unpin,
impl<I2C> UnwindSafe for Veml6040<I2C> where
I2C: UnwindSafe,
[src]
I2C: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,