[−][src]Struct isl29125::Isl29125
ISL29125 device driver
Methods
impl<I2C> Isl29125<I2C>
[src]
pub fn new(i2c: I2C) -> Self
[src]
Create new instance of the device.
pub fn destroy(self) -> I2C
[src]
Destroy driver instance, return I2C bus.
impl<I2C, E> Isl29125<I2C> where
I2C: WriteRead<Error = E> + Write<Error = E>,
[src]
I2C: WriteRead<Error = E> + Write<Error = E>,
pub fn read(&mut self) -> Result<Measurement, Error<E>>
[src]
Read all colors
pub fn red(&mut self) -> Result<u16, Error<E>>
[src]
Read red color
pub fn green(&mut self) -> Result<u16, Error<E>>
[src]
Read green color
pub fn blue(&mut self) -> Result<u16, Error<E>>
[src]
Read blue color
pub fn set_operating_mode(
&mut self,
mode: OperatingMode
) -> Result<(), Error<E>>
[src]
&mut self,
mode: OperatingMode
) -> Result<(), Error<E>>
Set operating mode
pub fn set_resolution(&mut self, resolution: Resolution) -> Result<(), Error<E>>
[src]
Set ADC resolution
pub fn set_range(&mut self, range: Range) -> Result<(), Error<E>>
[src]
Set RGB data sensing range
pub fn set_ir_filtering(
&mut self,
range: IRFilteringRange
) -> Result<(), Error<E>>
[src]
&mut self,
range: IRFilteringRange
) -> Result<(), Error<E>>
Set IR filtering
The IR adjust value must be in the range [0-63]
. Providing a
value outside this range will return Error::InvalidInputData
.
pub fn set_interrupt_pin_mode(
&mut self,
mode: InterruptPinMode
) -> Result<(), Error<E>>
[src]
&mut self,
mode: InterruptPinMode
) -> Result<(), Error<E>>
Set interrupt pin (INT) mode (Interrupt / Synced conversion start)
pub fn set_interrupt_threshold_assignment(
&mut self,
assignment: InterruptThresholdAssignment
) -> Result<(), Error<E>>
[src]
&mut self,
assignment: InterruptThresholdAssignment
) -> Result<(), Error<E>>
Set color channel used for threshold value interrupt generation
pub fn set_fault_count(
&mut self,
fault_count: FaultCount
) -> Result<(), Error<E>>
[src]
&mut self,
fault_count: FaultCount
) -> Result<(), Error<E>>
Set number of consecutive fault events necessary to trigger an interrupt. This is referred to as "persistence" in the documentation.
pub fn enable_interrupt_on_conversion_done(&mut self) -> Result<(), Error<E>>
[src]
Enable generating an interrupt after a conversion is done
pub fn disable_interrupt_on_conversion_done(&mut self) -> Result<(), Error<E>>
[src]
Disable generating an interrupt after a conversion is done
pub fn set_interrupt_thresholds(
&mut self,
low: u16,
high: u16
) -> Result<(), Error<E>>
[src]
&mut self,
low: u16,
high: u16
) -> Result<(), Error<E>>
Set interrupt thresholds
pub fn status(&mut self) -> Result<Status, Error<E>>
[src]
Read the status
This clears the both the INT output and the interrupt triggered status flag.
pub fn clear_status(&mut self) -> Result<(), Error<E>>
[src]
Clear the status.
This must be called after power-up to clear the brownout condition flag.
pub fn device_id(&mut self) -> Result<u8, Error<E>>
[src]
Get device ID (0x7D
)
pub fn reset(&mut self) -> Result<(), Error<E>>
[src]
Software reset
Trait Implementations
Auto Trait Implementations
impl<I2C> RefUnwindSafe for Isl29125<I2C> where
I2C: RefUnwindSafe,
I2C: RefUnwindSafe,
impl<I2C> Send for Isl29125<I2C> where
I2C: Send,
I2C: Send,
impl<I2C> Sync for Isl29125<I2C> where
I2C: Sync,
I2C: Sync,
impl<I2C> Unpin for Isl29125<I2C> where
I2C: Unpin,
I2C: Unpin,
impl<I2C> UnwindSafe for Isl29125<I2C> where
I2C: UnwindSafe,
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,
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.
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>,