EFR32 Blue Gecko 1 Software Documentation  efr32bg1-doc-5.1.2
tempsens.h
Go to the documentation of this file.
1 /***************************************************************************/
18 #ifndef __TEMPSENS_H
19 #define __TEMPSENS_H
20 
21 #include "em_device.h"
22 
23 /***************************************************************************/
28 /***************************************************************************/
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /*******************************************************************************
38  ******************************* DEFINES ***********************************
39  ******************************************************************************/
40 
42 #define TEMPSENS_DK_ADDR 0x90
43 
44 
45 /*******************************************************************************
46  ******************************** ENUMS ************************************
47  ******************************************************************************/
48 
50 typedef enum
51 {
57 
58 
59 /*******************************************************************************
60  ******************************* STRUCTS ***********************************
61  ******************************************************************************/
62 
64 typedef struct
65 {
67  int16_t i;
68 
73  int16_t f;
75 
76 
77 /*******************************************************************************
78  ***************************** PROTOTYPES **********************************
79  ******************************************************************************/
80 
83  uint8_t addr,
85  uint16_t *val);
87  uint8_t addr,
89  uint16_t val);
91  uint8_t addr,
92  TEMPSENS_Temp_TypeDef *temp);
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
101 #endif /* __TEMPSENS_H */
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
int TEMPSENS_RegisterGet(I2C_TypeDef *i2c, uint8_t addr, TEMPSENS_Register_TypeDef reg, uint16_t *val)
Read sensor register content.
Definition: tempsens.c:74
void TEMPSENS_Celsius2Fahrenheit(TEMPSENS_Temp_TypeDef *temp)
Convert temperature from Celsius to Fahrenheit.
Definition: tempsens.c:32
int TEMPSENS_RegisterSet(I2C_TypeDef *i2c, uint8_t addr, TEMPSENS_Register_TypeDef reg, uint16_t val)
Write to sensor register.
Definition: tempsens.c:136
TEMPSENS_Register_TypeDef
Definition: tempsens.h:50
int TEMPSENS_TemperatureGet(I2C_TypeDef *i2c, uint8_t addr, TEMPSENS_Temp_TypeDef *temp)
Fetch current temperature from temperature sensor (in Celsius).
Definition: tempsens.c:209