Interface definition for the TMP006 sensor driver. More...

Detailed Description

Author
Johann Fischer j.fis.nosp@m.cher.nosp@m.@phyt.nosp@m.ec.d.nosp@m.e
Sebastian Meiling s@mln.nosp@m.g.ne.nosp@m.t

Definition in file tmp006.h.

#include <stdint.h>
#include <stdbool.h>
#include "periph/i2c.h"
+ Include dependency graph for tmp006.h:

Go to the source code of this file.

Data Structures

struct  tmp006_params_t
 Parameters needed for device initialization. More...
 
struct  tmp006_t
 Device descriptor for TMP006 sensors. More...
 

Macros

#define TMP006_I2C_ADDRESS   (0x41)
 TMP006 Default Address.
 
#define TMP006_CONVERSION_TIME   (1E6)
 Default Conversion Time in us.
 
Conversion rate and AVG sampling configuration
#define TMP006_CONFIG_CR_AS1   (0x00)
 Conversion Time 0.25s, AVG Samples: 1.
 
#define TMP006_CONFIG_CR_AS2   (0x01)
 Conversion Time 0.5s, AVG Samples: 2.
 
#define TMP006_CONFIG_CR_AS4   (0x02)
 Conversion Time 1s, AVG Samples: 4.
 
#define TMP006_CONFIG_CR_AS8   (0x03)
 Conversion Time 2s, AVG Samples: 8.
 
#define TMP006_CONFIG_CR_AS16   (0x04)
 Conversion Time 4s, AVG Samples: 16.
 
#define TMP006_CONFIG_CR_DEF   TMP006_CONFIG_CR_AS4
 Default for Testing.
 
Constants for TMP006 calibration
#define TMP006_CCONST_S0   (6.4E-14)
 Calibration Factor.
 
#define TMP006_CCONST_A1   (1.75E-3)
 Constant $a_{\mathrm{1}}$.
 
#define TMP006_CCONST_A2   (-1.678E-5)
 Constant $a_{\mathrm{2}}$.
 
#define TMP006_CCONST_TREF   (298.15)
 Constant $T_{\mathrm{REF}}$.
 
#define TMP006_CCONST_B0   (-2.94E-5)
 Constant $b_{\mathrm{0}}$.
 
#define TMP006_CCONST_B1   (-5.7E-7)
 Constant $b_{\mathrm{1}}$.
 
#define TMP006_CCONST_B2   (4.63E-9)
 Constant $b_{\mathrm{2}}$.
 
#define TMP006_CCONST_C2   (13.4)
 Constant $c_{\mathrm{2}}$.
 
#define TMP006_CCONST_LSB_SIZE   (156.25E-9)
 Sensor Voltage Register LSB Size.
 

Enumerations

enum  {
  TMP006_OK, TMP006_ERROR_BUS, TMP006_ERROR_DEV, TMP006_ERROR_CONF,
  TMP006_ERROR
}
 TMP006 specific return values. More...
 

Functions

int tmp006_init (tmp006_t *dev, const tmp006_params_t *params)
 Initialize the TMP006 sensor driver. More...
 
int tmp006_reset (const tmp006_t *dev)
 Reset the TMP006 sensor, afterwards it should be reinitialized. More...
 
int tmp006_set_active (const tmp006_t *dev)
 Set active mode, this enables periodic measurements. More...
 
int tmp006_set_standby (const tmp006_t *dev)
 Set standby mode. More...
 
int tmp006_read (const tmp006_t *dev, int16_t *rawv, int16_t *rawt, uint8_t *drdy)
 Read sensor's data. More...
 
void tmp006_convert (int16_t rawv, int16_t rawt, float *tamb, float *tobj)
 Convert raw sensor values to temperature. More...
 
int tmp006_read_temperature (const tmp006_t *dev, int16_t *ta, int16_t *to)
 Convenience function to get ambient and object temperatures in [°C]. More...