Struct tsl256x::Tsl2561 [−][src]
pub struct Tsl2561<I2C> { /* fields omitted */ }
TSL2561 driver
Methods
impl<I2C, E> Tsl2561<I2C> where
I2C: WriteRead<Error = E> + Write<Error = E>,
[src]
impl<I2C, E> Tsl2561<I2C> where
I2C: WriteRead<Error = E> + Write<Error = E>,
pub fn new(_i2c: &I2C, address: u8) -> Result<Self, E>
[src]
pub fn new(_i2c: &I2C, address: u8) -> Result<Self, E>
Creates a new sensor driver associated with an I2C peripheral
Phantom I2C ensures whichever I2C bus the device was created on is the one that is used for all future interactions
pub fn power_on(&self, i2c: &mut I2C) -> Result<(), E>
[src]
pub fn power_on(&self, i2c: &mut I2C) -> Result<(), E>
Power on the device
Sensor readings are initialized to zero
Actual sensor readings are not available until one integration period has passed (default 400ms)
pub fn power_off(&self, i2c: &mut I2C) -> Result<(), E>
[src]
pub fn power_off(&self, i2c: &mut I2C) -> Result<(), E>
Power down the device
Sensor readings are initialized to zero
pub fn visible_and_ir_raw(&self, i2c: &mut I2C) -> Result<u16, E>
[src]
pub fn visible_and_ir_raw(&self, i2c: &mut I2C) -> Result<u16, E>
Raw value from channel 0 ADC measuring IR + Visible spectrum
pub fn ir_raw(&self, i2c: &mut I2C) -> Result<u16, E>
[src]
pub fn ir_raw(&self, i2c: &mut I2C) -> Result<u16, E>
Raw value from channel 1 ADC measuring IR spectrum only
pub fn config_time_gain(
&self,
i2c: &mut I2C,
integration_time: IntegrationTime,
gain: Gain
) -> Result<(), E>
[src]
pub fn config_time_gain(
&self,
i2c: &mut I2C,
integration_time: IntegrationTime,
gain: Gain
) -> Result<(), E>
Set the sensor integration time and gain
These settings share a register in the instrument so setting them both requires only a single write
Changes to these settings do not take effect until the next integration period