diff --git a/drivers/periph_common/Kconfig b/drivers/periph_common/Kconfig index a9781c99dc..fbc701845b 100644 --- a/drivers/periph_common/Kconfig +++ b/drivers/periph_common/Kconfig @@ -4,13 +4,6 @@ # General Public License v2.1. See the file LICENSE in the top level # directory for more details. -config MOD_PERIPH_INIT - bool "Peripherals auto-initialization" - default y - depends on TEST_KCONFIG - help - Auto-initialization of all used peripherals. - menuconfig KCONFIG_MODULE_PERIPH_WDT bool "Configure Watchdog peripheral" depends on MODULE_PERIPH_WDT @@ -31,3 +24,163 @@ config HAS_PERIPH_WDT_WARNING_PERIOD bool help Indicates that a CPU provides a warning period configuration option. + +menu "Peripheral drivers" + depends on TEST_KCONFIG + +config MOD_PERIPH_COMMON + bool + help + Common peripherals module. + +config MOD_PERIPH_INIT + bool "Peripherals auto-initialization" + default y + help + Auto-initialization of all used peripherals. + +# Common peripheral modules and auto-init +config MOD_PERIPH_ADC + bool "ADC peripheral driver" + depends on HAS_PERIPH_ADC + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_ADC + bool "Auto initialize ADC peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_ADC + +config MOD_PERIPH_CPUID + bool "CPU unique ID" + depends on HAS_PERIPH_CPUID + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_CPUID + bool "Auto initialize CPU unique ID driver" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_CPUID + +config MOD_PERIPH_DAC + bool "DAC peripheral driver" + depends on HAS_PERIPH_DAC + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_DAC + bool "Auto initialize DAC peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_DAC + +config MOD_PERIPH_DMA + bool "DMA peripheral driver" + depends on HAS_PERIPH_DMA + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_DMA + bool "Auto initialize DMA peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_DMA + +config MOD_PERIPH_EEPROM + bool "EEPROM peripheral driver" + depends on HAS_PERIPH_EEPROM + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_EEPROM + bool "Auto initialize EEPROM peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_EEPROM + +rsource "Kconfig.flashpage" + +rsource "Kconfig.gpio" + +config MOD_PERIPH_HWRNG + bool "HWRNG peripheral driver" + depends on HAS_PERIPH_HWRNG + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_HWRNG + bool "Auto initialize HWRNG peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_HWRNG + +rsource "Kconfig.i2c" + +config MOD_PERIPH_PWM + bool "PWM peripheral driver" + depends on HAS_PERIPH_PWM + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_PWM + bool "Auto initialize PWM peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_PWM + +config MOD_PERIPH_PM + bool "Power Management (PM) peripheral driver" + default y + depends on HAS_PERIPH_PM + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_PM + bool "Auto initialize Power Management (PM) peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_PM + +config MOD_PERIPH_QDEC + bool "Quadrature Decoder (QDEC) peripheral driver" + depends on HAS_PERIPH_QDEC + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_QDEC + bool "Auto initialize Quadrature Decoder (QDEC) peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_QDEC + +config MOD_PERIPH_RTC + bool "RTC peripheral driver" + depends on HAS_PERIPH_RTC + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_RTC + bool "Auto initialize RTC peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_RTC + +config MOD_PERIPH_RTT + bool "RTT peripheral driver" + depends on HAS_PERIPH_RTT + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_RTT + bool "Auto initialize RTT peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_RTT + +rsource "Kconfig.spi" + +rsource "Kconfig.timer" + +rsource "Kconfig.uart" + +config MOD_PERIPH_USBDEV + bool "USBDEV peripheral driver" + depends on HAS_PERIPH_USBDEV + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_USBDEV + bool "Auto initialize USBDEV peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_USBDEV + +menuconfig MOD_PERIPH_WDT + bool "Watchdog Timer peripheral driver" + depends on HAS_PERIPH_WDT + select MOD_PERIPH_COMMON + +config MOD_PERIPH_INIT_WDT + bool "Auto initialize the Watchdog Timer peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_WDT + +endmenu # Peripheral drivers diff --git a/drivers/periph_common/Kconfig.flashpage b/drivers/periph_common/Kconfig.flashpage new file mode 100644 index 0000000000..3b01510df9 --- /dev/null +++ b/drivers/periph_common/Kconfig.flashpage @@ -0,0 +1,40 @@ +# 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 MOD_PERIPH_FLASHPAGE + bool "Flashpage peripheral driver" + depends on HAS_PERIPH_FLASHPAGE + select MOD_PERIPH_COMMON + +# TODO: the 'init' modules are actually just artifacts from the way +# periph_init_% modules are handled in Makefile. We need to define them to keep +# the list the same for now. We should be able to remove them later on. + +config MOD_PERIPH_INIT_FLASHPAGE + bool "Auto initialize Flashpage peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_FLASHPAGE + +config MOD_PERIPH_FLASHPAGE_RAW + bool "Raw writing support" + depends on HAS_PERIPH_FLASHPAGE_RAW + depends on MOD_PERIPH_FLASHPAGE + +config MOD_PERIPH_INIT_FLASHPAGE_RAW + bool "Auto initialize Flashpage raw" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_FLASHPAGE_RAW + +config MOD_PERIPH_FLASHPAGE_RWEE + bool "Read while Write support" + depends on HAS_PERIPH_FLASHPAGE_RWEE + depends on MOD_PERIPH_FLASHPAGE + +config MOD_PERIPH_INIT_FLASHPAGE_RWEE + bool "Auto initialize Flashpage RWEE" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_FLASHPAGE_RWEE diff --git a/drivers/periph_common/Kconfig.gpio b/drivers/periph_common/Kconfig.gpio new file mode 100644 index 0000000000..e716ee49c5 --- /dev/null +++ b/drivers/periph_common/Kconfig.gpio @@ -0,0 +1,34 @@ +# 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 MOD_PERIPH_GPIO + bool "GPIO peripheral driver" + default y + depends on HAS_PERIPH_GPIO + select MOD_PERIPH_COMMON + +if MOD_PERIPH_GPIO + +config MOD_PERIPH_INIT_GPIO + bool "Auto initialize GPIO peripheral" + default y if MOD_PERIPH_INIT + +config MOD_PERIPH_GPIO_IRQ + bool "GPIO interrupt peripheral driver" + depends on HAS_PERIPH_GPIO_IRQ + select MOD_PERIPH_COMMON + +# TODO: this module is actually just an artifact from the way periph_init_% +# modules are handled in Makefile. We need to define it to keep the list the +# same for now. We should be able to remove it later on. + +config MOD_PERIPH_INIT_GPIO_IRQ + bool "Auto initialize GPIO interrupt peripheral" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_GPIO_IRQ + +endif # MOD_PERIPH_GPIO diff --git a/drivers/periph_common/Kconfig.i2c b/drivers/periph_common/Kconfig.i2c new file mode 100644 index 0000000000..f106bd476e --- /dev/null +++ b/drivers/periph_common/Kconfig.i2c @@ -0,0 +1,32 @@ +# 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 MOD_PERIPH_I2C + bool "I2C peripheral driver" + depends on HAS_PERIPH_I2C + select MOD_PERIPH_COMMON + +if MOD_PERIPH_I2C + +config MOD_PERIPH_INIT_I2C + bool "Auto initialize I2C peripheral" + default y if MOD_PERIPH_INIT + +config MOD_PERIPH_I2C_RECONFIGURE + bool "Pin reconfiguration support" + depends on HAS_PERIPH_I2C_RECONFIGURE + +# TODO: this module is actually just an artifact from the way periph_init_% +# modules are handled in Makefile. We need to define it to keep the list the +# same for now. We should be able to remove it later on. + +config MOD_PERIPH_INIT_I2C_RECONFIGURE + bool "Auto initialize I2C pin reconfiguration support" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_I2C_RECONFIGURE + +endif # MOD_PERIPH_I2C diff --git a/drivers/periph_common/Kconfig.spi b/drivers/periph_common/Kconfig.spi new file mode 100644 index 0000000000..c1e5f4a89f --- /dev/null +++ b/drivers/periph_common/Kconfig.spi @@ -0,0 +1,32 @@ +# 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 MOD_PERIPH_SPI + bool "SPI peripheral driver" + depends on HAS_PERIPH_SPI + select MOD_PERIPH_COMMON + +if MOD_PERIPH_SPI + +config MOD_PERIPH_INIT_SPI + bool "Auto initialize SPI peripheral" + default y if MOD_PERIPH_INIT + +config MOD_PERIPH_SPI_RECONFIGURE + bool "Pin reconfiguration support" + depends on HAS_PERIPH_SPI_RECONFIGURE + +# TODO: this module is actually just an artifact from the way periph_init_% +# modules are handled in Makefile. We need to define it to keep the list the +# same for now. We should be able to remove it later on. + +config MOD_PERIPH_INIT_SPI_RECONFIGURE + bool "Auto initialize SPI pin reconfiguration support" + default y if MOD_PERIPH_INIT + depends on MOD_PERIPH_SPI_RECONFIGURE + +endif # MOD_PERIPH_SPI diff --git a/drivers/periph_common/Kconfig.timer b/drivers/periph_common/Kconfig.timer new file mode 100644 index 0000000000..9a2111b7ee --- /dev/null +++ b/drivers/periph_common/Kconfig.timer @@ -0,0 +1,32 @@ +# 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 MOD_PERIPH_TIMER + bool "Timer peripheral driver" + depends on HAS_PERIPH_TIMER + select MOD_PERIPH_COMMON + +if MOD_PERIPH_TIMER + +# TODO: the 'init' modules are actually just artifacts from the way +# periph_init_% modules are handled in Makefile. We need to define them to keep +# the list the same for now. We should be able to remove them later on. + +config MOD_PERIPH_INIT_TIMER + bool "Auto initialize Timer peripheral" + default y if MOD_PERIPH_INIT + +config MOD_PERIPH_TIMER_PERIODIC + bool "Periodic timeout support" + depends on HAS_PERIPH_TIMER_PERIODIC + +config MOD_PERIPH_INIT_TIMER_PERIODIC + bool + depends on MOD_PERIPH_TIMER_PERIODIC + default y if MOD_PERIPH_INIT + +endif # MOD_PERIPH_TIMER diff --git a/drivers/periph_common/Kconfig.uart b/drivers/periph_common/Kconfig.uart new file mode 100644 index 0000000000..e15b605db9 --- /dev/null +++ b/drivers/periph_common/Kconfig.uart @@ -0,0 +1,41 @@ +# 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 MOD_PERIPH_UART + bool "UART peripheral driver" + depends on HAS_PERIPH_UART + select MOD_PERIPH_COMMON + +if MOD_PERIPH_UART + +# TODO: the 'init' modules are actually just artifacts from the way +# periph_init_% modules are handled in Makefile. We need to define them to keep +# the list the same for now. We should be able to remove them later on. + +config MOD_PERIPH_INIT_UART + bool "Auto initialize UART peripheral" + default y if MOD_PERIPH_INIT + +config MOD_PERIPH_UART_MODECFG + bool "Mode configuration support" + depends on HAS_PERIPH_UART_MODECFG + +config MOD_PERIPH_UART_NONBLOCKING + bool "Non-blocking support" + depends on HAS_PERIPH_UART_NONBLOCKING + +config MOD_PERIPH_INIT_UART_MODECFG + bool + depends on MOD_PERIPH_UART_MODECFG + default y if MOD_PERIPH_INIT + +config MOD_PERIPH_INIT_UART_NONBLOCKING + bool + depends on MOD_PERIPH_UART_NONBLOCKING + default y if MOD_PERIPH_INIT + +endif # MOD_PERIPH_UART