Initial checkin of empty MCP9808 driver
This commit is contained in:
36
src/mgos_mcp9808_internal.h
Normal file
36
src/mgos_mcp9808_internal.h
Normal file
@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include "mgos.h"
|
||||
#include "mgos_i2c.h"
|
||||
#include "mgos_mcp9808.h"
|
||||
#include <math.h>
|
||||
|
||||
#define MGOS_MCP9808_DEFAULT_I2CADDR (0x18)
|
||||
|
||||
#define MGOS_MCP9808_MEAS_HIGHREP_STRETCH (0x2C06)
|
||||
#define MGOS_MCP9808_MEAS_MEDREP_STRETCH (0x2C0D)
|
||||
#define MGOS_MCP9808_MEAS_LOWREP_STRETCH (0x2C10)
|
||||
#define MGOS_MCP9808_MEAS_HIGHREP (0x2400)
|
||||
#define MGOS_MCP9808_MEAS_MEDREP (0x240B)
|
||||
#define MGOS_MCP9808_MEAS_LOWREP (0x2416)
|
||||
#define MGOS_MCP9808_READSTATUS (0xF32D)
|
||||
#define MGOS_MCP9808_CLEARSTATUS (0x3041)
|
||||
#define MGOS_MCP9808_SOFTRESET (0x30A2)
|
||||
#define MGOS_MCP9808_HEATEREN (0x306D)
|
||||
#define MGOS_MCP9808_HEATERDIS (0x3066)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct mgos_mcp9808 {
|
||||
struct mgos_i2c *i2c;
|
||||
uint8_t i2caddr;
|
||||
double last_read_time;
|
||||
|
||||
float temperature;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user