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

Merge pull request #15466 from leandrolanzieri/pr/kconfig_drivers_bc

drivers/{b,c}*: model modules in Kconfig
This commit is contained in:
Francisco 2020-11-26 10:44:28 +01:00 committed by GitHub
commit 47ed64fcfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 343 additions and 1 deletions

View File

@ -6,7 +6,8 @@
tests/driver_ad7746 tests/driver_adcxx1c tests/driver_ads101x tests/driver_adt101x
tests/driver_adt7310 tests/driver_adxl345 tests/driver_aip31068 tests/driver_apa102
tests/driver_apds99xx tests/driver_apds99xx_full tests/driver_at tests/driver_at24cxxx
tests/driver_at24mac tests/driver_at25xxx tests/driver_at30tse75x tests/driver_ata8520e"}
tests/driver_at24mac tests/driver_at25xxx tests/driver_at30tse75x tests/driver_ata8520e
tests/driver_b* tests/driver_ccs811 tests/driver_ccs811_full"}
: ${TEST_KCONFIG_native:="examples/hello-world tests/periph_*"}
export RIOT_CI_BUILD=1

View File

@ -378,6 +378,8 @@ ifeq (1,$(TEST_KCONFIG))
$(info === [ATTENTION] Testing Kconfig dependency modelling ===)
KCONFIG_MODULES := $(call lowercase,$(patsubst CONFIG_MODULE_%,%,$(filter CONFIG_MODULE_%,$(.VARIABLES))))
USEMODULE := $(KCONFIG_MODULES)
KCONFIG_PACKAGES := $(call lowercase,$(patsubst CONFIG_PACKAGE_%,%,$(filter CONFIG_PACKAGE_%,$(.VARIABLES))))
USEPKG := $(KCONFIG_PACKAGES)
else
# check if required features are provided and update $(FEATURES_USED)
include $(RIOTMAKE)/features_check.inc.mk

View File

@ -22,3 +22,5 @@ config BOARD_SAMR21_XPRO
select HAS_PERIPH_UART_HW_FC
select HAS_PERIPH_USBDEV
select HAS_RIOTBOOT
select HAVE_SAUL_GPIO

View File

@ -6,6 +6,8 @@
menu "Drivers"
rsource "saul/Kconfig"
menu "Actuator Device Drivers"
rsource "aip31068/Kconfig"
rsource "apa102/Kconfig"
@ -31,7 +33,13 @@ rsource "adt7310/Kconfig"
rsource "adxl345/Kconfig"
rsource "apds99xx/Kconfig"
rsource "at30tse75x/Kconfig"
rsource "bh1750fvi/Kconfig"
rsource "bh1900nux/Kconfig"
rsource "bme680/Kconfig"
rsource "bmp180/Kconfig"
rsource "bmx055/Kconfig"
rsource "bmx280/Kconfig"
rsource "ccs811/Kconfig"
rsource "fxos8700/Kconfig"
rsource "gp2y10xx/Kconfig"
rsource "hdc1000/Kconfig"

View File

@ -7,6 +7,7 @@
menu "Network Device Drivers"
rsource "at86rf215/Kconfig"
rsource "ata8520e/Kconfig"
rsource "can_trx/Kconfig"
rsource "cc110x/Kconfig"
rsource "dose/Kconfig"
rsource "mrf24j40/Kconfig"

13
drivers/bh1750fvi/Kconfig Normal file
View File

@ -0,0 +1,13 @@
# Copyright (c) 2020 HAW Hamburg
#
# 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.
#
config MODULE_BH1750FVI
bool "BH1750FVI ambient light sensor"
depends on HAS_PERIPH_I2C
depends on TEST_KCONFIG
select MODULE_PERIPH_I2C
select MODULE_XTIMER

12
drivers/bh1900nux/Kconfig Normal file
View File

@ -0,0 +1,12 @@
# Copyright (c) 2020 HAW Hamburg
#
# 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.
#
config MODULE_BH1900NUX
bool "BH1900NUX temperature sensor"
depends on HAS_PERIPH_I2C
depends on TEST_KCONFIG
select MODULE_PERIPH_I2C

38
drivers/bme680/Kconfig Normal file
View File

@ -0,0 +1,38 @@
# Copyright (c) 2020 HAW Hamburg
#
# 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 MODULE_BME680
bool "BME680 Temperature/Humidity/Pressure/Gas sensor"
depends on TEST_KCONFIG
select PACKAGE_DRIVER_BME680
select MODULE_XTIMER if MODULE_SAUL
if MODULE_BME680
choice
bool "Device interface"
help
The device can be connected via different buses, select one.
config MODULE_BME680_I2C
bool "I2C"
depends on HAS_PERIPH_I2C
select MODULE_PERIPH_I2C
config MODULE_BME680_SPI
bool "SPI"
depends on HAS_PERIPH_SPI
depends on HAS_PERIPH_GPIO
select MODULE_PERIPH_SPI
select MODULE_PERIPH_GPIO
endchoice
config MODULE_BME680_FP
bool "Enable floating point"
endif # MODULE_BME680

