Si70XX Sensor#

Introduction#

The Si70xx sensor driver offers a set of functions for interacting with the Si70xx sensor series over the I2C bus. It facilitates the integration of the sensor by providing access to features such as temperature and humidity measurements, firmware revision retrieval, and device presence detection. All Si70xx functions are managed through the generic driver.

Usage#

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

  1. Initialize the Si70xx sensor:sl_si91x_si70xx_init

  2. Check whether an Si7006/13/20/21 is present on the I2C bus:sl_si91x_si70xx_is_present

  3. Measure relative humidity and temperature from the Si7006/13/20/21 sensor:sl_si91x_si70xx_measure_rh_and_temp

  4. Read firmware revision from the Si7006/13/20/21 sensor:sl_si91x_si70xx_get_firmware_revision

  5. Initiate a Si70xx software reset using the appropriate command:sl_si91x_si70xx_reset

  • See the Function Documentation for the usage information 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 and Humidity measurement types.

enum
SL_EID_FIRST_BYTE
SL_EID_SECOND_BYTE
SL_LAST_EID
}

To specify the type of electronic ID byte to be sent.

enum
SL_RH_T_USER_REG
SL_HEATER_CONTROL_REG
SL_LAST_CONTROL_REG
}

To specify the RH/T (Relative Humidity & Temperature) User Register and Heater Control Registers.

Typedefs#

typedef enum sl_si70xx_commands

Enum for Si70xx commands.

Enum for Temperature and Humidity measurement types.

typedef enum sl_si70xx_eid_type

To specify the type of electronic ID byte to be sent.

typedef enum sl_si70xx_registers

To specify the RH/T (Relative Humidity & Temperature) User Register and 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)

To 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)

To check whether an Si7006/13/20/21 is present on the I2C bus.

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)

To 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)

To read the firmware revision from the 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)

To read the temperature value from the previous relative humidity measurement from the 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)

To start a no-hold measurement of relative humidity or temperature from the 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)

To measure relative humidity from the 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)

To measure temperature from the Si7006/13/20/21 sensor.

sl_status_t
sl_si91x_si70xx_reset(sl_i2c_instance_t i2c_instance, uint8_t addr)

To initiate a software reset for the Si70xx sensor.

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)

To read the RH/T user register and heater control register data from the Si70xx sensor.

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)

To write data to RH/T user register 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.

This enumeration defines the command codes used to interact with the Si70xx sensor family. These commands are used to measure humidity and temperature, read and write user registers, control the heater, and read the electronic ID and firmware revision.

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 69 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 and Humidity measurement types.

This enumeration defines the types of measurements that can be performed by the Si70xx sensor. It includes options for measuring humidity and temperature, as well as a validation enum.

Enumerator
SL_HUMIDITY

Enumerator for humidity selection.

SL_TEMPERATURE

Enumerator for temperature selection.

SL_LAST_MEASUREMENT

Last enum for validation.


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

To specify the type of electronic ID byte to be sent.

This enumeration defines the types of electronic ID bytes that can be sent to the Si70xx sensor. It includes options for sending the first and second bytes of the electronic ID, as well as a validation enum.

Enumerator
SL_EID_FIRST_BYTE

Enumerator for sending the first byte of the electronic ID.

SL_EID_SECOND_BYTE

Enumerator for sending the second byte of the electronic ID.

SL_LAST_EID

Last enum for validation.


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

sl_si70xx_registers#

sl_si70xx_registers

To specify the RH/T (Relative Humidity & Temperature) User Register and Heater Control Registers.

This enumeration defines the register types used for configuring the Si70xx sensor. It includes options for the RH/T user register and the heater control register, as well as a validation enum.

Enumerator
SL_RH_T_USER_REG

Enumerator for 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 121 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.

This enumeration defines the command codes used to interact with the Si70xx sensor family. These commands are used to measure humidity and temperature, read and write user registers, control the heater, and read the electronic ID and firmware revision.


Definition at line 86 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 and Humidity measurement types.

This enumeration defines the types of measurements that can be performed by the Si70xx sensor. It includes options for measuring humidity and temperature, as well as a validation enum.


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

To specify the type of electronic ID byte to be sent.

This enumeration defines the types of electronic ID bytes that can be sent to the Si70xx sensor. It includes options for sending the first and second bytes of the electronic ID, as well as a validation enum.


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

To specify the RH/T (Relative Humidity & Temperature) User Register and Heater Control Registers.

This enumeration defines the register types used for configuring the Si70xx sensor. It includes options for the RH/T user register and the heater control register, as well as a validation enum.


Definition at line 125 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)

To initialize the Si70xx sensor.

Parameters
[in]i2c_instance

Select the I2C instance from sl_i2c_instance_t.

[in]addr

I2C address for Si70xx.

[in]eid

Electronic ID of type sl_si70xx_eid_type_t.

This API initializes the Si70xx sensor and must be called before using other functions.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK (0x0000) - Success.

    • SL_STATUS_INITIALIZATION (0x0010) - No Si70xx device present.

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

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 150 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)

To check whether an Si7006/13/20/21 is present on the I2C bus.

Parameters
[in]i2c_instance

