2016-05-10 17:09:28 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Intel Corporation
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-05-10 17:09:28 +08:00
|
|
|
*/
|
|
|
|
|
2018-09-15 01:43:44 +08:00
|
|
|
#ifndef ZEPHYR_DRIVERS_SENSOR_DHT_DHT_H_
|
|
|
|
#define ZEPHYR_DRIVERS_SENSOR_DHT_DHT_H_
|
2016-05-10 17:09:28 +08:00
|
|
|
|
|
|
|
#include <device.h>
|
|
|
|
|
|
|
|
#define DHT_START_SIGNAL_DURATION 18000
|
|
|
|
#define DHT_SIGNAL_MAX_WAIT_DURATION 100
|
|
|
|
#define DHT_DATA_BITS_NUM 40
|
|
|
|
|
|
|
|
struct dht_data {
|
|
|
|
struct device *gpio;
|
2020-05-28 00:26:57 +08:00
|
|
|
uint8_t sample[4];
|
2016-05-10 17:09:28 +08:00
|
|
|
};
|
|
|
|
|
2019-12-16 23:59:39 +08:00
|
|
|
struct dht_config {
|
|
|
|
const char *ctrl;
|
2020-02-04 07:20:19 +08:00
|
|
|
gpio_dt_flags_t flags;
|
2019-12-19 23:30:11 +08:00
|
|
|
gpio_pin_t pin;
|
2019-12-16 23:59:39 +08:00
|
|
|
};
|
|
|
|
|
2016-05-10 17:09:28 +08:00
|
|
|
#endif
|