drivers/periph_common: Add modules to Kconfig

This commit is contained in:
Leandro Lanzieri 2020-07-27 17:09:27 +02:00
parent b98527ef53
commit 14499e3b7e
No known key found for this signature in database
GPG Key ID: 13559905E2EBEAA5
7 changed files with 371 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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