/* Measurement times */ #define HS3001_WAKEUP_TIME 100/* us */ #define HS3001_8BIT_RESOLUTION 550/* us */ #define HS3001_10BIT_RESOLUTION 1310/* us */ #define HS3001_12BIT_RESOLUTION 4500/* us */ #define HS3001_14BIT_RESOLUTION 16900/* us */
/* Definitions for Status Bits of A/D Data */ #define HS3001_DATA_VALID 0x00 /* Valid Data */ #define HS3001_DATA_STALE 0x01 /* Stale Data */
struct hs3001_data { struct i2c_client *client; struct mutex i2c_lock; /* lock for sending i2c commands */
u32 wait_time; /* in us */ int temperature; /* in milli degree */
u32 humidity; /* in milli % */
};
static umode_t hs3001_is_visible(constvoid *data, enum hwmon_sensor_types type,
u32 attr, int channel)
{ /* Both, humidity and temperature can only be read. */ return0444;
}
staticint hs3001_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{ struct hs3001_data *data = dev_get_drvdata(dev); struct i2c_client *client = data->client; int ret;
mutex_lock(&data->i2c_lock);
ret = i2c_master_send(client, NULL, 0); if (ret < 0) {
mutex_unlock(&data->i2c_lock); return ret;
}
MODULE_AUTHOR("Andre Werner <andre.werner@systec-electronic.com>");
MODULE_DESCRIPTION("HS3001 humidity and temperature sensor base driver");
MODULE_LICENSE("GPL");
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-09-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.