pub struct Mlx9061x<I2C, IC> { /* private fields */ }
Expand description
MLX90614/MLX90615 device driver
Implementations§
source§impl<E, I2C> Mlx9061x<I2C, Mlx90614>where
I2C: WriteRead<Error = E> + Write<Error = E>,
impl<E, I2C> Mlx9061x<I2C, Mlx90614>where I2C: WriteRead<Error = E> + Write<Error = E>,
sourcepub fn new_mlx90614(
i2c: I2C,
address: SlaveAddr,
eeprom_write_delay_ms: u8
) -> Result<Self, Error<E>>
pub fn new_mlx90614( i2c: I2C, address: SlaveAddr, eeprom_write_delay_ms: u8 ) -> Result<Self, Error<E>>
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.
sourcepub fn ambient_temperature(&mut self) -> Result<f32, Error<E>>
pub fn ambient_temperature(&mut self) -> Result<f32, Error<E>>
Read the ambient temperature in celsius degrees
sourcepub fn ambient_temperature_as_int(&mut self) -> Result<u16, Error<E>>
pub fn ambient_temperature_as_int(&mut self) -> Result<u16, Error<E>>
Read the ambient temperature in celsius degrees as u16 value
Note ONLY use to avoid floating-point ops, as this gives less accurate
temperature readings compared to using ambient_temperature()
.
sourcepub fn object1_temperature(&mut self) -> Result<f32, Error<E>>
pub fn object1_temperature(&mut self) -> Result<f32, Error<E>>
Read the object 1 temperature in celsius degrees
sourcepub fn object1_temperature_as_int(&mut self) -> Result<u16, Error<E>>
pub fn object1_temperature_as_int(&mut self) -> Result<u16, Error<E>>
Read the object 1 temperature in celsius degrees as u16 value
Note ONLY use to avoid floating-point ops, as this gives less accurate
temperature readings compared to using object1_temperature()
.
sourcepub fn object2_temperature(&mut self) -> Result<f32, Error<E>>
pub fn object2_temperature(&mut self) -> Result<f32, Error<E>>
Read the object 2 temperature in celsius degrees
Note that this is only available in dual-zone thermopile device variants.
sourcepub fn object2_temperature_as_int(&mut self) -> Result<u16, Error<E>>
pub fn object2_temperature_as_int(&mut self) -> Result<u16, Error<E>>
Read the object 2 temperature in celsius degrees as u16 value
Note that this is only available in dual-zone thermopile device variants.
Note ONLY use to avoid floating-point ops, as this gives less accurate
temperature readings compared to using object2_temperature()
.
sourcepub fn raw_ir_channel1(&mut self) -> Result<u16, Error<E>>
pub fn raw_ir_channel1(&mut self) -> Result<u16, Error<E>>
Read the channel 1 raw IR data
sourcepub fn raw_ir_channel2(&mut self) -> Result<u16, Error<E>>
pub fn raw_ir_channel2(&mut self) -> Result<u16, Error<E>>
Read the channel 2 raw IR data
sourcepub fn emissivity(&mut self) -> Result<f32, Error<E>>
pub fn emissivity(&mut self) -> Result<f32, Error<E>>
Get emissivity epsilon
source§impl<E, I2C> Mlx9061x<I2C, Mlx90615>where
I2C: WriteRead<Error = E> + Write<Error = E>,
impl<E, I2C> Mlx9061x<I2C, Mlx90615>where I2C: WriteRead<Error = E> + Write<Error = E>,
sourcepub fn new_mlx90615(
i2c: I2C,
address: SlaveAddr,
eeprom_write_delay_ms: u8
) -> Result<Self, Error<E>>
pub fn new_mlx90615( i2c: I2C, address: SlaveAddr, eeprom_write_delay_ms: u8 ) -> Result<Self, Error<E>>
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.
source§impl<E, I2C> Mlx9061x<I2C, Mlx90615>where
I2C: WriteRead<Error = E> + Write<Error = E>,
impl<E, I2C> Mlx9061x<I2C, Mlx90615>where I2C: WriteRead<Error = E> + Write<Error = E>,
sourcepub fn ambient_temperature(&mut self) -> Result<f32, Error<E>>
pub fn ambient_temperature(&mut self) -> Result<f32, Error<E>>
Read the ambient temperature in celsius degrees
sourcepub fn ambient_temperature_as_int(&mut self) -> Result<u16, Error<E>>
pub fn ambient_temperature_as_int(&mut self) -> Result<u16, Error<E>>
Read the ambient temperature in celsius degrees as u16 value
Note ONLY use to avoid floating-point ops, as this gives less accurate
temperature readings compared to using ambient_temperature()
.
sourcepub fn object_temperature(&mut self) -> Result<f32, Error<E>>
pub fn object_temperature(&mut self) -> Result<f32, Error<E>>
Read the object temperature in celsius degrees
sourcepub fn object_temperature_as_int(&mut self) -> Result<u16, Error<E>>
pub fn object_temperature_as_int(&mut self) -> Result<u16, Error<E>>
Read the object temperature in celsius degrees
Note ONLY use to avoid floating-point ops, as this gives less accurate
temperature readings compared to using object_temperature()
.
sourcepub fn emissivity(&mut self) -> Result<f32, Error<E>>
pub fn emissivity(&mut self) -> Result<f32, Error<E>>
Get emissivity epsilon
source§impl<E, I2C> Mlx9061x<I2C, Mlx90614>where
I2C: WriteRead<Error = E> + Write<Error = E>,
impl<E, I2C> Mlx9061x<I2C, Mlx90614>where I2C: WriteRead<Error = E> + Write<Error = E>,
sourcepub fn set_address<D: DelayMs<u8>>(
&mut self,
address: SlaveAddr,
delay_ms: &mut D
) -> Result<(), Error<E>>
pub fn set_address<D: DelayMs<u8>>( &mut self, address: SlaveAddr, delay_ms: &mut D ) -> Result<(), Error<E>>
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 except the last time.
source§impl<E, I2C> Mlx9061x<I2C, Mlx90615>where
I2C: WriteRead<Error = E> + Write<Error = E>,
impl<E, I2C> Mlx9061x<I2C, Mlx90615>where I2C: WriteRead<Error = E> + Write<Error = E>,
sourcepub fn set_address<D: DelayMs<u8>>(
&mut self,
address: SlaveAddr,
delay_ms: &mut D
) -> Result<(), Error<E>>
pub fn set_address<D: DelayMs<u8>>( &mut self, address: SlaveAddr, delay_ms: &mut D ) -> Result<(), Error<E>>
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 except the last time.