Adafruit TMP117 Library
|
#include "Arduino.h"
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
Go to the source code of this file.
Classes | |
struct | tmp117_alerts_t |
A struct to hold alert state information. More... | |
class | Adafruit_TMP117 |
Class that stores state and functions for interacting with the TMP117 High-Accuracy Temperature Sensor. More... | |
Macros | |
#define | TMP117_I2CADDR_DEFAULT 0x48 |
TMP117 default i2c address. | |
#define | TMP117_CHIP_ID 0x0117 |
TMP117 default device id from WHOAMI. | |
#define | TMP117_WHOAMI 0x0F |
Chip ID register. | |
#define | _CONFIGURATION 0x01 |
Configuration register. | |
#define | TMP117_TEMP_DATA 0x00 |
Temperature data register. | |
#define | TMP117_CONFIGURATION 0x01 |
Configuration register. | |
#define | TMP117_T_HIGH_LIMIT 0x02 |
High limit set point register. | |
#define | TMP117_T_LOW_LIMIT 0x03 |
Low limit set point register. | |
#define | TMP117_TEMP_OFFSET 0x07 |
Temp offset register. | |
#define | TMP117_DEVICE_ID 0x0F |
Device ID register. | |
#define | WHOAMI_ANSWER 0x0117 |
Correct 2-byte ID register value response. | |
#define | HIGH_ALRT_FLAG 0b100 |
mask to check high threshold alert | |
#define | LOW_ALRT_FLAG 0b010 |
mask to check low threshold alert | |
#define | DRDY_ALRT_FLAG 0b001 |
mask to check data ready flag | |
#define | TMP117_RESOLUTION 0.0078125f |
Scalar to convert from LSB value to degrees C. | |
Enumerations | |
enum | tmp117_rate_t { TMP117_RATE_ONE_SHOT } |
Allowed values for setDataRate . | |
enum | tmp117_average_count_t { TMP117_AVERAGE_1X, TMP117_AVERAGE_8X, TMP117_AVERAGE_32X, TMP117_AVERAGE_64X } |
Options for setAveragedSampleCount. | |
enum | tmp117_delay_t { TMP117_DELAY_0_MS, TMP117_DELAY_125_MS, TMP117_DELAY_250_MS, TMP117_DELAY_500_MS, TMP117_DELAY_1000_MS, TMP117_DELAY_4000_MS, TMP117_DELAY_8000_MS, TMP117_DELAY_16000_MS } |
Options to specify the minimum delay between new measurements. | |
enum | tmp117_mode_t { TMP117_MODE_CONTINUOUS, TMP117_MODE_SHUTDOWN, TMP117_MODE_ONE_SHOT = 3 } |
Options to set the measurement mode of the sensor. More... | |
I2C Driver for the Adafruit Arduino library for the TMP117 high-accuracy temperature sensor This is a library is written to work with the Adafruit TMP117 breakout: https://www.adafruit.com/products/4821
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing products from Adafruit!
BSD license (see license.txt)
enum tmp117_mode_t |
Options to set the measurement mode of the sensor.
In TMP117_MODE_CONTINUOUS
, new measurements are read and available according to the interval determined by the number of averaged samples and the delay between reads.
When the mode is TMP117_MODE_SHUTDOWN
the sensor is placed in a low power state and new measurements are not taken until a different mode is set. In this mode, active circuitry within this sensor is deactivated, lowering the power consumption dramatically.
When the mode is set to TMP117_MODE_ONE_SHOT
, a single new measurement is calculated from the configured number of samples to be averaged and available as soon as the measurements are Complete.
Once the new measurement is calculated and available, the sensor switches to TMP117_MODE_SHUTDOWN
until TMP117_MODE_ONE_SHOT
is set again to calculate a new measurement or the mode is switched to TMP117_MODE_CONTINUOUS
.
NOTE: This setting ignores the configured minimum delay between measurements.