Si70XX Sensor#

Introduction.#

The Si70xx sensor driver provides a set of functions to interact with the Si70xx sensor series over the I2C bus. It allows for easy integration of the sensor, providing access to features such as temperature and humidity measurements, firmware revision retrieval, and device presence detection. All Si70xx functions are called through the generic driver.

Introduction.#

Once I2C peripheral is initialised and configured, Si70xx sensor will be ready to be use. The common functions include the following:

sl_si91x_si70xx_init initialises the Si70xx sensor. This function is called before using the other functions.

sl_si91x_si70xx_is_present can be implemented by the application if required. This function will check if an Si70xx sensor is present on the I2C bus. sl_si91x_si70xx_measure_rh_and_temp will measure relative humidity and temperature from the sensor. sl_si91x_si70xx_get_firmware_revision will read the firmware revision from the sensor. sl_si91x_si70xx_reset will initiate a software reset of the sensor.

Kindly refer to the Function Documentation to see the usage of all the APIs in detail.

Enumerations#

enum
SL_HUMIDITY_HM = 0xE5
SL_HUMIDITY_NHM = 0xF5
SL_TEMPERATURE_HM = 0xE3
SL_TEMPERATURE_NHM = 0xF3
SL_TEMPERATURE_AH = 0xE0
SL_SI70XX_RESET = 0xFE
SL_W_RHT_U_REG = 0xE6
SL_R_RHT_U_REG = 0xE7
SL_W_HEATER_C_REG = 0x51
SL_R_HEATER_C_REG = 0x11
SL_EID_BYTEL1 = 0xFA
SL_EID_BYTEL2 = 0x0F
SL_EID_BYTE21 = 0xFC
SL_EID_BYTE22 = 0xC9
SL_FIRMWARE_REV1 = 0x84
SL_FIRMWARE_REV2 = 0xB8
}

Enum for Si70xx commands.

enum
SL_HUMIDITY
SL_TEMPERATURE
SL_LAST_MEASUREMENT
}

Enum for Temperature, Humidity measurement.

enum
SL_EID_FIRST_BYTE
SL_EID_SECOND_BYTE
SL_LAST_EID
}

Enum for electronic ID.

enum
SL_RH_T_USER_REG
SL_HEATER_CONTROL_REG
SL_LAST_CONTROL_REG
}

Enum for User, Heater control registers.

Typedefs#

typedef enum sl_si70xx_commands

Enum for Si70xx commands.

Enum for Temperature, Humidity measurement.

typedef enum sl_si70xx_eid_type

Enum for electronic ID.

typedef enum sl_si70xx_registers

Enum for User, Heater control registers.

Functions#

sl_status_t
sl_si91x_si70xx_init(sl_i2c_instance_t i2c_instance, uint8_t addr, sl_si70xx_eid_type_t eid)

Initialize the Si70xx sensor.

sl_status_t
sl_si91x_si70xx_is_present(sl_i2c_instance_t i2c_instance, uint8_t addr, sl_si70xx_eid_type_t eid)

Check whether an Si7006/13/20/21 is present on the I2C bus (or) not.

sl_status_t
sl_si91x_si70xx_measure_rh_and_temp(sl_i2c_instance_t i2c_instance, uint8_t addr, uint32_t *humid_data, int32_t *temp_data)

Measure relative humidity and temperature from Si7006/13/20/21 sensor.

sl_status_t
sl_si91x_si70xx_get_firmware_revision(sl_i2c_instance_t i2c_instance, uint8_t addr, uint8_t *firmware_revision)

Read Firmware Revision from Si7006/13/20/21 sensor.

sl_status_t
sl_si91x_si70xx_read_temp_from_rh(sl_i2c_instance_t i2c_instance, uint8_t addr, uint32_t *humid_data, int32_t *temp_data)

Reads temperature value from previous relative humidity measurement from Si7006/13/20/21 sensor.

