EFM32 Happy Gecko Software Documentation  efm32hg-doc-5.1.2
si7013.h
Go to the documentation of this file.
1 /***************************************************************************/
16 #ifndef __SI7013_H
17 #define __SI7013_H
18 
19 #include "em_device.h"
20 #include <stdbool.h>
21 
22 /***************************************************************************/
27 /***************************************************************************/
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /*******************************************************************************
37  ******************************* DEFINES ***********************************
38  ******************************************************************************/
39 
41 #define SI7013_ADDR 0x82
42 
43 #define SI7021_ADDR 0x80
44 
45 
47 #define SI7013_DEVICE_ID 0x0D
48 
49 #define SI7020_DEVICE_ID 0x14
50 
51 #define SI7021_DEVICE_ID 0x21
52 
53 /*******************************************************************************
54  ***************************** PROTOTYPES **********************************
55  ******************************************************************************/
56 
57 int32_t Si7013_MeasureRHAndTemp(I2C_TypeDef *i2c, uint8_t addr,
58  uint32_t *rhData, int32_t *tData);
59 
60 int32_t Si7013_GetFirmwareRevision(I2C_TypeDef *i2c, uint8_t addr, uint8_t *fwRev);
61 
62 bool Si7013_Detect(I2C_TypeDef *i2c, uint8_t addr, uint8_t *deviceId);
63 int32_t Si7013_ReadNoHoldRHAndTemp(I2C_TypeDef *i2c, uint8_t addr, uint32_t *rhData,
64  int32_t *tData);
65 int32_t Si7013_StartNoHoldMeasureRHAndTemp(I2C_TypeDef *i2c, uint8_t addr);
66 int32_t Si7013_MeasureV(I2C_TypeDef *i2c, uint8_t addr, int32_t *vData);
67 #ifdef __cplusplus
68 }
69 #endif
70 
73 #endif /* __SI7013_H */
int32_t Si7013_MeasureV(I2C_TypeDef *i2c, uint8_t addr, int32_t *vData)
Reads relative humidity and temperature from a Si7013 sensor.
Definition: si7013.c:376
bool Si7013_Detect(I2C_TypeDef *i2c, uint8_t addr, uint8_t *deviceId)
Checks if a Si7013 is present on the I2C bus or not.
Definition: si7013.c:407
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
int32_t Si7013_ReadNoHoldRHAndTemp(I2C_TypeDef *i2c, uint8_t addr, uint32_t *rhData, int32_t *tData)
Reads relative humidity and temperature from a Si7013 sensor.
Definition: si7013.c:261
int32_t Si7013_StartNoHoldMeasureRHAndTemp(I2C_TypeDef *i2c, uint8_t addr)
Starts no hold measurement of relative humidity and temperature from a Si7013 sensor.
Definition: si7013.c:197
int32_t Si7013_GetFirmwareRevision(I2C_TypeDef *i2c, uint8_t addr, uint8_t *fwRev)
Reads Firmware Revision from a Si7013 sensor.
Definition: si7013.c:157
int32_t Si7013_MeasureRHAndTemp(I2C_TypeDef *i2c, uint8_t addr, uint32_t *rhData, int32_t *tData)
Reads relative humidity and temperature from a Si7013 sensor.
Definition: si7013.c:304