Si70xx - RHT Sensor#
Silicon Labs Si7006/13/20/21 Relative Humidity and Temperature Sensor I2C driver.
Si70xx example code#
Basic example for relative humidity and temperature measurement using an Si7021 sensor:
#include "sl_i2cspm_instances.h"
#include "sl_si70xx.h"
int main( void )
{
...
int32_t temp_data;
uint32_t rh_data;
sl_si70xx_init(sl_i2cspm_sensor, SI7021_ADDR);
sl_si70xx_measure_rh_and_temp(sl_i2cspm_sensor, SI7021_ADDR, &rh_data, &temp_data);
...
}
Sensor Defines#
I2C device address for Si7006.
I2C device address for Si7013.
I2C device address for Si7020.
I2C device address for Si7021.
Device ID value for Si7006.
Device ID value for Si7013.
Device ID value for Si7020.
Device ID value for Si7021.
Functions#
Initialize the Si70xx sensor.
Check whether an Si7006/13/20/21 is present on the I2C bus or not.
Measure relative humidity and temperature from an Si7006/13/20/21 sensor.
Read Firmware Revision from an Si7006/13/20/21 sensor.
Read relative humidity and temperature from an Si7006/13/20/21 sensor.
Start a no hold measurement of relative humidity and temperature from an Si7006/13/20/21 sensor.
Measure the analog voltage or thermistor temperature from the Si7013 sensor.
Sensor Defines Documentation#
SI7006_ADDR#
#define SI7006_ADDRValue:
0X40
I2C device address for Si7006.
78
of file hardware/driver/si70xx/inc/sl_si70xx.h
SI7013_ADDR#
#define SI7013_ADDRValue:
0x41
I2C device address for Si7013.
80
of file hardware/driver/si70xx/inc/sl_si70xx.h
SI7020_ADDR#
#define SI7020_ADDRValue:
0X40
I2C device address for Si7020.
82
of file hardware/driver/si70xx/inc/sl_si70xx.h
SI7021_ADDR#
#define SI7021_ADDRValue:
0x40
I2C device address for Si7021.
84
of file hardware/driver/si70xx/inc/sl_si70xx.h
SI7006_DEVICE_ID#
#define SI7006_DEVICE_IDValue:
0x06
Device ID value for Si7006.
87
of file hardware/driver/si70xx/inc/sl_si70xx.h
SI7013_DEVICE_ID#
#define SI7013_DEVICE_IDValue:
0x0D
Device ID value for Si7013.
89
of file hardware/driver/si70xx/inc/sl_si70xx.h
SI7020_DEVICE_ID#
#define SI7020_DEVICE_IDValue:
0x14
Device ID value for Si7020.
91
of file hardware/driver/si70xx/inc/sl_si70xx.h
SI7021_DEVICE_ID#
#define SI7021_DEVICE_IDValue:
0x15
Device ID value for Si7021.
93
of file hardware/driver/si70xx/inc/sl_si70xx.h
Function Documentation#
sl_si70xx_init#
sl_status_t sl_si70xx_init (sl_i2cspm_t * i2cspm, uint8_t addr)
Initialize the Si70xx sensor.
[in] | i2cspm | The I2C peripheral to use. |
[in] | addr | The I2C address to probe. |
107
of file hardware/driver/si70xx/inc/sl_si70xx.h
sl_si70xx_present#
bool sl_si70xx_present (sl_i2cspm_t * i2cspm, uint8_t addr, uint8_t * device_id)
Check whether an Si7006/13/20/21 is present on the I2C bus or not.
[in] | i2cspm | The I2C peripheral to use. |
[in] | addr | The I2C address to probe. |
[out] | device_id | Write 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 |
122
of file hardware/driver/si70xx/inc/sl_si70xx.h
sl_si70xx_measure_rh_and_temp#
sl_status_t sl_si70xx_measure_rh_and_temp (sl_i2cspm_t * i2cspm, uint8_t addr, uint32_t * rhData, int32_t * tData)
Measure relative humidity and temperature from an Si7006/13/20/21 sensor.
[in] | i2cspm | The I2C peripheral to use. |
[in] | addr | The I2C address of the sensor. |
[out] | rhData | The relative humidity in percent (multiplied by 1000). |
[out] | tData | The temperature in milliCelsius. |
138
of file hardware/driver/si70xx/inc/sl_si70xx.h
sl_si70xx_get_firmware_revision#
sl_status_t sl_si70xx_get_firmware_revision (sl_i2cspm_t * i2cspm, uint8_t addr, uint8_t * fwRev)
Read Firmware Revision from an Si7006/13/20/21 sensor.
[in] | i2cspm | The I2C peripheral to use. |
[in] | addr | The I2C address of the sensor. |
[out] | fwRev | The internal firmware revision. 0xFF === 1.0 |
153
of file hardware/driver/si70xx/inc/sl_si70xx.h
sl_si70xx_read_rh_and_temp#
sl_status_t sl_si70xx_read_rh_and_temp (sl_i2cspm_t * i2cspm, uint8_t addr, uint32_t * rhData, int32_t * tData)
Read relative humidity and temperature from an Si7006/13/20/21 sensor.
[in] | i2cspm | The I2C peripheral to use. |
[in] | addr | The I2C address of the sensor. |
[out] | rhData | The relative humidity in percent (multiplied by 1000). |
[out] | tData | The temperature in milliCelsius. |
169
of file hardware/driver/si70xx/inc/sl_si70xx.h
sl_si70xx_start_no_hold_measure_rh_and_temp#
sl_status_t sl_si70xx_start_no_hold_measure_rh_and_temp (sl_i2cspm_t * i2cspm, uint8_t addr)
Start a no hold measurement of relative humidity and temperature from an Si7006/13/20/21 sensor.
[in] | i2cspm | The I2C peripheral to use. |
[in] | addr | The I2C address of the sensor. |
182
of file hardware/driver/si70xx/inc/sl_si70xx.h
sl_si7013_measure_analog_voltage#
sl_status_t sl_si7013_measure_analog_voltage (sl_i2cspm_t * i2cspm, uint8_t addr, int32_t * vData)
Measure the analog voltage or thermistor temperature from the Si7013 sensor.
[in] | i2cspm | The I2C peripheral to use. |
[in] | addr | The I2C address of the sensor. |
[out] | vData | The data read from the sensor. |
Note
Analog voltage measurement only supported by Si7013
198
of file hardware/driver/si70xx/inc/sl_si70xx.h