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#

#define

I2C device address for Si7006.

#define

I2C device address for Si7013.

#define

I2C device address for Si7020.

#define

I2C device address for Si7021.

#define

Device ID value for Si7006.

#define

Device ID value for Si7013.

#define

Device ID value for Si7020.

#define

Device ID value for Si7021.

Functions#

sl_status_t
sl_si70xx_init(sl_i2cspm_t *i2cspm, uint8_t addr)

Initialize the Si70xx sensor.

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.

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.

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.

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.

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.

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.

Sensor Defines Documentation#

SI7006_ADDR#

#define SI7006_ADDR
Value:
0X40

I2C device address for Si7006.


Definition at line 78 of file hardware/driver/si70xx/inc/sl_si70xx.h

SI7013_ADDR#

#define SI7013_ADDR
Value:
0x41

I2C device address for Si7013.


Definition at line 80 of file hardware/driver/si70xx/inc/sl_si70xx.h

SI7020_ADDR#

#define SI7020_ADDR
Value:
0X40

I2C device address for Si7020.


Definition at line 82 of file hardware/driver/si70xx/inc/sl_si70xx.h

SI7021_ADDR#

#define SI7021_ADDR
Value:
0x40

I2C device address for Si7021.


Definition at line 84 of file hardware/driver/si70xx/inc/sl_si70xx.h

SI7006_DEVICE_ID#

#define SI7006_DEVICE_ID
Value:
0x06

Device ID value for Si7006.


Definition at line 87 of file hardware/driver/si70xx/inc/sl_si70xx.h

SI7013_DEVICE_ID#

#define SI7013_DEVICE_ID
Value:
0x0D

Device ID value for Si7013.


Definition at line 89 of file hardware/driver/si70xx/inc/sl_si70xx.h

SI7020_DEVICE_ID#

#define SI7020_DEVICE_ID
Value:
0x14

Device ID value for Si7020.


Definition at line 91 of file hardware/driver/si70xx/inc/sl_si70xx.h

SI7021_DEVICE_ID#

#define SI7021_DEVICE_ID
Value:
0x15

Device ID value for Si7021.


Definition at line 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.

Parameters
[in]i2cspm

The I2C peripheral to use.

[in]addr

The I2C address to probe.


Definition at line 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.

Parameters
[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


Definition at line 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.

Parameters
[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.


Definition at line 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.

Parameters
[in]i2cspm

The I2C peripheral to use.

[in]addr

The I2C address of the sensor.

[out]fwRev

The internal firmware revision. 0xFF === 1.0


Definition at line 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.

Parameters
[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.


Definition at line 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.

Parameters
[in]i2cspm

The I2C peripheral to use.

[in]addr

The I2C address of the sensor.


Definition at line 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.

Parameters
[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


Definition at line 198 of file hardware/driver/si70xx/inc/sl_si70xx.h