Driver for the ST HTS221 digital Humidity Sensor.
More...
Driver for the ST HTS221 digital Humidity Sensor.
This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.
|
file | hts221_params.h |
| Default configuration for ST HTS221 devices.
|
|
file | hts221_regs.h |
| Register definitions for ST HTS221 devices.
|
|
file | hts221.h |
| Interface definition for the ST HTS221 driver.
|
|
|
enum | { HTS221_OK = 0,
HTS221_ERROR,
HTS221_NOBUS,
HTS221_NODEV
} |
| Return values and error codes.
|
|
◆ hts221_get_state()
int hts221_get_state |
( |
const hts221_t * |
dev | ) |
|
Set device to power down.
- Parameters
-
[in] | dev | device descriptor of sensor |
- Returns
- >=0 on success
-
-HTS221_NOBUS on error
◆ hts221_init()
Initialize the given HTS221 device.
- Parameters
-
[out] | dev | device descriptor of sensor to initialize |
[in] | params | configuration parameters |
- Returns
- HTS221_OK on success
-
HTS221_NOBUS if initialization of I2C bus fails
-
HTS221_NODEV if no HTS221 device found on bus
◆ hts221_one_shot()
int hts221_one_shot |
( |
const hts221_t * |
dev | ) |
|
Set device to one shot measurement.
- Parameters
-
[in] | dev | device descriptor of sensor |
- Returns
- 0 on success, or error otherwise
◆ hts221_power_off()
int hts221_power_off |
( |
const hts221_t * |
dev | ) |
|
Set device to power down.
- Parameters
-
[in] | dev | device descriptor of sensor |
- Returns
- 0 on success, or error otherwise
◆ hts221_power_on()
int hts221_power_on |
( |
const hts221_t * |
dev | ) |
|
Set device to active.
- Parameters
-
[in] | dev | device descriptor of sensor |
- Returns
- 0 on success, or error otherwise
◆ hts221_read_humidity()
int hts221_read_humidity |
( |
const hts221_t * |
dev, |
|
|
uint16_t * |
val |
|
) |
| |
Reading humidity and temperature.
- Parameters
-
[in] | dev | device descriptor of sensor |
[out] | val | humidity [in 10 * percent relative] |
- Returns
- 0 on success, or error otherwise
◆ hts221_read_temperature()
int hts221_read_temperature |
( |
const hts221_t * |
dev, |
|
|
int16_t * |
val |
|
) |
| |
Reading humidity and temperature.
- Parameters
-
[in] | dev | device descriptor of sensor |
[out] | val | temperature [in 100 * degree centigrade] |
- Returns
- 0 on success, or error otherwise
◆ hts221_reboot()
int hts221_reboot |
( |
const hts221_t * |
dev | ) |
|
Reboot device and reload base configuration.
- Parameters
-
[in] | dev | device descriptor of sensor |
- Returns
- 0 on success, or error otherwise
◆ hts221_set_rate()
int hts221_set_rate |
( |
const hts221_t * |
dev, |
|
|
const uint8_t |
rate |
|
) |
| |
Set device to continuous measurements.
- Parameters
-
[in] | dev | device descriptor of sensor |
[in] | rate | conversion rate for continuous mode |
- Returns
- 0 on success, or error otherwise