Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards/saml21-based: model kconfig #17270

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .murdock
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ arduino-nano
atxmega-a1-xplained
atxmega-a3bu-xplained
avr-rss2
bastwan
cc1352-launchpad
cc2650-launchpad
derfmega128
Expand Down
3 changes: 3 additions & 0 deletions boards/bastwan/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ config BOARD_BASTWAN
select HAS_PERIPH_USBDEV
select HAS_RIOTBOOT
select HAS_HIGHLEVEL_STDIO

select HAVE_SAUL_GPIO
select HAVE_SX1276
6 changes: 6 additions & 0 deletions boards/bastwan/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ FEATURES_PROVIDED += periph_usbdev
# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += highlevel_stdio

# This configuration enables modules that are only available when using Kconfig
# module modelling
ifeq (1, $(TEST_KCONFIG))
KCONFIG_ADD_CONFIG += $(BOARDDIR)/bastwan.config
endif
3 changes: 3 additions & 0 deletions boards/bastwan/bastwan.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_MODULE_USBUS=y
CONFIG_MODULE_USBUS_CDC_ACM=y
CONFIG_MODULE_STDIO_CDC_ACM=y
2 changes: 2 additions & 0 deletions boards/saml21-xpro/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ config BOARD_SAML21_XPRO
select HAS_PERIPH_UART
select HAS_PERIPH_USBDEV
select HAS_RIOTBOOT

select HAVE_SAUL_GPIO
2 changes: 2 additions & 0 deletions boards/samr30-xpro/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ config BOARD_SAMR30_XPRO
select HAS_PERIPH_UART
select HAS_PERIPH_USBDEV
select HAS_RIOTBOOT

select HAVE_SAUL_GPIO
3 changes: 3 additions & 0 deletions boards/samr34-xpro/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ config BOARD_SAMR34_XPRO
select HAS_PERIPH_UART
select HAS_PERIPH_USBDEV
select HAS_RIOTBOOT

select HAVE_SX1276
select HAVE_SAUL_GPIO
6 changes: 6 additions & 0 deletions boards/yarm/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += riotboot

# This configuration enables modules that are only available when using Kconfig
# module modelling
ifeq (1, $(TEST_KCONFIG))
KCONFIG_ADD_CONFIG += $(BOARDDIR)/yarm.config
endif
3 changes: 3 additions & 0 deletions boards/yarm/yarm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_MODULE_USBUS=y
CONFIG_MODULE_USBUS_CDC_ACM=y
CONFIG_MODULE_STDIO_CDC_ACM=y
51 changes: 31 additions & 20 deletions drivers/sx127x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,52 @@
# directory for more details.
#

if TEST_KCONFIG

choice
bool "Semtech SX1272 and SX1276 radios driver"
optional
menuconfig MODULE_SX127X
bool "Semtech SX1272 and SX1276 radios driver" if !(HAVE_SX127X && MODULE_NETDEV_DEFAULT)
default y if (HAVE_SX127X && MODULE_NETDEV_DEFAULT)
depends on TEST_KCONFIG
depends on HAS_PERIPH_GPIO
depends on HAS_PERIPH_GPIO_IRQ
depends on HAS_PERIPH_SPI
depends on HAS_PERIPH_TIMER
select MODULE_PERIPH_GPIO
select MODULE_PERIPH_GPIO_IRQ
select MODULE_PERIPH_SPI_GPIO_MODE if HAS_PERIPH_SPI_GPIO_MODE
select MODULE_PERIPH_SPI
select MODULE_ZTIMER
select MODULE_ZTIMER_MSEC
select MODULE_IOLIST
select MODULE_LORA
help
Only LoRa long range modem is supported at the moment.

choice
bool "Radio variant"
depends on MODULE_SX127X
default MODULE_SX1272 if HAVE_SX1272
default MODULE_SX1276 if HAVE_SX1276

config MODULE_SX1272
bool "SX1272"
select MODULE_SX127X

config MODULE_SX1276
bool "SX1276"
select MODULE_SX127X

endchoice

config MODULE_SX127X
config HAVE_SX1272
bool
depends on HAS_PERIPH_GPIO
depends on HAS_PERIPH_GPIO_IRQ
depends on HAS_PERIPH_SPI
select HAVE_SX127X
help
Indicates that an sx1272 radio is present.