13
drivers/bmp180/Kconfig Normal file
View File

@ -0,0 +1,13 @@
# Copyright (c) 2020 HAW Hamburg
#
# 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.
#
config MODULE_BMP180
bool "BMP180 temperature and pressure sensor"
depends on HAS_PERIPH_I2C
depends on TEST_KCONFIG
select MODULE_PERIPH_I2C
select MODULE_XTIMER

View File

@ -1,9 +1,18 @@
# Copyright (c) 2020 Freie Universitaet Berlin
# 2020 HAW Hamburg
#
# 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.
#
config MODULE_BMX055
bool "BMX055 9-axis sensor"
depends on HAS_PERIPH_I2C
depends on TEST_KCONFIG
select MODULE_PERIPH_I2C
default y if HAVE_BMX055 && MODULE_SAUL_DEFAULT
menuconfig KCONFIG_USEMODULE_BMX055
bool "Configure BMX055 driver"
depends on USEMODULE_BMX055
@ -40,3 +49,8 @@ config BMX055_GYRO_ADDR_DEFAULT
Circuit (I²C)' in the datasheet.
endif # KCONFIG_USEMODULE_BMX055
config HAVE_BMX055
bool
help
Indicates that a BMX055 9-axis sensor is present.

48
drivers/bmx280/Kconfig Normal file
View File

@ -0,0 +1,48 @@
# Copyright (c) 2020 HAW Hamburg
#
# 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.
#
choice
bool "BMx280 Temperature, pressure and humidity sensors"
optional
help
The driver supports both BME280 and BMP280 connected either via SPI or
I2C bus. Select one combination.
config MODULE_BME280_I2C
bool "BME280 on I2C"
depends on HAS_PERIPH_I2C
select MODULE_PERIPH_I2C
select MODULE_BMX280
config MODULE_BME280_SPI
bool "BME280 on SPI"
depends on HAS_PERIPH_SPI
depends on HAS_PERIPH_GPIO
select MODULE_PERIPH_SPI
select MODULE_PERIPH_GPIO
select MODULE_BMX280
config MODULE_BMP280_I2C
bool "BMP280 on I2C"
depends on HAS_PERIPH_I2C
select MODULE_PERIPH_I2C
select MODULE_BMX280
config MODULE_BMP280_SPI
bool "BMP280 on SPI"
depends on HAS_PERIPH_SPI
depends on HAS_PERIPH_GPIO
select MODULE_PERIPH_SPI
select MODULE_PERIPH_GPIO
select MODULE_BMX280
endchoice
config MODULE_BMX280
bool
depends on TEST_KCONFIG
select MODULE_XTIMER

10
drivers/can_trx/Kconfig Normal file
View File

@ -0,0 +1,10 @@
# Copyright (c) 2020 HAW Hamburg
#
# 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.
#
config MODULE_CAN_TRX
bool "Generic CAN transceiver interface"
depends on TEST_KCONFIG

28
drivers/ccs811/Kconfig Normal file
View File

@ -0,0 +1,28 @@
# Copyright (c) 2020 HAW Hamburg
#
# 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 MODULE_CCS811
bool "CCS811 digital gas sensor"
depends on HAS_PERIPH_GPIO
depends on HAS_PERIPH_I2C
depends on TEST_KCONFIG
select MODULE_PERIPH_GPIO
select MODULE_PERIPH_I2C
select MODULE_XTIMER
config MODULE_CCS811_FULL
bool "Full functionalities"
depends on MODULE_CCS811
depends on HAS_PERIPH_GPIO_IRQ
select MODULE_PERIPH_GPIO_IRQ
help
Say n if code size is critical, otherwise using the this module is
recommended.
Features included by this module are:
- data ready and threshold interrupt handling
- compensate gas readings using an external sensor
- manual baseline handling

View File

@ -129,6 +129,16 @@ config MODULE_PERIPH_INIT_RTT
rsource "Kconfig.spi"
config MODULE_PERIPH_TEMPERATURE
bool "Temperature peripheral driver"
depends on HAS_PERIPH_TEMPERATURE
select MODULE_PERIPH_COMMON
config MODULE_PERIPH_INIT_TEMPERATURE
bool "Auto initialize temperature peripheral"
default y if MODULE_PERIPH_INIT
depends on MODULE_PERIPH_TEMPERATURE
rsource "Kconfig.uart"
config MODULE_PERIPH_USBDEV

59
drivers/saul/Kconfig Normal file
View File