sl_status_t
sl_si91x_si70xx_start_no_hold_measure_rh_or_temp(sl_i2c_instance_t i2c_instance, uint8_t addr, sl_si70xx_measurement_type_t type, uint32_t *data)

Start a no hold measurement of relative humidity (or) temperature from Si7006/13/20/21 sensor.

sl_status_t
sl_si91x_si70xx_measure_humidity(sl_i2c_instance_t i2c_instance, uint8_t addr, uint32_t *humid_data)

Measure relative humidity from Si7006/13/20/21 sensor.

sl_status_t
sl_si91x_si70xx_measure_temperature(sl_i2c_instance_t i2c_instance, uint8_t addr, int32_t *temp_data)

Measure temperature from Si7006/13/20/21 sensor.

sl_status_t
sl_si91x_si70xx_reset(sl_i2c_instance_t i2c_instance, uint8_t addr)

Initiates a si70xx software reset by the appropriate command.

sl_status_t
sl_si91x_si70xx_read_control_register(sl_i2c_instance_t i2c_instance, uint8_t addr, sl_si70xx_registers_t reg, uint8_t *data)

Reads the user register 1 and heater control register data.

sl_status_t
sl_si91x_si70xx_write_control_register(sl_i2c_instance_t i2c_instance, uint8_t addr, sl_si70xx_registers_t reg, uint8_t value)

Writes data to user register 1 and heater control register.

Macros#

#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

I2C2 base.

Enumeration Documentation#

sl_si70xx_commands#

sl_si70xx_commands

Enum for Si70xx commands.

Enumerator
SL_HUMIDITY_HM

Measure Relative Humidity, Hold Master Mode.

SL_HUMIDITY_NHM

Measure Relative Humidity, No Hold Master Mode.

SL_TEMPERATURE_HM

Measure Temperature, Hold Master Mode.

SL_TEMPERATURE_NHM

Measure Temperature, No Hold Master Mode.

SL_TEMPERATURE_AH

Read Temperature Value from Previous RH Measurement.

SL_SI70XX_RESET

Si70XX Reset.

SL_W_RHT_U_REG

Write RH/T User Register 1.

SL_R_RHT_U_REG

Read RH/T User Register 1.

SL_W_HEATER_C_REG

Write Heater Control Register.

SL_R_HEATER_C_REG

Read Heater Control Register.

SL_EID_BYTEL1

Read Electronic ID 1st Byte, first part.

SL_EID_BYTEL2

Read Electronic ID 1st Byte, second part.

SL_EID_BYTE21

Read Electronic ID 2nd Byte, first part.

SL_EID_BYTE22

Read Electronic ID 2nd Byte, second part.

SL_FIRMWARE_REV1

Read Firmware Revision, first part.

SL_FIRMWARE_REV2

Read Firmware Revision, second part.


Definition at line 60 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si70xx_measurement_type#

sl_si70xx_measurement_type

Enum for Temperature, Humidity measurement.

Enumerator
SL_HUMIDITY

Enumerator for humidity selection.

SL_TEMPERATURE

Enumerator for temperature selection.

SL_LAST_MEASUREMENT

Last enum for validation.


Definition at line 80 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si70xx_eid_type#

sl_si70xx_eid_type

Enum for electronic ID.

Enumerator
SL_EID_FIRST_BYTE

Enumerator for sending electronic ID first byte.

SL_EID_SECOND_BYTE

Enumerator for sending electronic ID second byte.

SL_LAST_EID

Last enum for validation.


Definition at line 87 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si70xx_registers#

sl_si70xx_registers

Enum for User, Heater control registers.

Enumerator
SL_RH_T_USER_REG

Enumerator for write RH/T user register selection.

SL_HEATER_CONTROL_REG

Enumerator for heater control register selection.

SL_LAST_CONTROL_REG

Last enum for validation.


Definition at line 94 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

Typedef Documentation#

sl_si70xx_commands_t#

typedef enum sl_si70xx_commands sl_si70xx_commands_t

Enum for Si70xx commands.


Definition at line 77 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si70xx_measurement_type_t#

