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
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SENSOR_DHT
|
|
|
|
#define _SENSOR_DHT
|
|
|
|
|
|
|
|
#include <device.h>
|
|
|
|
|
|
|
|
#define SYS_LOG_DOMAIN "DHT"
|
2016-10-06 00:49:41 +08:00
|
|
|
#define SYS_LOG_LEVEL CONFIG_SYS_LOG_SENSOR_LEVEL
|
2016-12-18 01:56:56 +08:00
|
|
|
#include <logging/sys_log.h>
|
2016-05-10 17:09:28 +08:00
|
|
|
|
|
|
|
#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;
|
2017-04-21 23:03:20 +08:00
|
|
|
u8_t sample[4];
|
2016-05-10 17:09:28 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|