[][src]Struct mlx9061x::Mlx9061x

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

MLX90614/MLX90615 device driver

Implementations

impl<E, I2C> Mlx9061x<I2C, Mlx90614> where
    I2C: WriteRead<Error = E> + Write<Error = E>, 
[src]

pub fn new_mlx90614(
    i2c: I2C,
    address: SlaveAddr,
    eeprom_write_delay_ms: u8
) -> Result<Self, Error<E>>
[src]

Create new instance of the MLX90614 device.

The slave address must match the address stored in the device EEPROM. To change it you need to connect first and then change it with set_address(). An invalid alternative slave address will return Error::InvalidInputData.

When writing to the EEPROM waiting a certain amount of time is necessary. This delay is configured through the eeprom_write_delay_ms parameter in milliseconds.

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

Read the ambient temperature in celsius degrees

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

Read the object 1 temperature in celsius degrees

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

Read the object 2 temperature in celsius degrees

Note that this is only available in dual-zone thermopile device variants.

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

Read the channel 1 raw IR data

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

Read the channel 2 raw IR data

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

Get emissivity epsilon

pub fn set_emissivity<D: DelayMs<u8>>(
    &mut self,
    epsilon: f32,
    delay: &mut D
) -> Result<(), Error<E>>
[src]

Set emissivity epsilon [0.1-1.0]

Wrong values will return Error::InvalidInputData.

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

Get the device ID

impl<E, I2C> Mlx9061x<I2C, Mlx90615> where
    I2C: WriteRead<Error = E> + Write<Error = E>, 
[src]

pub fn new_mlx90615(
    i2c: I2C,
    address: SlaveAddr,
    eeprom_write_delay_ms: u8
) -> Result<Self, Error<E>>
[src]

Create new instance of the MLX90615 device.

The slave address must match the address stored in the device EEPROM. To change it you need to connect first and then change it with set_address(). An invalid alternative slave address will return Error::InvalidInputData.

When writing to the EEPROM waiting a certain amount of time is necessary. This delay is configured through the eeprom_write_delay_ms parameter in milliseconds.

impl<E, I2C> Mlx9061x<I2C, Mlx90615> where
    I2C: WriteRead<Error = E> + Write<Error = E>, 
[src]

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

Read the ambient temperature in celsius degrees

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

Read the object temperature in celsius degrees

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

Read the raw IR data

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

Get emissivity epsilon

pub fn set_emissivity<D: DelayMs<u8>>(
    &mut self,
    epsilon: f32,
    delay: &mut D
) -> Result<(), Error<E>>
[src]

Set emissivity epsilon [0.0-1.0]

Wrong values will return Error::InvalidInputData.

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

Get the device ID

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

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

Destroy driver instance, return I²C bus and delay instance.

impl<E, I2C> Mlx9061x<I2C, Mlx90614> where
    I2C: WriteRead<Error = E> + Write<Error = E>, 
[src]

pub fn set_address<D: DelayMs<u8>>(
    &mut self,
    address: SlaveAddr,
    delay_ms: &mut D
) -> Result<(), Error<E>>
[src]

Change the device address

The address will be stored in the EEPROM. The address will be first cleared, before the new one is written. After each write the configured delay will be waited.

impl<E, I2C> Mlx9061x<I2C, Mlx90615> where
    I2C: WriteRead<Error = E> + Write<Error = E>, 
[src]

pub fn set_address<D: DelayMs<u8>>(
    &mut self,
    address: SlaveAddr,
    delay_ms: &mut D
) -> Result<(), Error<E>>
[src]

Change the device address

The address will be stored in the EEPROM. The address will be first cleared, before the new one is written. After each write the configured delay will be waited.

Trait Implementations

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

Auto Trait Implementations

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

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

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

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

impl<I2C, IC> UnwindSafe for Mlx9061x<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.