-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAMG8833IR.h
95 lines (78 loc) · 2.99 KB
/
AMG8833IR.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//#include <vector>
#include <stdint.h>
//Registers
#define POWER_CONTROL_REGISTER 0x00
#define RESET_REGISTER 0x01
#define FRAMERATE_REGISTER 0x02
#define INT_CONTROL_REGISTER 0x03
#define STATUS_REGISTER 0x04
#define STATUS_CLEAR_REGISTER 0x05
#define AVERAGE_REGISTER 0x07
#define INT_LEVEL_REGISTER_UPPER_LSB 0x08
#define INT_LEVEL_REGISTER_UPPER_MSB 0x09
#define INT_LEVEL_REGISTER_LOWER_LSB 0x0A
#define INT_LEVEL_REGISTER_LOWER_MSB 0x0B
#define INT_LEVEL_REGISTER_HYST_LSB 0x0C
#define INT_LEVEL_REGISTER_HYST_MSB 0x0D
#define THERMISTOR_REGISTER_LSB 0x0E
#define THERMISTOR_REGISTER_MSB 0x0F
#define INT_TABLE_REGISTER_INT0 0x10
#define RESERVED_AVERAGE_REGISTER 0x1F
#define TEMPERATURE_REGISTER_START 0x80
#define DEFAULT_ADDRESS 0x69
class AMG8833IR {
public:
//By default use the default I2C address, and use Wire port
void begin(uint8_t deviceAddress = DEFAULT_ADDRESS/*, TwoWire &wirePort = Wire*/); //deb100
float getPixelTemperature(unsigned char pixelAddr);
int16_t getPixelTemperatureRaw(unsigned char pixelAddr);
float getPixelTemperatureFahrenheit(unsigned char pixelAddr);
float getDeviceTemperature();
int16_t getDeviceTemperatureRaw();
float getDeviceTemperatureFahrenheit();
void setFramerate1FPS();
void setFramerate10FPS();
bool isFramerate10FPS();
void wake();
void sleep();
void standby60seconds();
void standby10seconds();
void interruptPinEnable();
void interruptPinDisable();
void setInterruptModeAbsolute();
void setInterruptModeDifference();
bool interruptPinEnabled();
bool interruptFlagSet();
bool pixelTemperatureOutputOK();
bool deviceTemperatureOutputOK();
void clearInterruptFlag();
void clearPixelTemperatureOverflow();
void clearDeviceTemperatureOverflow();
void clearAllOverflow();
void clearAllStatusFlags();
bool pixelInterruptSet(uint8_t pixelAddr);
void movingAverageEnable();
void movingAverageDisable();
bool movingAverageEnabled();
void setUpperInterruptValue(float DegreesC);
void setUpperInterruptValueRaw(int16_t regValue);
void setUpperInterruptValueFahrenheit(float DegreesF);
void setLowerInterruptValue(float DegreesC);
void setLowerInterruptValueRaw(int16_t regValue);
void setLowerInterruptValueFahrenheit(float DegreesF);
void setInterruptHysteresis(float DegreesC);
void setInterruptHysteresisRaw(int16_t regValue);
void setInterruptHysteresisFahrenheit(float DegreesF);
float getUpperInterruptValue();
int16_t getUpperInterruptValueRaw();
float getUpperInterruptValueFahrenheit();
float getLowerInterruptValue();
int16_t getLowerInterruptValueRaw();
float getLowerInterruptValueFahrenheit();
float getInterruptHysteresis();
int16_t getInterruptHysteresisRaw();
float getInterruptHysteresisFahrenheit();
void setRegister(unsigned char reg, unsigned char val);
int16_t getRegister(unsigned char reg, int8_t len);
// void setI2CAddress(uint8_t addr); //Set the I2C address we read and write to
};