EFR32 Blue Gecko 12 Software Documentation  efr32bg12-doc-5.1.2

Detailed Description

Macros

#define SI7013_ADDR   0x82
 
#define SI7013_DEVICE_ID   0x0D
 
#define SI7020_DEVICE_ID   0x14
 
#define SI7021_ADDR   0x80
 
#define SI7021_DEVICE_ID   0x21
 

Functions

bool Si7013_Detect (I2C_TypeDef *i2c, uint8_t addr, uint8_t *deviceId)
 Checks if a Si7013 is present on the I2C bus or not. More...
 
int32_t Si7013_GetFirmwareRevision (I2C_TypeDef *i2c, uint8_t addr, uint8_t *fwRev)
 Reads Firmware Revision from a Si7013 sensor. More...
 
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. More...
 
int32_t Si7013_MeasureV (I2C_TypeDef *i2c, uint8_t addr, int32_t *vData)
 Reads relative humidity and temperature from a Si7013 sensor. More...
 
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. More...
 
int32_t Si7013_StartNoHoldMeasureRHAndTemp (I2C_TypeDef *i2c, uint8_t addr)
 Starts no hold measurement of relative humidity and temperature from a Si7013 sensor. More...
 

Macro Definition Documentation

#define SI7013_ADDR   0x82

I2C device address for Si7013

Definition at line 41 of file si7013.h.

#define SI7013_DEVICE_ID   0x0D

Device ID value for Si7013

Definition at line 47 of file si7013.h.

#define SI7020_DEVICE_ID   0x14

Device ID value for Si7020

Definition at line 49 of file si7013.h.

#define SI7021_ADDR   0x80

I2C device address for Si7021

Definition at line 43 of file si7013.h.

#define SI7021_DEVICE_ID   0x21

Device ID value for Si7021

Definition at line 51 of file si7013.h.

Function Documentation

bool Si7013_Detect ( I2C_TypeDef i2c,
uint8_t  addr,
uint8_t *  deviceId 
)

Checks if a Si7013 is present on the I2C bus or not.

Parameters
[in]i2cThe I2C peripheral to use (Not used).
[in]addrThe I2C address to probe.
[out]deviceIdWrite device ID from SNB_3 if device responds. Pass in NULL to discard. Should be 0x0D for Si7013, 0x14 for Si7020 or 0x15 for Si7021
Returns
True if a Si70xx is detected, false otherwise.

Definition at line 407 of file si7013.c.

References I2C_TransferSeq_TypeDef::addr, I2C_TransferSeq_TypeDef::buf, I2C_TransferSeq_TypeDef::data, I2C_TransferSeq_TypeDef::flags, I2C_FLAG_WRITE_READ, I2CSPM_Transfer(), i2cTransferDone, and I2C_TransferSeq_TypeDef::len.

int32_t Si7013_GetFirmwareRevision ( I2C_TypeDef i2c,
uint8_t  addr,
uint8_t *  fwRev 
)

Reads Firmware Revision from a Si7013 sensor.

Parameters
[in]i2cThe I2C peripheral to use.
[in]addrThe I2C address of the sensor.
[out]fwRevThe internal firmware revision. 0xFF === 1.0
Returns
Returns zero on OK, non-zero otherwise.

Definition at line 157 of file si7013.c.

References I2C_TransferSeq_TypeDef::addr, I2C_TransferSeq_TypeDef::buf, I2C_TransferSeq_TypeDef::data, I2C_TransferSeq_TypeDef::flags, I2C_FLAG_WRITE_READ, I2CSPM_Transfer(), i2cTransferDone, and I2C_TransferSeq_TypeDef::len.

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.

Parameters
[in]i2cThe I2C peripheral to use.
[in]addrThe I2C address of the sensor.
[out]rhDataThe relative humidity in percent (multiplied by 1000).
[out]tDataThe temperature in milli-Celsius.
Returns
Returns zero on OK, non-zero otherwise.

Definition at line 304 of file si7013.c.

int32_t Si7013_MeasureV ( I2C_TypeDef i2c,
uint8_t  addr,
int32_t *  vData 
)

Reads relative humidity and temperature from a Si7013 sensor.

Parameters
[in]i2cThe I2C peripheral to use.
[in]addrThe I2C address of the sensor.
[out]vDataThe data read from the sensor.
Returns
Returns zero on OK, non-zero otherwise.

Definition at line 376 of file si7013.c.

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.

Parameters
[in]i2cThe I2C peripheral to use.
[in]addrThe I2C address of the sensor.
[out]rhDataThe relative humidity in percent (multiplied by 1000).
[out]tDataThe temperature in milli-Celsius.
Returns
Returns zero on OK, non-zero otherwise.

Definition at line 261 of file si7013.c.

int32_t Si7013_StartNoHoldMeasureRHAndTemp ( I2C_TypeDef i2c,
uint8_t  addr 
)

Starts no hold measurement of relative humidity and temperature from a Si7013 sensor.

Parameters
[in]i2cThe I2C peripheral to use.
[in]addrThe I2C address of the sensor.
Returns
Returns zero on OK, non-zero otherwise.

Definition at line 197 of file si7013.c.