Select the I2C instance from sl_i2c_instance_t.

[in]addr

I2C device address for Si70xx.

[in]eid

Electronic ID of type sl_si70xx_eid_type_t.

This API checks whether an Si7006/13/20/21 sensor is present on the I2C bus based on the provided Electronic ID (EID). If SL_EID_FIRST_BYTE is selected, the first byte of the EID is considered. If SL_EID_SECOND_BYTE is selected, the second byte of the EID is considered. For details on EID commands, see the sensor's datasheet. The device ID from SNB_3 is written if the device responds. Pass NULL to discard. Expected values: 0x0D for Si7013, 0x14 for Si7020, or 0x15 for Si7021.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK (0x0000) - Success.

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

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 173 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)

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

Parameters
[in]i2c_instance

Select the I2C instance from sl_i2c_instance_t.

[in]addr

I2C device address for Si70xx.

[out]humid_data

The relative humidity in percentage.

[out]temp_data

The temperature in degrees Celsius.

This API is used to measure relative humidity in percentage and temperature in degrees Celsius from the Si70xx sensor. The relative humidity and temperature values are obtained after conversion as per the formula mentioned in the datasheet.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK (0x0000) - Success.

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

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

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 194 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)

To read the firmware revision from the Si7006/13/20/21 sensor.

Parameters
[in]i2c_instance

Select the I2C instance from sl_i2c_instance_t.

[in]addr

I2C device address for Si70xx.

[out]firmware_revision

Pointer to store the internal firmware revision.

This API reads the firmware revision from the Si70xx sensor. The firmware revision provides information about the internal firmware version of the sensor.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK (0x0000) - Success.

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

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

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 216 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)

To read the temperature value from the previous relative humidity measurement from the Si7006/13/20/21 sensor.

Parameters
[in]i2c_instance

Select the I2C instance from sl_i2c_instance_t.

[in]addr

I2C device address for Si70xx.

[out]humid_data

The relative humidity in percent.

[out]temp_data

The temperature in degrees Celsius.

This API reads the temperature (in degrees Celsius) from the previous relative humidity measurement (in percent) from the Si70xx sensor.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK (0x0000) - Success.

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

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

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 238 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)

To start a no-hold measurement of relative humidity or temperature from the Si7006/13/20/21 sensor.

Parameters
[in]i2c_instance

Select the I2C instance from sl_i2c_instance_t.

[in]addr

I2C device address for Si70xx.

[in]type

Measurement type of sl_si70xx_measurement_type_t.

[out]data

The data read from the sensor.

This API starts a no-hold measurement (not acknowledging read requests) of relative humidity or temperature from the Si70xx sensor. The measurement type is specified by the type parameter, which can be either relative humidity or temperature.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK (0x0000) - Success.

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

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 261 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)

To measure relative humidity from the Si7006/13/20/21 sensor.

Parameters
[in]i2c_instance

Select the I2C instance from sl_i2c_instance_t.

[in]addr

I2C device address for Si70xx.

[out]humid_data

The relative humidity measurement.

This API is used to measure the relative humidity from the Si70xx sensor. The relative humidity value is returned in the humid_data parameter.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK (0x0000) - Success.

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

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

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 283 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)

To measure temperature from the Si7006/13/20/21 sensor.

Parameters
[in]i2c_instance

Select the I2C instance from sl_i2c_instance_t.

[in]addr

I2C device address for Si70xx.

[out]temp_data

The temperature measurement.

This API is used to measure the temperature from the Si70xx sensor. The temperature value is returned in the temp_data parameter.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK (0x0000) - Success.

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

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

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 302 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)

To initiate a software reset for the Si70xx sensor.

Parameters
[in]i2c_instance

Select the I2C instance from sl_i2c_instance_t.

[in]addr

I2C device address for Si70xx.

This API initiates a software reset for the Si70xx sensor using the appropriate command. It is used to reset the sensor to its default state.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK (0x0000) - Success.

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

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 320 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)

To read the RH/T user register and heater control register data from the Si70xx sensor.

Parameters
[in]i2c_instance

Select the I2C instance from sl_i2c_instance_t.

[in]addr

I2C device address for Si70xx.

[in]reg

Register of type sl_si70xx_registers_t.

[out]data

The data read from the sensor.

This API reads the RH/T user register and heater control register data from the Si70xx sensor. The register to be read is specified by the reg parameter, which can be either the RH/T user register or the heater control register.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK (0x0000) - Success.

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

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

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 341 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)

To write data to RH/T user register and heater control register.

Parameters
[in]i2c_instance

Select the I2C instance from sl_i2c_instance_t.

[in]addr

I2C device address for Si70xx.

[in]reg

Register of type sl_si70xx_registers_t.

[in]value

The value to be written into the register.

This API is used to write data to the RH/T user register and heater control register of the Si70xx sensor. The register to be written is specified by the reg parameter, which can be either the RH/T user register or the heater control register.

Returns

  • sl_status_t Status code indicating the result:

    • SL_STATUS_OK (0x0000) - Success.

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

For more information on status codes, see SL STATUS DOCUMENTATION.


Definition at line 364 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 52 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 53 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 54 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 55 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 56 of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h