Loading...
Searching...
No Matches

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

Detailed Description

Interface definition for the TMP00X sensor driver.

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
Jannes Volkens janne.nosp@m.s.vo.nosp@m.lkens.nosp@m.@haw.nosp@m.-hamb.nosp@m.urg..nosp@m.de

Definition in file tmp00x.h.

#include <stdint.h>
#include <stdbool.h>
#include "periph/i2c.h"
#include "kernel_defines.h"
+ Include dependency graph for tmp00x.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tmp00x_params_t
 Parameters needed for device initialization. More...
 
struct  tmp00x_t
 Device descriptor for TMP00X sensors. More...
 

Macros

#define BUS   (dev->p.i2c)
 BUS.
 
#define ADDR   (dev->p.addr)
 ADDR.
 
#define CONFIG_TMP00X_I2C_ADDRESS   (0x40)
 Default Address.
 
#define CONFIG_TMP00X_CONVERSION_TIME   (1E6)
 Default Conversion Time in us.
 
#define CONFIG_TMP00X_USE_LOW_POWER
 Default low power mode.
 
#define CONFIG_TMP00X_USE_RAW_VALUES
 Default raw value mode.
 

Enumerations

enum  {
  TMP00X_OK , TMP00X_ERROR_BUS , TMP00X_ERROR_DEV , TMP00X_ERROR_CONF ,
  TMP00X_ERROR
}
 TMP00X specific return values. More...
 

Functions

int tmp00x_init (tmp00x_t *dev, const tmp00x_params_t *params)
 Initialize the TMP00X sensor driver.
 
int tmp00x_reset (const tmp00x_t *dev)
 Reset the TMP00X sensor, afterwards it should be reinitialized.
 
int tmp00x_set_active (const tmp00x_t *dev)
 Set active mode, this enables periodic measurements.
 
int tmp00x_set_standby (const tmp00x_t *dev)
 Set standby mode.
 
int tmp00x_read (const tmp00x_t *dev, int16_t *rawv, int16_t *rawt, uint16_t *drdy)
 Read sensor's data.
 
void tmp00x_convert (int16_t rawv, int16_t rawt, float *tamb, float *tobj)
 Convert raw sensor values to temperature.
 
int tmp00x_read_temperature (const tmp00x_t *dev, int16_t *ta, int16_t *to)
 Convenience function to get ambient and object temperatures in [°C].
 

Conversion rate and AVG sampling configuration

#define TMP00X_CONFIG_CR_AS1   (0x00)
 Conversion Time 0.25s, AVG Samples: 1.
 
#define TMP00X_CONFIG_CR_AS2   (0x01)
 Conversion Time 0.5s, AVG Samples: 2.
 
#define TMP00X_CONFIG_CR_AS4   (0x02)
 Conversion Time 1s, AVG Samples: 4.
 
#define TMP00X_CONFIG_CR_AS8   (0x03)
 Conversion Time 2s, AVG Samples: 8.
 
#define TMP00X_CONFIG_CR_AS16   (0x04)
 Conversion Time 4s, AVG Samples: 16.
 
#define TMP00X_CONFIG_CR_DEF   TMP00X_CONFIG_CR_AS4
 Default for Testing.
 

Constants for TMP00X calibration

#define TMP00X_CCONST_S0   (6.4E-14)
 Calibration Factor.
 
#define TMP00X_CCONST_A1   (1.75E-3)
 Constant $a_{\mathrm{1}}$.
 
#define TMP00X_CCONST_A2   (-1.678E-5)
 Constant $a_{\mathrm{2}}$.
 
#define TMP00X_CCONST_TREF   (298.15)
 Constant $T_{\mathrm{REF}}$.
 
#define TMP00X_CCONST_B0   (-2.94E-5)
 Constant $b_{\mathrm{0}}$.
 
#define TMP00X_CCONST_B1   (-5.7E-7)
 Constant $b_{\mathrm{1}}$.
 
#define TMP00X_CCONST_B2   (4.63E-9)
 Constant $b_{\mathrm{2}}$.
 
#define TMP00X_CCONST_C2   (13.4)
 Constant $c_{\mathrm{2}}$.
 
#define TMP00X_CCONST_LSB_SIZE   (156.25E-9)
 Sensor Voltage Register LSB Size.