tempsens.h
Go to the documentation of this file.00001
00018 #ifndef __TEMPSENS_H
00019 #define __TEMPSENS_H
00020
00021 #include "em_device.h"
00022
00023
00028
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037
00038
00039
00040
00042 #define TEMPSENS_DK_ADDR 0x90
00043
00044
00045
00046
00047
00048
00050 typedef enum
00051 {
00052 tempsensRegTemp = 0,
00053 tempsensRegConfig = 1,
00054 tempsensRegHysteresis = 2,
00055 tempsensRegShutdown = 3
00056 } TEMPSENS_Register_TypeDef;
00057
00058
00059
00060
00061
00062
00064 typedef struct
00065 {
00067 int16_t i;
00068
00073 int16_t f;
00074 } TEMPSENS_Temp_TypeDef;
00075
00076
00077
00078
00079
00080
00081 void TEMPSENS_Celsius2Fahrenheit(TEMPSENS_Temp_TypeDef *temp);
00082 int TEMPSENS_RegisterGet(I2C_TypeDef *i2c,
00083 uint8_t addr,
00084 TEMPSENS_Register_TypeDef reg,
00085 uint16_t *val);
00086 int TEMPSENS_RegisterSet(I2C_TypeDef *i2c,
00087 uint8_t addr,
00088 TEMPSENS_Register_TypeDef reg,
00089 uint16_t val);
00090 int TEMPSENS_TemperatureGet(I2C_TypeDef *i2c,
00091 uint8_t addr,
00092 TEMPSENS_Temp_TypeDef *temp);
00093
00094 #ifdef __cplusplus
00095 }
00096 #endif
00097
00101 #endif