32 #include "mraa/i2c.hpp"
34 #define MCP9808_REG_CONFIG 0x01
35 #define MCP9808_REG_AMBIENT_TEMP 0x05
36 #define MCP9808_REG_MANUF_ID 0x06
37 #define MCP9808_REG_DEVICE_ID 0x07
38 #define MCP9808_REG_RESOLUTION 0x08
39 #define MCP9808_CONFIG_SHUTDOWN 0x0001
40 #define MCP9808_CONFIG_CRITLOCKED 0x8000
41 #define MCP9808_CONFIG_WINLOCKED 0x4000
42 #define MCP9808_CONFIG_INTCLR 0x2000
160 MCP9808 (
int bus, uint8_t address = 0x18);
325 float getTempValue(uint16_t value);
326 void updateConfigRegister(uint16_t update,
bool on =
true);
327 uint16_t swapWord(uint16_t value);
bool isTupper()
Definition: mcp9808.h:222
void setAlertMode(uint16_t command)
Definition: mcp9808.cxx:105
float getTemp(void)
Definition: mcp9808.cxx:57
MCP9808_RESOLUTION
uint8_t enum containing the four possible values for MCP9808 resolution register. ...
Definition: mcp9808.h:107
void clearAlertMode(void)
Definition: mcp9808.cxx:110
void shutDown(bool sleep=true)
Definition: mcp9808.cxx:71
void setResolution(MCP9808_RESOLUTION value)
Definition: mcp9808.cxx:134
MCP9808(int bus, uint8_t address=0x18)
Definition: mcp9808.cxx:33
void setHysteresis(MCP9808_CONFIG value)
Definition: mcp9808.cxx:118
uint16_t getManufacturer()
Definition: mcp9808.cxx:149
void clearInterrupt(void)
Definition: mcp9808.cxx:100
void setMode(bool celsius=true)
Definition: mcp9808.h:193
~MCP9808()
Definition: mcp9808.cxx:158
uint16_t getDevicedId()
Definition: mcp9808.cxx:154
void setMonitorReg(MCP9808_REG reg, float value)
Definition: mcp9808.cxx:78
float getMonitorReg(MCP9808_REG reg)
Definition: mcp9808.cxx:92
MCP9808_REG
uint8_t enum containing register addresses used for setting temp thresholds for MCP9808 ...
Definition: mcp9808.h:90
std::string name()
Definition: mcp9808.h:170
API for MCP9808 precision temprature sensor.
Definition: mcp9808.h:78
bool isTlower()
Definition: mcp9808.h:232
float getResolution()
Definition: mcp9808.cxx:142
bool isTcrit()
Definition: mcp9808.h:212
float getHysteresis()
Definition: mcp9808.cxx:125
bool isCelsius(void)
Definition: mcp9808.h:202
MCP9808_CONFIG
uint16_t enum containing alert and hysteresis options for config register.
Definition: mcp9808.h:141