M5Unit-THERMO 0.4.0 git rev:7cce598
Loading...
Searching...
No Matches
unit_MLX90614_data.hpp File Reference

MLX90614 data types (enums, Data struct, register fields, conversions) More...

#include <array>
#include <cmath>
#include <cstdint>
#include <limits>
#include <m5_utility/stl/extension.hpp>

Go to the source code of this file.

Classes

struct  m5::unit::mlx90614::Data
 Measurement data group. More...
 
struct  m5::unit::mlx90614::EEPROM
 EEPROM structure values. More...
 
struct  m5::unit::mlx90614::ConfigRegister
 Config Register1 (EEPROM 0x05, command 0x25) bit fields. More...
 

Namespaces

namespace  m5
 Top level namespace of M5stack.
 
namespace  mlx90614
 For mlx90614.
 

Enumerations

enum class  m5::unit::mlx90614::Output : uint8_t { TA_TO1 , TA_TO2 , TO2_Undefined , TO1_TO2 }
 PWM output mode. More...
 
enum class  m5::unit::mlx90614::IIR : uint8_t {
  Filter50 , Filter25 , Filter17 , Filter13 ,
  Filter100 , Filter80 , Filter67 , Filter57
}
 Infinite Impulse Response. More...
 
enum class  m5::unit::mlx90614::FIR : uint8_t {
  Filter8 , Filter16 , Filter32 , Filter64 ,
  Filter128 , Filter256 , Filter512 , Filter1024
}
 Finite Impulse Response. More...
 
enum class  m5::unit::mlx90614::Gain : uint8_t {
  Coeff1 , Coeff3 , Coeff6 , Coeff12_5 ,
  Coeff25 , Coeff50 , Coeff100
}
 Amplifier gain. More...
 
enum class  m5::unit::mlx90614::IRSensor : uint8_t { Single , Dual }
 Infra-Red Sensor mode. More...
 

Functions

float m5::unit::mlx90614::toRaw_to_celsius (const uint16_t t)
 Object temperature range raw (ToMin / ToMax) to Celsius.
 
uint16_t m5::unit::mlx90614::celsius_to_toRaw (const float c)
 Celsius to object temperature range raw (ToMin / ToMax)
 
float m5::unit::mlx90614::taRaw_to_celsius (const uint8_t t)
 Ambient temperature range raw (one byte of TaRange) to Celsius.
 
uint8_t m5::unit::mlx90614::celsius_to_taRaw (const float c)
 Celsius to ambient temperature range raw (one byte of TaRange)
 
float m5::unit::mlx90614::raw_to_emissivity (const uint16_t e)
 Emissivity raw to emissivity.
 
uint16_t m5::unit::mlx90614::emissivity_to_raw (const float e)
 Emissivity to emissivity raw.
 

Detailed Description

MLX90614 data types (enums, Data struct, register fields, conversions)

Kept apart from unit_MLX90614.hpp so the native (host) tests can include it without pulling in M5UnitComponent.

Enumeration Type Documentation

◆ FIR

enum class m5::unit::mlx90614::FIR : uint8_t
strong

Finite Impulse Response.

Enumerator
Filter8 

8 Not recommended

Filter16 

16 Not recommended

Filter32 

32 Not recommended

Filter64 

64 Not recommended

Filter128 

128

Filter256 

256

Filter512 

512

Filter1024 

1024

◆ Gain

enum class m5::unit::mlx90614::Gain : uint8_t
strong

Amplifier gain.

Enumerator
Coeff1 

Bypassed.

Coeff3 

3

Coeff6 

6

Coeff12_5 

12.5

Coeff25 

25

Coeff50 

50

Coeff100 

100

◆ IIR

enum class m5::unit::mlx90614::IIR : uint8_t
strong

Infinite Impulse Response.

Enumerator
Filter50 

50% (a1 = 0.5, b1 = 0.5)

Filter25 

25% (a1 = 0.25, b1 = 0.75)

Filter17 

17% (a1 = 0.166(6), b1 = 0.833(3))

Filter13 

13% (a1 = 0.125, b1 = 0.875)

Filter100 

100% (a1 = 1, b1 = 0)

Filter80 

80% (a1 = 0.8, b1 = 0.2)

Filter67 

67% (a1 = 0.666, b1 = 0.333)

Filter57 

57% (a1 = 0.571, b1 = 0.428)

◆ IRSensor

enum class m5::unit::mlx90614::IRSensor : uint8_t
strong

Infra-Red Sensor mode.

Enumerator
Single 

Single IR Sensor.

Dual 

Dual IR Sensor.

◆ Output

enum class m5::unit::mlx90614::Output : uint8_t
strong

PWM output mode.

Enumerator
TA_TO1 

PWM1: Ta PWM2:To1 (Ambient & Object 1)

TA_TO2 

PWM1: Ta PWM2:To2 (Ambient & Object 2)

TO2_Undefined 

PWM1: To2 PWM2:Undefined (Object 2)

TO1_TO2 

PWM1: To1 PWM2:To2 (Object 1 & 2)

Function Documentation

◆ celsius_to_taRaw()

uint8_t m5::unit::mlx90614::celsius_to_taRaw ( const float c)
inline

Celsius to ambient temperature range raw (one byte of TaRange)

Parameters
cCelsius (clamped to -38.2 - 125.0)
Returns
Raw value (0.64 °C/LSB, offset -38.2 °C)

◆ celsius_to_toRaw()

uint16_t m5::unit::mlx90614::celsius_to_toRaw ( const float c)
inline

Celsius to object temperature range raw (ToMin / ToMax)

Parameters
cCelsius (clamped to -273.15 - 382.2)
Returns
Raw value (0.01 K/LSB)

◆ emissivity_to_raw()

uint16_t m5::unit::mlx90614::emissivity_to_raw ( const float e)
inline

Emissivity to emissivity raw.

Parameters
eEmissivity (0.0 - 1.0, not clamped; the caller must validate it)
Returns
Raw value

◆ raw_to_emissivity()

float m5::unit::mlx90614::raw_to_emissivity ( const uint16_t e)
inline

Emissivity raw to emissivity.

Parameters
eRaw value
Returns
Emissivity (0.0 - 1.0)

◆ taRaw_to_celsius()

float m5::unit::mlx90614::taRaw_to_celsius ( const uint8_t t)
inline

Ambient temperature range raw (one byte of TaRange) to Celsius.

Parameters
tRaw value (0.64 °C/LSB, offset -38.2 °C)
Returns
Celsius

◆ toRaw_to_celsius()

float m5::unit::mlx90614::toRaw_to_celsius ( const uint16_t t)
inline

Object temperature range raw (ToMin / ToMax) to Celsius.

Parameters
tRaw value (0.01 K/LSB)
Returns
Celsius