17 #ifndef _ADAFRUIT_TMP117_H 18 #define _ADAFRUIT_TMP117_H 21 #include <Adafruit_BusIO_Register.h> 22 #include <Adafruit_I2CDevice.h> 23 #include <Adafruit_Sensor.h> 26 #define TMP117_I2CADDR_DEFAULT 0x48 27 #define TMP117_CHIP_ID 0x0117 29 #define TMP117_WHOAMI 0x0F 30 #define _CONFIGURATION 0x01 32 #define TMP117_TEMP_DATA 0x00 33 #define TMP117_CONFIGURATION 0x01 34 #define TMP117_T_HIGH_LIMIT 0x02 35 #define TMP117_T_LOW_LIMIT 0x03 36 #define TMP117_TEMP_OFFSET 0x07 37 #define TMP117_DEVICE_ID 0x0F 38 #define WHOAMI_ANSWER 0x0117 40 #define HIGH_ALRT_FLAG 0b100 41 #define LOW_ALRT_FLAG 0b010 42 #define DRDY_ALRT_FLAG 0b001 44 #define TMP117_RESOLUTION \ 98 TMP117_DELAY_16000_MS,
126 TMP117_MODE_CONTINUOUS,
127 TMP117_MODE_SHUTDOWN,
128 TMP117_MODE_ONE_SHOT = 3,
141 int32_t sensor_id = 117);
146 bool getEvent(sensors_event_t *temp);
172 bool _init(int32_t sensor_id);
173 uint16_t _sensorid_temp;
179 Adafruit_I2CDevice *i2c_dev = NULL;
180 Adafruit_BusIO_Register *config_reg =
182 Adafruit_BusIO_Register *temp_reg =
185 void readAlertsDRDY(
void);
186 bool getDataReady(
void);
187 void waitForData(
void);
bool setLowThreshold(float low_threshold)
Set a new low temperature threshold.
Definition: Adafruit_TMP117.cpp:191
tmp117_mode_t
Options to set the measurement mode of the sensor.
Definition: Adafruit_TMP117.h:125
Class that stores state and functions for interacting with the TMP117 High-Accuracy Temperature Senso...
Definition: Adafruit_TMP117.h:135
bool data_ready
Status of the data_ready alert.
Definition: Adafruit_TMP117.h:72
Adafruit_TMP117()
Construct a new Adafruit_TMP117::Adafruit_TMP117 object.
Definition: Adafruit_TMP117.cpp:45
tmp117_delay_t getReadDelay(void)
Get current setting for the minimum delay between calculated temperature reads.
Definition: Adafruit_TMP117.cpp:354
bool setAveragedSampleCount(tmp117_average_count_t count)
Set the number of raw measurements that are averaged into the reported temperature.
Definition: Adafruit_TMP117.cpp:341
tmp117_rate_t
Allowed values for setDataRate.
Definition: Adafruit_TMP117.h:59
#define TMP117_I2CADDR_DEFAULT
TMP117 default i2c address.
Definition: Adafruit_TMP117.h:26
bool begin(uint8_t i2c_addr=TMP117_I2CADDR_DEFAULT, TwoWire *wire=&Wire, int32_t sensor_id=117)
Sets up the hardware and initializes I2C.
Definition: Adafruit_TMP117.cpp:70
tmp117_mode_t getMeasurementMode(void)
Read the active measurement mode.
Definition: Adafruit_TMP117.cpp:378
bool interruptsActiveLow(void)
Get the polarity of the INT pin.
Definition: Adafruit_TMP117.cpp:245
bool thermAlertModeEnabled(void)
Get the current enable status of the "THERM" alert mode.
Definition: Adafruit_TMP117.cpp:310
float getHighThreshold(void)
Read the current high temperature threshold.
Definition: Adafruit_TMP117.cpp:203
bool low
Status of the low temperature alert.
Definition: Adafruit_TMP117.h:71
bool getEvent(sensors_event_t *temp)
Gets the pressure sensor and temperature values as sensor events.
Definition: Adafruit_TMP117.cpp:130
bool getAlerts(tmp117_alerts_t *alerts)
Get the current state of the alert flags.
Definition: Adafruit_TMP117.cpp:161
void reset(void)
Performs a software reset initializing registers to their power on state.
Definition: Adafruit_TMP117.cpp:113
tmp117_delay_t
Options to specify the minimum delay between new measurements.
Definition: Adafruit_TMP117.h:90
A struct to hold alert state information.
Definition: Adafruit_TMP117.h:69
float getLowThreshold(void)
Read the current low temperature threshold.
Definition: Adafruit_TMP117.cpp:176
bool setReadDelay(tmp117_delay_t delay)
Set a new minimum delay between calculated reads.
Definition: Adafruit_TMP117.cpp:367
tmp117_average_count_t getAveragedSampleCount(void)
Read the current number of samples that are averaged to calculate the reported temperature.
Definition: Adafruit_TMP117.cpp:322
bool setOffset(float offset)
Write a new temperature offset.
Definition: Adafruit_TMP117.cpp:269
bool setHighThreshold(float high_threshold)
Set a new high temperature threshold.
Definition: Adafruit_TMP117.cpp:218
bool setMeasurementMode(tmp117_mode_t mode)
Set a new measurement mode.
Definition: Adafruit_TMP117.cpp:392
bool high
Status of the high temperature alert.
Definition: Adafruit_TMP117.h:70
~Adafruit_TMP117()
Destroy the Adafruit_TMP117::Adafruit_TMP117 object.
Definition: Adafruit_TMP117.cpp:51
tmp117_average_count_t
Options for setAveragedSampleCount.
Definition: Adafruit_TMP117.h:79
float getOffset(void)
Read the current temperature offset.
Definition: Adafruit_TMP117.cpp:256