@ -0,0 +1,59 @@
# Copyright (c) 2020 HAW Hamburg
#
# 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 MODULE_SAUL
bool "[S]ensor [A]ctuator [U]ber [L]ayer"
depends on MODULE_PHYDAT
depends on TEST_KCONFIG
help
SAUL is a generic actuator/sensor interface in RIOT. Its purpose is to
enable unified interaction with a wide range of sensors and actuators
through a set of defined access functions and a common data structure.
if MODULE_SAUL
config MODULE_SAUL_DEFAULT
bool "Enable the default sensors and actuators of the platform"
depends on MODULE_SAUL_REG
config MODULE_SAUL_ADC
bool "SAUL wrapper for direct access to analog pins"
depends on HAS_PERIPH_ADC
select MODULE_PERIPH_ADC
default y if HAVE_SAUL_ADC
config MODULE_SAUL_GPIO
bool "SAUL wrapper for direct access to GPIO pins"
depends on HAS_PERIPH_GPIO
select MODULE_PERIPH_GPIO
default y if HAVE_SAUL_GPIO
config MODULE_SAUL_NRF_TEMPERATURE
bool "SAUL wrapper for direct access to the temperature peripheral"
depends on HAS_PERIPH_TEMPERATURE
select MODULE_PERIPH_TEMPERATURE
config MODULE_AUTO_INIT_SAUL
bool "Auto initialize the SAUL sybsystem"
depends on MODULE_AUTO_INIT
select MODULE_SAUL_INIT_DEVS
default y
config MODULE_SAUL_INIT_DEVS
bool
endif # MODULE_SAUL
config HAVE_SAUL_ADC
bool
help
Indicates that configuration for ADC access via SAUL is available.
config HAVE_SAUL_GPIO
bool
help
Indicates that configuration for GPIO access via SAUL is available.

View File

@ -6,6 +6,7 @@
#
menu "Packages"
rsource "driver_bme680/Kconfig"
rsource "tinydtls/Kconfig"
rsource "wakaama/Kconfig"

15
pkg/driver_bme680/Kconfig Normal file
View File

@ -0,0 +1,15 @@
# Copyright (c) 2020 HAW Hamburg
#
# 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.
#
config PACKAGE_DRIVER_BME680
bool "BME680 sensor driver package"
select MODULE_DRIVER_BME680_CONTRIB
config MODULE_DRIVER_BME680_CONTRIB
bool
help
RIOT integration code for the BME680 package.

View File

@ -19,7 +19,9 @@ rsource "net/Kconfig"
rsource "Kconfig.newlib"
rsource "Kconfig.stdio"
rsource "od/Kconfig"
rsource "phydat/Kconfig"
rsource "pm_layered/Kconfig"
rsource "saul_reg/Kconfig"
rsource "schedstatistics/Kconfig"
rsource "shell/Kconfig"
rsource "test_utils/Kconfig"

13
sys/phydat/Kconfig Normal file
View File

@ -0,0 +1,13 @@
# Copyright (c) 2020 HAW Hamburg
#
# 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.
#
config MODULE_PHYDAT
bool "Phydat"
depends on TEST_KCONFIG
select MODULE_FMT
help
Generic data container for physical data and utility functions.

11
sys/saul_reg/Kconfig Normal file
View File

@ -0,0 +1,11 @@
# Copyright (c) 2020 HAW Hamburg
#
# 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.
#
config MODULE_SAUL_REG
bool "Global sensor/actuator registry for SAUL devices"
depends on MODULE_SAUL
depends on TEST_KCONFIG

View File

@ -0,0 +1,4 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_XTIMER=y
CONFIG_MODULE_BH1750FVI=y

View File

@ -0,0 +1,4 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_XTIMER=y
CONFIG_MODULE_BH1900NUX=y

View File

@ -0,0 +1,5 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y
CONFIG_MODULE_BME680=y
CONFIG_MODULE_XTIMER=y

View File

@ -0,0 +1,4 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_BMP180=y
CONFIG_MODULE_XTIMER=y

View File

@ -0,0 +1,13 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
# include and auto-initialize all available sensors
CONFIG_MODULE_PHYDAT=y
CONFIG_MODULE_SAUL=y
CONFIG_MODULE_SAUL_REG=y
CONFIG_MODULE_SAUL_DEFAULT=y
# include driver for bmx055 sensor
CONFIG_MODULE_BMX055=y
# include xtimer for polling
CONFIG_MODULE_XTIMER=y

View File

@ -0,0 +1,4 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_BME280_I2C=y
CONFIG_MODULE_FMT=y

View File

@ -0,0 +1,3 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_CCS811=y

View File

@ -0,0 +1,4 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_CCS811=y
CONFIG_MODULE_CCS811_FULL=y