Driver for the Si7006/13/20/21 temperature and humidity sensor.
More...
Driver for the Si7006/13/20/21 temperature and humidity sensor.
This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.
◆ anonymous enum
Driver return codes.
Enumerator |
---|
SI70XX_OK | All OK.
|
SI70XX_ERR_NODEV | No valid device found on I2C bus.
|
SI70XX_ERR_I2C | An error occurred when reading/writing on I2C bus.
|
Definition at line 36 of file si70xx.h.
◆ si70xx_get_both()
void si70xx_get_both |
( |
const si70xx_t * |
dev, |
|
|
uint16_t * |
humidity, |
|
|
int16_t * |
temperature |
|
) |
| |
Read the relative humidity and temperature from the sensor.
Uses clock stretching.
- Parameters
-
[in] | dev | device descriptor |
[out] | humidity | pointer to relative humidity (in centi-percent) |
[out] | temperature | pointer to temperature (in centi-degrees Celsius) |
◆ si70xx_get_id()
uint8_t si70xx_get_id |
( |
const si70xx_t * |
dev | ) |
|
Read the sensor id, to identifier the sensor variant.
- Parameters
-
- Returns
- device id
◆ si70xx_get_relative_humidity()
uint16_t si70xx_get_relative_humidity |
( |
const si70xx_t * |
dev | ) |
|
Read the relative humidity from the sensor.
Uses clock stretching.
- Parameters
-
- Returns
- relative humidity in centi-percent (times 100)
◆ si70xx_get_revision()
uint8_t si70xx_get_revision |
( |
const si70xx_t * |
dev | ) |
|
Read the firmware revision of the sensor.
- Parameters
-
- Returns
- sensor firmware revision number
◆ si70xx_get_serial()
uint64_t si70xx_get_serial |
( |
const si70xx_t * |
dev | ) |
|
Read the sensor serial number.
- Parameters
-
- Returns
- sensor serial number
◆ si70xx_get_temperature()
int16_t si70xx_get_temperature |
( |
const si70xx_t * |
dev | ) |
|
Read the current temperature from the sensor.
Uses clock stretching.
- Parameters
-
- Returns
- current temperature in centi-degrees Celsius (times 100)
◆ si70xx_init()
Initialize and reset the sensor.
- Parameters
-
[in] | dev | device descriptor |
[in] | params | initialization parameters |
- Returns
- SI70XX_OK on successful initialization
-
-SI70XX_ERR_NOI2C on I2C initialization error
-
-SI70XX_ERR_NODEV on device test error
-
-SI70XX_ERR_I2C on I2C bus error