select MODULE_IOLIST
select MODULE_LORA
select MODULE_PERIPH_GPIO
select MODULE_PERIPH_GPIO_IRQ
select MODULE_PERIPH_SPI_GPIO_MODE if HAS_PERIPH_SPI_GPIO_MODE
select MODULE_PERIPH_SPI
select MODULE_ZTIMER
select MODULE_ZTIMER_MSEC
config HAVE_SX1276
bool
select HAVE_SX127X
help
Indicates that an sx1276 radio is present.

endif # TEST_KCONFIG
config HAVE_SX127X
bool
help
Indicates that an sx127x radio is present.
3 changes: 2 additions & 1 deletion sys/usb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,6 @@ config USB_SERIAL_BYTE_LENGTH
comment "WARNING: The serial string is empty!"
depends on USB_SERIAL_STR = "" && USB_CUSTOM_SERIAL_STR

rsource "usbus/Kconfig"
endif # KCONFIG_USB

rsource "usbus/Kconfig"
26 changes: 24 additions & 2 deletions sys/usb/usbus/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,30 @@
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#

menuconfig MODULE_USBUS
bool "USB Unified Stack (USBUS)"
depends on TEST_KCONFIG
depends on HAS_PERIPH_USBDEV || MODULE_USBDEV_MOCK
select MODULE_CORE_THREAD_FLAGS
select MODULE_EVENT
select MODULE_LUID
select MODULE_FMT
select MODULE_PERIPH_USBDEV if HAS_PERIPH_USBDEV && !MODULE_USBDEV_MOCK

if MODULE_USBUS

config MODULE_AUTO_INIT_USBUS
bool "Auto initialize USBUS"
depends on MODULE_AUTO_INIT
default y

endif # MODULE_USBUS

menuconfig KCONFIG_USEMODULE_USBUS
bool "Configure USB Unified Stack (USBUS)"
depends on USEMODULE_USBUS
depends on KCONFIG_USB
help
Configure the USBUS module via Kconfig.

Expand Down Expand Up @@ -42,7 +63,8 @@ config USBUS_EP0_SIZE_64

endchoice

endif # KCONFIG_USEMODULE_USBUS

rsource "cdc/Kconfig"
rsource "dfu/Kconfig"

endif # KCONFIG_USEMODULE_USBUS
rsource "hid/Kconfig"
16 changes: 16 additions & 0 deletions sys/usb/usbus/cdc/acm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
menuconfig KCONFIG_USEMODULE_USBUS_CDC_ACM
bool "Configure USBUS CDC ACM"
depends on USEMODULE_USBUS_CDC_ACM
depends on KCONFIG_USEMODULE_USBUS
help
Configure the USBUS CDC ACM module via Kconfig.

Expand Down Expand Up @@ -44,3 +45,18 @@ config USBUS_CDC_ACM_BULK_EP_SIZE_64
endchoice

endif # KCONFIG_USEMODULE_USBUS_CDC_ACM

config MODULE_USBUS_CDC_ACM
bool "USB CDC ACM support"
depends on MODULE_USBUS
select MODULE_TSRB

# extend STDIO options
choice STDIO_IMPLEMENTATION

config MODULE_STDIO_CDC_ACM
bool "CDC ACM"
depends on MODULE_USBUS_CDC_ACM
select MODULE_ISRPIPE

endchoice
1 change: 1 addition & 0 deletions sys/usb/usbus/cdc/ecm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
menuconfig KCONFIG_USEMODULE_USBUS_CDC_ECM
bool "Configure USBUS CDC ECM"
depends on USEMODULE_USBUS_CDC_ECM
depends on KCONFIG_USEMODULE_USBUS
help
Configure the USBUS CDC ECM module via Kconfig.

Expand Down
1 change: 1 addition & 0 deletions sys/usb/usbus/dfu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
menuconfig KCONFIG_USEMODULE_USBUS_DFU
bool "Configure USBUS DFU"
depends on USEMODULE_USBUS_DFU
depends on KCONFIG_USEMODULE_USBUS
help
Configure the USBUS DFU module via Kconfig.

Expand Down
17 changes: 17 additions & 0 deletions sys/usb/usbus/hid/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2021 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_USBUS_HID
bool "USB HID support"
depends on TEST_KCONFIG
depends on MODULE_USBUS
select MODULE_ISRPIPE_READ_TIMEOUT

config USBUS_HID_INTERRUPT_EP_SIZE
int "Interrupt endpoint size in bytes"
default 64
depends on MODULE_USBUS_HID
2 changes: 1 addition & 1 deletion tests/driver_sx127x/app.config.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.

CONFIG_MODULE_SX127X=y
CONFIG_MODULE_SX1276=y

CONFIG_MODULE_OD=y
Expand Down