typedef enum sl_si70xx_measurement_type sl_si70xx_measurement_type_t

Enum for Temperature, Humidity measurement.


Definition at line 84 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si70xx_eid_type_t#

typedef enum sl_si70xx_eid_type sl_si70xx_eid_type_t

Enum for electronic ID.


Definition at line 91 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si70xx_registers_t#

typedef enum sl_si70xx_registers sl_si70xx_registers_t

Enum for User, Heater control registers.


Definition at line 98 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

Function Documentation#

sl_si91x_si70xx_init#

sl_status_t sl_si91x_si70xx_init (sl_i2c_instance_t i2c_instance, uint8_t addr, sl_si70xx_eid_type_t eid)

Initialize the Si70xx sensor.

Parameters
[in]i2c_instance

: I2C peripheral to use.

[in]addr

: I2C address to probe.

[in]eid

: electronic ID of type sl_si70xx_eid_type_t.

Returns

  • The following values are returned:

    • SL_STATUS_OK on success

    • SL_STATUS_INITIALIZATION (0x0010) - no Si70xx device present

    • SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument


Definition at line 116 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si91x_si70xx_is_present#

sl_status_t sl_si91x_si70xx_is_present (sl_i2c_instance_t i2c_instance, uint8_t addr, sl_si70xx_eid_type_t eid)

Check whether an Si7006/13/20/21 is present on the I2C bus (or) not.

Parameters
[in]i2c_instance

: I2C peripheral to use.

[in]addr

: I2C address to probe.

[in]eid

: electronic ID of type sl_si70xx_eid_type_t. If SL_EID_FIRST_BYTE is selected, then EID 1st byte is considered. If SL_EID_SECOND_BYTE is selected, then EID 2nd byte is considered. For EID 1st byte, EID 2nd byte commands please look into datasheet. 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

Returns

  • The following values are returned:

    • SL_STATUS_OK on success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument


Definition at line 135 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si91x_si70xx_measure_rh_and_temp#

sl_status_t sl_si91x_si70xx_measure_rh_and_temp (sl_i2c_instance_t i2c_instance, uint8_t addr, uint32_t * humid_data, int32_t * temp_data)

Measure relative humidity and temperature from Si7006/13/20/21 sensor.

Parameters
[in]i2c_instance

: I2C peripheral to use.

[in]addr

: I2C address to probe.

[out]humid_data

: The relative humidity in percentage obtained after doing conversion as per formula mentioned in datasheet.

[out]temp_data

: The temperature in milliCelsius.

Returns

  • The following values are returned:

    • SL_STATUS_OK on success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer


Definition at line 152 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si91x_si70xx_get_firmware_revision#

sl_status_t sl_si91x_si70xx_get_firmware_revision (sl_i2c_instance_t i2c_instance, uint8_t addr, uint8_t * firmware_revision)

Read Firmware Revision from Si7006/13/20/21 sensor.

Parameters
[in]i2c_instance

: I2C peripheral to use.

[in]addr

: I2C address to probe.

[out]firmware_revision

: Internal firmware revision.

Returns

  • The following values are returned:

    • SL_STATUS_OK on success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer


Definition at line 170 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si91x_si70xx_read_temp_from_rh#

sl_status_t sl_si91x_si70xx_read_temp_from_rh (sl_i2c_instance_t i2c_instance, uint8_t addr, uint32_t * humid_data, int32_t * temp_data)

Reads temperature value from previous relative humidity measurement from Si7006/13/20/21 sensor.

Parameters
[in]i2c_instance

: I2C peripheral to use.

[in]addr

: I2C address to probe.

[out]humid_data

: The relative humidity in percent (multiplied by 1000).

[out]temp_data

: The temperature in milliCelsius.

Returns

  • The following values are returned:

    • SL_STATUS_OK on success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer


Definition at line 188 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si91x_si70xx_start_no_hold_measure_rh_or_temp#

