tempsens.h
Go to the documentation of this file.00001
00036 #ifndef __TEMPSENS_H
00037 #define __TEMPSENS_H
00038
00039 #include "em_device.h"
00040
00041
00046
00051 #ifdef __cplusplus
00052 extern "C" {
00053 #endif
00054
00055
00056
00057
00058
00060 #define TEMPSENS_DK_ADDR 0x90
00061
00062
00063
00064
00065
00066
00068 typedef enum
00069 {
00070 tempsensRegTemp = 0,
00071 tempsensRegConfig = 1,
00072 tempsensRegHysteresis = 2,
00073 tempsensRegShutdown = 3
00074 } TEMPSENS_Register_TypeDef;
00075
00076
00077
00078
00079
00080
00082 typedef struct
00083 {
00085 int16_t i;
00086
00091 int16_t f;
00092 } TEMPSENS_Temp_TypeDef;
00093
00094
00095
00096
00097
00098
00099 void TEMPSENS_Celsius2Fahrenheit(TEMPSENS_Temp_TypeDef *temp);
00100 int TEMPSENS_RegisterGet(I2C_TypeDef *i2c,
00101 uint8_t addr,
00102 TEMPSENS_Register_TypeDef reg,
00103 uint16_t *val);
00104 int TEMPSENS_RegisterSet(I2C_TypeDef *i2c,
00105 uint8_t addr,
00106 TEMPSENS_Register_TypeDef reg,
00107 uint16_t val);
00108 int TEMPSENS_TemperatureGet(I2C_TypeDef *i2c,
00109 uint8_t addr,
00110 TEMPSENS_Temp_TypeDef *temp);
00111
00112 #ifdef __cplusplus
00113 }
00114 #endif
00115
00119 #endif