2016-01-21 15:24:57 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Freie Universität Berlin
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ingroup drivers_dht
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
* @file
|
|
|
|
* @brief Default configuration for DHT devices
|
|
|
|
*
|
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DHT_PARAMS_H
|
|
|
|
#define DHT_PARAMS_H
|
|
|
|
|
|
|
|
#include "board.h"
|
2016-01-21 22:33:02 +01:00
|
|
|
#include "dht.h"
|
|
|
|
#include "saul_reg.h"
|
2016-01-21 15:24:57 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
2017-08-29 18:00:46 +02:00
|
|
|
* @name Set default configuration parameters for the DHT devices
|
2016-01-21 15:24:57 +01:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#ifndef DHT_PARAM_PIN
|
|
|
|
#define DHT_PARAM_PIN (GPIO_PIN(0, 0))
|
|
|
|
#endif
|
|
|
|
#ifndef DHT_PARAM_TYPE
|
|
|
|
#define DHT_PARAM_TYPE (DHT11)
|
|
|
|
#endif
|
2016-01-21 16:22:26 +01:00
|
|
|
#ifndef DHT_PARAM_PULL
|
2016-03-17 14:55:01 +01:00
|
|
|
#define DHT_PARAM_PULL (GPIO_IN_PU)
|
2016-01-21 16:22:26 +01:00
|
|
|
#endif
|
2018-02-28 16:33:42 +01:00
|
|
|
#ifndef DHT_PARAMS
|
|
|
|
#define DHT_PARAMS { .pin = DHT_PARAM_PIN, \
|
|
|
|
.type = DHT_PARAM_TYPE, \
|
|
|
|
.in_mode = DHT_PARAM_PULL }
|
|
|
|
#endif
|
|
|
|
#ifndef DHT_SAULINFO
|
|
|
|
#define DHT_SAULINFO { .name = "dht" }
|
|
|
|
#endif
|
2016-01-21 15:24:57 +01:00
|
|
|
/**@}*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Configure DHT devices
|
|
|
|
*/
|
|
|
|
static const dht_params_t dht_params[] =
|
|
|
|
{
|
2018-02-28 16:33:42 +01:00
|
|
|
DHT_PARAMS
|
2016-01-21 15:24:57 +01:00
|
|
|
};
|
|
|
|
|
2016-01-21 22:33:02 +01:00
|
|
|
/**
|
|
|
|
* @brief Allocate and configure entries to the SAUL registry
|
|
|
|
*/
|
2018-02-28 16:33:42 +01:00
|
|
|
static const saul_reg_info_t dht_saul_info[] =
|
2016-01-21 22:33:02 +01:00
|
|
|
{
|
2018-02-28 16:33:42 +01:00
|
|
|
DHT_SAULINFO
|
2016-01-21 22:33:02 +01:00
|
|
|
};
|
|
|
|
|
2016-01-21 15:24:57 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* DHT_PARAMS_H */
|
|
|
|
/** @} */
|