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