sl_status_t sl_si91x_si70xx_start_no_hold_measure_rh_or_temp (sl_i2c_instance_t i2c_instance, uint8_t addr, sl_si70xx_measurement_type_t type, uint32_t * data)

Start a no hold measurement of relative humidity (or) temperature from Si7006/13/20/21 sensor.

Parameters
[in]i2c_instance

: I2C peripheral to use.

[in]addr

: I2C address to probe.

[in]type

: measurement value of type sl_si70xx_measurement_type_t.

[out]data

: The data read from the sensor.

Returns

  • The following values are returned:

    • SL_STATUS_OK on success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument


Definition at line 206 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si91x_si70xx_measure_humidity#

sl_status_t sl_si91x_si70xx_measure_humidity (sl_i2c_instance_t i2c_instance, uint8_t addr, uint32_t * humid_data)

Measure relative humidity from Si7006/13/20/21 sensor.

Parameters
[in]i2c_instance

: I2C peripheral to use.

[in]addr

: I2C address to probe.

[out]humid_data

: The relative humidity measurement.

Returns

  • The following values are returned:

    • SL_STATUS_OK on success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer


Definition at line 224 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si91x_si70xx_measure_temperature#

sl_status_t sl_si91x_si70xx_measure_temperature (sl_i2c_instance_t i2c_instance, uint8_t addr, int32_t * temp_data)

Measure temperature from Si7006/13/20/21 sensor.

Parameters
[in]i2c_instance

: I2C peripheral to use.

[in]addr

: I2C address to probe.

[out]temp_data

: The temperature measurement.

Returns

  • The following values are returned:

    • SL_STATUS_OK on success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer


Definition at line 239 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si91x_si70xx_reset#

sl_status_t sl_si91x_si70xx_reset (sl_i2c_instance_t i2c_instance, uint8_t addr)

Initiates a si70xx software reset by the appropriate command.

Parameters
[in]i2c_instance

: I2C peripheral to use.

[in]addr

: I2C address to probe.

Returns

  • The following values are returned:

    • SL_STATUS_OK on success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument


Definition at line 250 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si91x_si70xx_read_control_register#

sl_status_t sl_si91x_si70xx_read_control_register (sl_i2c_instance_t i2c_instance, uint8_t addr, sl_si70xx_registers_t reg, uint8_t * data)

Reads the user register 1 and heater control register data.

Parameters
[in]i2c_instance

: I2C peripheral to use.

[in]addr

: I2C address to probe.

[in]reg

: Register of type sl_si70xx_registers_t.

[out]data

: The data read from the sensor.

Returns

  • The following values are returned:

    • SL_STATUS_OK on success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument

    • SL_STATUS_NULL_POINTER (0x0022) - The parameter is null pointer


Definition at line 265 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

sl_si91x_si70xx_write_control_register#

sl_status_t sl_si91x_si70xx_write_control_register (sl_i2c_instance_t i2c_instance, uint8_t addr, sl_si70xx_registers_t reg, uint8_t value)

Writes data to user register 1 and heater control register.

Parameters
[in]i2c_instance

: I2C peripheral to use.

[in]addr

: I2C address to probe.

[in]reg

: Register of type sl_si70xx_registers_t.

[out]value

: The value written into the register.

Returns

  • The following values are returned:

    • SL_STATUS_OK on success

    • SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument


Definition at line 283 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

Macro Definition Documentation#

SI7006_ADDR#

#define SI7006_ADDR
Value:
0X40

I2C device address for Si7006.


Definition at line 50 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

SI7013_ADDR#

#define SI7013_ADDR
Value:
0x41

I2C device address for Si7013.


Definition at line 51 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

SI7020_ADDR#

#define SI7020_ADDR
Value:
0X40

I2C device address for Si7020.


Definition at line 52 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

SI7021_ADDR#

#define SI7021_ADDR
Value:
0x40

I2C device address for Si7021.


Definition at line 53 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h

I2C_BASE#

#define I2C_BASE
Value:
I2C2

I2C2 base.


Definition at line 54 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h