1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/adcxxc1: expose configuration via config group

This commit is contained in:
Leandro Lanzieri 2019-05-08 15:11:25 +02:00
parent 110a410860
commit ef6207da06

View File

@ -14,6 +14,7 @@
* @brief Default configuration for ADCXX1C devices * @brief Default configuration for ADCXX1C devices
* *
* @author Vincent Dupont <vincent@otakeys.com> * @author Vincent Dupont <vincent@otakeys.com>
* @}
*/ */
#ifndef ADCXX1C_PARAMS_H #ifndef ADCXX1C_PARAMS_H
@ -28,34 +29,56 @@ extern "C" {
#endif #endif
/** /**
* @name Set default configuration parameters for the ADCXX1C driver * @defgroup drivers_adcxx1c_conf ADCXX1C driver compile configurations
* @ingroup drivers_adcxx1c
* @ingroup config
* @{ * @{
*/ */
/** @brief I2C device to use */
#ifndef ADCXX1C_PARAM_I2C #ifndef ADCXX1C_PARAM_I2C
#define ADCXX1C_PARAM_I2C (I2C_DEV(0)) #define ADCXX1C_PARAM_I2C (I2C_DEV(0))
#endif #endif
/** @brief I2C address */
#ifndef ADCXX1C_PARAM_ADDR #ifndef ADCXX1C_PARAM_ADDR
#define ADCXX1C_PARAM_ADDR (ADCXX1C_I2C_ADDRESS) #define ADCXX1C_PARAM_ADDR (ADCXX1C_I2C_ADDRESS)
#endif #endif
/** @brief Resolution in bits */
#ifndef ADCXX1C_PARAM_BITS #ifndef ADCXX1C_PARAM_BITS
#define ADCXX1C_PARAM_BITS (ADCXX1C_RES_DEFAULT) #define ADCXX1C_PARAM_BITS (ADCXX1C_RES_DEFAULT)
#endif #endif
/** @brief Conversion interval */
#ifndef ADCXX1C_PARAM_CYCLE #ifndef ADCXX1C_PARAM_CYCLE
#define ADCXX1C_PARAM_CYCLE (ADCXX1C_CYCLE_DISABLED) #define ADCXX1C_PARAM_CYCLE (ADCXX1C_CYCLE_DISABLED)
#endif #endif
/** @brief Alert gpio pin */
#ifndef ADCXX1C_PARAM_ALERT_PIN #ifndef ADCXX1C_PARAM_ALERT_PIN
#define ADCXX1C_PARAM_ALERT_PIN (GPIO_UNDEF) #define ADCXX1C_PARAM_ALERT_PIN (GPIO_UNDEF)
#endif #endif
/** @brief Low limit for the alert */
#ifndef ADCXX1C_PARAM_LOW_LIMIT #ifndef ADCXX1C_PARAM_LOW_LIMIT
#define ADCXX1C_PARAM_LOW_LIMIT (0) #define ADCXX1C_PARAM_LOW_LIMIT (0)
#endif #endif
/** @brief High limit for the alert */
#ifndef ADCXX1C_PARAM_HIGH_LIMIT #ifndef ADCXX1C_PARAM_HIGH_LIMIT
#define ADCXX1C_PARAM_HIGH_LIMIT (0) #define ADCXX1C_PARAM_HIGH_LIMIT (0)
#endif #endif
/** @brief Hysteresis for the alert */
#ifndef ADCXX1C_PARAM_HYSTERESIS #ifndef ADCXX1C_PARAM_HYSTERESIS
#define ADCXX1C_PARAM_HYSTERESIS (0) #define ADCXX1C_PARAM_HYSTERESIS (0)
#endif #endif
/** @} */
/**
* @brief ADCXX1C driver configuration structures
*/
#ifndef ADCXX1C_PARAMS #ifndef ADCXX1C_PARAMS
#define ADCXX1C_PARAMS { .i2c = ADCXX1C_PARAM_I2C, \ #define ADCXX1C_PARAMS { .i2c = ADCXX1C_PARAM_I2C, \
.addr = ADCXX1C_PARAM_ADDR, \ .addr = ADCXX1C_PARAM_ADDR, \
@ -66,10 +89,13 @@ extern "C" {
.high_limit = ADCXX1C_PARAM_HIGH_LIMIT, \ .high_limit = ADCXX1C_PARAM_HIGH_LIMIT, \
.hysteresis = ADCXX1C_PARAM_HYSTERESIS } .hysteresis = ADCXX1C_PARAM_HYSTERESIS }
#endif #endif
/**
* @brief ADCXX1C driver SAUL registry information structures
*/
#ifndef ADCXX1C_SAUL_INFO #ifndef ADCXX1C_SAUL_INFO
#define ADCXX1C_SAUL_INFO { .name = "adcxx1c" } #define ADCXX1C_SAUL_INFO { .name = "adcxx1c" }
#endif #endif
/** @} */
/** /**
* @brief ADCXX1C configuration * @brief ADCXX1C configuration
@ -93,4 +119,3 @@ static const saul_reg_info_t adcxx1c_saul_info[] =
#endif #endif
#endif /* ADCXX1C_PARAMS_H */ #endif /* ADCXX1C_PARAMS_H */
/** @} */