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 for Si70xx commands.
Enum for Temperature, Humidity measurement.
Enum for User, Heater control registers.
Typedefs#
Enum for Si70xx commands.
Enum for Temperature, Humidity measurement.
Enum for electronic ID.
Enum for User, Heater control registers.
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 Si7006/13/20/21 sensor.
Read Firmware Revision from Si7006/13/20/21 sensor.
Reads temperature value from previous relative humidity measurement from Si7006/13/20/21 sensor.
Start a no hold measurement of relative humidity (or) temperature from Si7006/13/20/21 sensor.
Measure relative humidity from Si7006/13/20/21 sensor.
Measure temperature from Si7006/13/20/21 sensor.
Initiates a si70xx software reset by the appropriate command.
Reads the user register 1 and heater control register data.
Writes data to user register 1 and heater control register.
Macros#
I2C device address for Si7006.
I2C device address for Si7013.
I2C device address for Si7020.
I2C device address for Si7021.
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. |
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. |
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. |
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. |
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.
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.
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.
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.
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.
[in] | i2c_instance | : I2C peripheral to use. |
[in] | addr | : I2C address to probe. |
[in] | eid | : electronic ID of type sl_si70xx_eid_type_t. |
Pre-conditions:
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
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.
[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 |
Pre-conditions:
Returns
The following values are returned:
SL_STATUS_OK on success
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument
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.
[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. |
Pre-conditions:
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
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.
[in] | i2c_instance | : I2C peripheral to use. |
[in] | addr | : I2C address to probe. |
[out] | firmware_revision | : Internal firmware revision. |
Pre-conditions:
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
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.
[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. |
Pre-conditions:
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
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.
[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. |
Pre-conditions:
Returns
The following values are returned:
SL_STATUS_OK on success
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument
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.
[in] | i2c_instance | : I2C peripheral to use. |
[in] | addr | : I2C address to probe. |
[out] | humid_data | : The relative humidity measurement. |
Pre-conditions:
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
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.
[in] | i2c_instance | : I2C peripheral to use. |
[in] | addr | : I2C address to probe. |
[out] | temp_data | : The temperature measurement. |
Pre-conditions:
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
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.
[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
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.
[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. |
Pre-conditions:
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
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.
[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. |
Pre-conditions:
Returns
The following values are returned:
SL_STATUS_OK on success
SL_STATUS_INVALID_PARAMETER (0x0021) - The parameter is invalid argument
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_ADDRValue:
0X40
I2C device address for Si7006.
50
of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h
SI7013_ADDR#
#define SI7013_ADDRValue:
0x41
I2C device address for Si7013.
51
of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h
SI7020_ADDR#
#define SI7020_ADDRValue:
0X40
I2C device address for Si7020.
52
of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h
SI7021_ADDR#
#define SI7021_ADDRValue:
0x40
I2C device address for Si7021.
53
of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h
I2C_BASE#
#define I2C_BASEValue:
I2C2
I2C2 base.
54
of file components/device/silabs/si91x/mcu/drivers/hardware_drivers/si70xx_sensor/inc/sl_si91x_si70xx.h