[][src]Struct ltr_559::Ltr559

pub struct Ltr559<I2C, IC> { /* fields omitted */ }

Ltr559 device driver

Implementations

impl<I2C> Ltr559<I2C, Ltr559>[src]

pub fn new_device(i2c: I2C, address: SlaveAddr) -> Self[src]

Create new instance of the device

impl<I2C, IC> Ltr559<I2C, IC>[src]

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

Destroy driver instance, return I²C bus instance.

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

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

Read the status of the conversion.

Note that the conversion ready flag is cleared automatically after calling this method.

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

pub fn set_als_contr(
    &mut self,
    als_gain: AlsGain,
    sw_reset: bool,
    als_active: bool
) -> Result<(), Error<E>>
[src]

Set ALS_CONTR Register

pub fn set_ps_contr(
    &mut self,
    ps_saturation_indicator_enable: bool,
    ps_active: bool
) -> Result<(), Error<E>>
[src]

Set PS_CONTR Register

pub fn set_ps_led(
    &mut self,
    led_pulse_freq: LedPulse,
    led_duty_cycle: LedDutyCycle,
    led_peak_current: LedCurrent
) -> Result<(), Error<E>>
[src]

Set PS LED controls

pub fn set_interrupt_persist(
    &mut self,
    als_count: AlsPersist,
    ps_count: PsPersist
) -> Result<(), Error<E>>
[src]

Set the fault count for both ALS and PS

pub fn set_als_meas_rate(
    &mut self,
    als_int: AlsIntTime,
    als_meas_rate: AlsMeasRate
) -> Result<(), Error<E>>
[src]

Set the integration (conversion) time and measurement repeat timer

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

Set the lux low limit in raw format

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

Set the lux low limit in raw format

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

Set the ps low limit in raw format

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

Set the ps low limit in raw format

pub fn set_ps_meas_rate(
    &mut self,
    ps_meas_rate: PsMeasRate
) -> Result<(), Error<E>>
[src]

Set PS Meas Rate

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

Set PS OFFSET.

Values that exceed 1023 will cause an Err to be returned

pub fn set_ps_n_pulses(&mut self, value: u8) -> Result<(), Error<E>>[src]

Set PS N Pulses

Accepted values are 1..16

pub fn set_interrupt(
    &mut self,
    polarity: InterruptPinPolarity,
    mode: InterruptMode
) -> Result<(), Error<E>>
[src]

Set Interrupt Polarity and Enable

impl<I2C, E, IC> Ltr559<I2C, IC> where
    I2C: WriteRead<Error = E>,
    IC: WithDeviceId, 
[src]

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

Read the manufacturer ID

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

Read the device part number and revision id

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

Get ALS Data in (als_ch0, als_ch1) format

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

Return calculated lux

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

Return PS Data in format (value, saturated)

impl<I2C, IC> Ltr559<I2C, IC>[src]

pub fn reset_internal_driver_state(&mut self)[src]

Reset the internal state of this driver to the default values.

Note: This does not alter the state or configuration of the device.

This resets the cached configuration register value in this driver to the power-up (reset) configuration of the device.

This needs to be called after performing a reset on the device, for example through an I2C general-call Reset command, which was not done through this driver to ensure that the configurations in the device and in the driver match.

Trait Implementations

impl<I2C: Debug, IC: Debug> Debug for Ltr559<I2C, IC>[src]

Auto Trait Implementations

impl<I2C, IC> RefUnwindSafe for Ltr559<I2C, IC> where
    I2C: RefUnwindSafe,
    IC: RefUnwindSafe

impl<I2C, IC> Send for Ltr559<I2C, IC> where
    I2C: Send,
    IC: Send

impl<I2C, IC> Sync for Ltr559<I2C, IC> where
    I2C: Sync,
    IC: Sync

impl<I2C, IC> Unpin for Ltr559<I2C, IC> where
    I2C: Unpin,
    IC: Unpin

impl<I2C, IC> UnwindSafe for Ltr559<I2C, IC> where
    I2C: UnwindSafe,
    IC: UnwindSafe

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.