17 #ifndef _ADAFRUIT_MLX90640_H 18 #define _ADAFRUIT_MLX90640_H 21 #include "headers/MLX90640_API.h" 22 #include <Adafruit_I2CDevice.h> 25 #define MLX90640_I2CADDR_DEFAULT 0x33 27 #define MLX90640_DEVICEID1 0x2407 55 #define OPENAIR_TA_SHIFT 8 65 TwoWire *wire = &Wire);
76 float getTa(
bool newFrame =
true);
81 int MLX90640_I2CRead(uint8_t slaveAddr, uint16_t startAddress,
82 uint16_t nMemAddressRead, uint16_t *data);
83 int MLX90640_I2CWrite(uint8_t slaveAddr, uint16_t writeAddress,
86 Adafruit_I2CDevice *i2c_dev;
87 paramsMLX90640 _params;
90 int MLX90640_DumpEE(uint8_t slaveAddr, uint16_t *eeData);
91 int MLX90640_GetFrameData(uint8_t slaveAddr, uint16_t *frameData);
92 int MLX90640_ExtractParameters(uint16_t *eeData, paramsMLX90640 *mlx90640);
93 float MLX90640_GetVdd(uint16_t *frameData,
const paramsMLX90640 *params);
94 float MLX90640_GetTa(uint16_t *frameData,
const paramsMLX90640 *params);
95 void MLX90640_GetImage(uint16_t *frameData,
const paramsMLX90640 *params,
97 void MLX90640_CalculateTo(uint16_t *frameData,
const paramsMLX90640 *params,
98 float emissivity,
float tr,
float *result);
99 int MLX90640_SetResolution(uint8_t slaveAddr, uint8_t resolution);
100 int MLX90640_GetCurResolution(uint8_t slaveAddr);
101 int MLX90640_SetRefreshRate(uint8_t slaveAddr, uint8_t refreshRate);
102 int MLX90640_GetRefreshRate(uint8_t slaveAddr);
103 int MLX90640_GetSubPageNumber(uint16_t *frameData);
104 int MLX90640_GetCurMode(uint8_t slaveAddr);
105 int MLX90640_SetInterleavedMode(uint8_t slaveAddr);
106 int MLX90640_SetChessMode(uint8_t slaveAddr);
107 void MLX90640_BadPixelsCorrection(uint16_t *pixels,
float *to,
int mode,
108 paramsMLX90640 *params);
int getFrame(float *framebuf)
Read 2 pages, calculate temperatures and place into framebuf.
Definition: Adafruit_MLX90640.cpp:167
#define MLX90640_I2CADDR_DEFAULT
I2C address by default.
Definition: Adafruit_MLX90640.h:25
mlx90640_res
Definition: Adafruit_MLX90640.h:36
mlx90640_resolution_t getResolution(void)
Get resolution for temperature precision.
Definition: Adafruit_MLX90640.cpp:132
void setRefreshRate(mlx90640_refreshrate_t res)
Set max refresh rate - too fast and we can't read the the pages in time, start low and then increment...
Definition: Adafruit_MLX90640.cpp:158
uint16_t serialNumber[3]
Unique serial number read from device.
Definition: Adafruit_MLX90640.h:78
void setMode(mlx90640_mode_t mode)
Set the frame-read mode.
Definition: Adafruit_MLX90640.cpp:120
enum mlx90640_res mlx90640_resolution_t
mlx90640_mode_t getMode(void)
Get the frame-read mode.
Definition: Adafruit_MLX90640.cpp:112
enum mlx90640_refreshrate mlx90640_refreshrate_t
boolean begin(uint8_t i2c_addr=MLX90640_I2CADDR_DEFAULT, TwoWire *wire=&Wire)
Sets up the hardware and initializes I2C.
Definition: Adafruit_MLX90640.cpp:16
Read data from camera by interleaved lines.
Definition: Adafruit_MLX90640.h:31
enum mlx90640_mode mlx90640_mode_t
float getTa(bool newFrame=true)
Return ambient temperature of the TO39 package.
Definition: Adafruit_MLX90640.cpp:206
mlx90640_refreshrate
Definition: Adafruit_MLX90640.h:44
Read data from camera in alternating pixels.
Definition: Adafruit_MLX90640.h:32
mlx90640_refreshrate_t getRefreshRate(void)
Get max refresh rate.
Definition: Adafruit_MLX90640.cpp:148
mlx90640_mode
Definition: Adafruit_MLX90640.h:30
Adafruit_MLX90640()
Instantiates a new MLX90640 class.
Definition: Adafruit_MLX90640.cpp:6
void setResolution(mlx90640_resolution_t res)
Set resolution for temperature precision.
Definition: Adafruit_MLX90640.cpp:140
Class that stores state and functions for interacting with the MLX90640 sensor.
Definition: Adafruit_MLX90640.h:61