From 19bdb11548d6b3bc8bd5e9d197956743cb3d126b Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 29 May 2020 19:25:11 +0200 Subject: [PATCH 1/8] cpu/atmega_common: Add Kconfig symbols --- cpu/atmega_common/Kconfig | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 cpu/atmega_common/Kconfig diff --git a/cpu/atmega_common/Kconfig b/cpu/atmega_common/Kconfig new file mode 100644 index 0000000000..61ec6df358 --- /dev/null +++ b/cpu/atmega_common/Kconfig @@ -0,0 +1,60 @@ +# 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 CPU_ARCH_AVR8 + bool + select HAS_ARCH_8BIT + select HAS_ARCH_AVR8 + +config CPU_CORE_AVR + bool + select CPU_ARCH_AVR8 + +config CPU_COMMON_ATMEGA + bool + select CPU_CORE_AVR + select HAS_ATMEGA_PCINT0 + select HAS_PERIPH_CPUID + select HAS_PERIPH_EEPROM + select HAS_PERIPH_GPIO + select HAS_PERIPH_GPIO_IRQ + select HAS_PERIPH_PM + select HAS_PERIPH_TIMER_PERIODIC + select HAS_PERIPH_WDT + select HAS_PUF_SRAM + +## Common CPU symbols +config CPU_ARCH + default "avr8" if CPU_ARCH_AVR8 + +config CPU_CORE + default "avr" if CPU_CORE_AVR + +## Declaration of specific features +config HAS_ARCH_AVR8 + bool + help + Indicates that the current architecture is Atmel AVR8. + +config HAS_ATMEGA_PCINT0 + bool + help + Indicates that the Pin Change Interrupt bank 0 is present. + +config HAS_ATMEGA_PCINT1 + bool + help + Indicates that the Pin Change Interrupt bank 1 is present. + +config HAS_ATMEGA_PCINT2 + bool + help + Indicates that the Pin Change Interrupt bank 2 is present. + +config HAS_ATMEGA_PCINT3 + bool + help + Indicates that the Pin Change Interrupt bank 3 is present. From 981aecf9cc71b020847424c5513a790026338292 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 29 May 2020 19:25:46 +0200 Subject: [PATCH 2/8] cpu/atmega328p: Add Kconfig symbols --- cpu/atmega328p/Kconfig | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 cpu/atmega328p/Kconfig diff --git a/cpu/atmega328p/Kconfig b/cpu/atmega328p/Kconfig new file mode 100644 index 0000000000..c8e4bdd31a --- /dev/null +++ b/cpu/atmega328p/Kconfig @@ -0,0 +1,36 @@ +# 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 CPU_FAM_ATMEGA328 + bool + select CPU_COMMON_ATMEGA + select HAS_ATMEGA_PCINT1 + select HAS_ATMEGA_PCINT2 + +## CPU Models +config CPU_MODEL_ATMEGA328P + bool + select CPU_FAM_ATMEGA328 + select HAS_CPU_ATMEGA328P + +## Definition of specific features +config HAS_CPU_ATMEGA328P + bool + help + Indicates that a 'atmega328p' cpu is being used. + +## Common CPU symbols +config CPU_FAM + default "atmega328" if CPU_FAM_ATMEGA328 + +config CPU_MODEL + default "atmega328p" if CPU_MODEL_ATMEGA328P + +config CPU + default "atmega328p" if CPU_FAM_ATMEGA328 + +source "$(RIOTCPU)/atmega_common/Kconfig" From 9c6e3ea91ad65cb486a74f977c2c2719e04bcc37 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 29 May 2020 19:28:04 +0200 Subject: [PATCH 3/8] boards/common/arduino-atmega: Add Kconfig symbols --- boards/common/arduino-atmega/Kconfig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 boards/common/arduino-atmega/Kconfig diff --git a/boards/common/arduino-atmega/Kconfig b/boards/common/arduino-atmega/Kconfig new file mode 100644 index 0000000000..f876356d04 --- /dev/null +++ b/boards/common/arduino-atmega/Kconfig @@ -0,0 +1,18 @@ +# 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 BOARD_COMMON_ARDUINO_ATMEGA + bool + # Put defined MCU peripherals here (in alphabetical order) + select HAS_PERIPH_ADC + select HAS_PERIPH_I2C + select HAS_PERIPH_PWM + select HAS_PERIPH_SPI + select HAS_PERIPH_TIMER + select HAS_PERIPH_UART + # Various other features (if any) + select HAS_ARDUINO + select HAS_ARDUINO_PWM From 002f7cd54a6cf28fa32acf9a276f8242a2e0c9f7 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 29 May 2020 19:26:32 +0200 Subject: [PATCH 4/8] boards/arduino-duemilanove: Add Kconfig symbols --- boards/arduino-duemilanove/Kconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 boards/arduino-duemilanove/Kconfig diff --git a/boards/arduino-duemilanove/Kconfig b/boards/arduino-duemilanove/Kconfig new file mode 100644 index 0000000000..34a36f7d59 --- /dev/null +++ b/boards/arduino-duemilanove/Kconfig @@ -0,0 +1,16 @@ +# 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 BOARD_ARDUINO_DUEMILANOVE + bool + default y + select BOARD_COMMON_ARDUINO_ATMEGA + select CPU_MODEL_ATMEGA328P + +config BOARD + default "arduino-duemilanove" if BOARD_ARDUINO_DUEMILANOVE + +source "$(RIOTBOARD)/common/arduino-atmega/Kconfig" From 5299c2c1d76e584980651cace64294afdbef6048 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 29 May 2020 19:26:43 +0200 Subject: [PATCH 5/8] boards/arduino-uno: Add Kconfig symbols --- boards/arduino-uno/Kconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 boards/arduino-uno/Kconfig diff --git a/boards/arduino-uno/Kconfig b/boards/arduino-uno/Kconfig new file mode 100644 index 0000000000..acd5da8af9 --- /dev/null +++ b/boards/arduino-uno/Kconfig @@ -0,0 +1,16 @@ +# 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 BOARD_ARDUINO_UNO + bool + default y + select CPU_MODEL_ATMEGA328P + select BOARD_COMMON_ARDUINO_ATMEGA + +config BOARD + default "arduino-uno" if BOARD_ARDUINO_UNO + +source "$(RIOTBOARD)/common/arduino-atmega/Kconfig" From 688d06e38a68da38761f83642bf265d1b18717c2 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 29 May 2020 19:26:53 +0200 Subject: [PATCH 6/8] boards/arduino-nano: Add Kconfig symbols --- boards/arduino-nano/Kconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 boards/arduino-nano/Kconfig diff --git a/boards/arduino-nano/Kconfig b/boards/arduino-nano/Kconfig new file mode 100644 index 0000000000..2375c2413e --- /dev/null +++ b/boards/arduino-nano/Kconfig @@ -0,0 +1,16 @@ +# 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 BOARD_ARDUINO_NANO + bool + default y + select BOARD_COMMON_ARDUINO_ATMEGA + select CPU_MODEL_ATMEGA328P + +config BOARD + default "arduino-nano" if BOARD_ARDUINO_NANO + +source "$(RIOTBOARD)/common/arduino-atmega/Kconfig" From 1a3d7aaa90632372ffbc285730efc4c2acf36966 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 29 May 2020 19:33:01 +0200 Subject: [PATCH 7/8] boards/atmega328p: Add Kconfig symbols --- boards/atmega328p/Kconfig | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 boards/atmega328p/Kconfig diff --git a/boards/atmega328p/Kconfig b/boards/atmega328p/Kconfig new file mode 100644 index 0000000000..8206fe7376 --- /dev/null +++ b/boards/atmega328p/Kconfig @@ -0,0 +1,23 @@ +# 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 BOARD + default "atmega328p" if BOARD_ATMEGA328P + +config BOARD_ATMEGA328P + bool + default y + select CPU_MODEL_ATMEGA328P + # Put defined MCU peripherals here (in alphabetical order) + select HAS_PERIPH_ADC + select HAS_PERIPH_GPIO + select HAS_PERIPH_GPIO_IRQ + select HAS_PERIPH_I2C + select HAS_PERIPH_PWM + select HAS_PERIPH_SPI + select HAS_PERIPH_TIMER + select HAS_PERIPH_UART + # Various other features (if any) From 4a1f6e59461b501f20dfa754dba895769b5208ec Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Wed, 3 Jun 2020 10:13:29 +0200 Subject: [PATCH 8/8] test/kconfig_features: Add atmega328p-based boards to list --- tests/kconfig_features/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/kconfig_features/Makefile b/tests/kconfig_features/Makefile index 571a752910..4d8c0f9451 100644 --- a/tests/kconfig_features/Makefile +++ b/tests/kconfig_features/Makefile @@ -1,6 +1,10 @@ include ../Makefile.tests_common -BOARD_WHITELIST += cc1312-launchpad \ +BOARD_WHITELIST += arduino-duemilanove \ + arduino-nano \ + arduino-uno \ + atmega328p \ + cc1312-launchpad \ cc1352-launchpad \ cc1352p-launchpad \ cc2650-launchpad \