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

Merge pull request #13881 from akshaim/kconfig_ads101x

drivers/ads101x : Expose Configurations to Kconfig
This commit is contained in:
Leandro Lanzieri 2020-04-17 15:39:07 +02:00 committed by GitHub
commit 2f75c60527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 3 deletions

View File

@ -10,5 +10,6 @@ source "$(RIOTCPU)/nrf52/radio/nrf802154/Kconfig"
endmenu # Network Device Drivers
menu "Sensor Device Drivers"
rsource "ads101x/Kconfig"
rsource "hdc1000/Kconfig"
endmenu # Sensor Device Drivers

24
drivers/ads101x/Kconfig Normal file
View File

@ -0,0 +1,24 @@
# Copyright (c) 2020 Freie Universitaet 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.
#
menuconfig KCONFIG_MODULE_ADS101X
bool "Configure ADS101X driver"
depends on MODULE_ADS101X
help
Configure the ADS101X driver using Kconfig.
if KCONFIG_MODULE_ADS101X
config ADS101X_I2C_ADDRESS
hex "Default I2C address"
range 0x48 0x51
default 0x48
help
ADS101X allows for upto 4 devices on Single Bus. The value depends on
the state of ADDR Pin. Default value (0x48) corresponds to ADDR pin tied
to GND. For more information refer I2C Address Selection in Datasheet.
endif # KCONFIG_MODULE_ADS101X

View File

@ -38,7 +38,7 @@ extern "C" {
#define ADS101X_PARAM_I2C (I2C_DEV(0))
#endif
#ifndef ADS101X_PARAM_ADDR
#define ADS101X_PARAM_ADDR (ADS101X_I2C_ADDRESS)
#define ADS101X_PARAM_ADDR (CONFIG_ADS101X_I2C_ADDRESS)
#endif
#ifndef ADS101X_PARAM_MUX_GAIN
#define ADS101X_PARAM_MUX_GAIN (ADS101X_AIN0_DIFFM_AIN1 \

View File

@ -49,8 +49,8 @@ extern "C" {
*
* Address pin tied to: GND (0x48), Vcc (0x49), SDA (0x50), SCL (0x51)
*/
#ifndef ADS101X_I2C_ADDRESS
#define ADS101X_I2C_ADDRESS (0x48)
#ifndef CONFIG_ADS101X_I2C_ADDRESS
#define CONFIG_ADS101X_I2C_ADDRESS (0x48)
#endif
/** @} */