From 3a66ae51c3f34108428e582ef693866d71496d16 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 28 Aug 2020 15:25:37 +0200 Subject: Expose configuration via Kconfig --- src/arch/arduino-nano-168/Kconfig | 37 ++++++++++++++++++++ src/arch/arduino-nano-168/Makefile.inc | 62 ++++++++++++++++++++++++++++------ src/arch/arduino-nano-168/prompt | 1 + 3 files changed, 89 insertions(+), 11 deletions(-) create mode 100644 src/arch/arduino-nano-168/Kconfig create mode 100644 src/arch/arduino-nano-168/prompt (limited to 'src/arch/arduino-nano-168') diff --git a/src/arch/arduino-nano-168/Kconfig b/src/arch/arduino-nano-168/Kconfig new file mode 100644 index 0000000..0d8b25c --- /dev/null +++ b/src/arch/arduino-nano-168/Kconfig @@ -0,0 +1,37 @@ +config arch_arduino_nano_168_driver_adc +bool "ADC (Analog-Digital-Converter)" +select meta_driver_adc + +config arch_arduino_nano_168_driver_i2c +bool "I2C" +select meta_driver_i2c + +config arch_arduino_nano_168_driver_neopixel +bool "WS2812b (NeoPixel)" +select meta_driver_neopixel + +config arch_arduino_nano_168_driver_spi +bool "SPI" +select meta_driver_spi + +config arch_arduino_nano_168_driver_stdin +bool "UART Input" +select meta_driver_stdin + +config arch_arduino_nano_168_driver_timer +bool "Timer with Interrupts" +select meta_driver_timer + +choice arch_arduino_nano_168_timer1 +bool "Timer 1" +optional + +config arch_arduino_nano_168_driver_uptime +bool "Uptime Counter" +select meta_driver_uptime + +config arch_arduino_nano_168_driver_counter +bool "Cycle Counter" +select meta_driver_counter + +endchoice diff --git a/src/arch/arduino-nano-168/Makefile.inc b/src/arch/arduino-nano-168/Makefile.inc index 844fc1d..21ccf2f 100644 --- a/src/arch/arduino-nano-168/Makefile.inc +++ b/src/arch/arduino-nano-168/Makefile.inc @@ -27,38 +27,78 @@ ifeq (${aspectc}, 1) CXX = ag++ -r build/repo.acp -v 0 --c_compiler avr-g++ -p . --Xcompiler endif -CXX_TARGETS += src/arch/arduino-nano/arch.cc -CXX_TARGETS += src/arch/arduino-nano/driver/gpio.cc -CXX_TARGETS += src/arch/arduino-nano/driver/stdout.cc -CXX_TARGETS += src/arch/arduino-nano/driver/uptime.cc +CXX_TARGETS += src/arch/arduino-nano-168/arch.cc +CXX_TARGETS += src/arch/arduino-nano-168/driver/gpio.cc +CXX_TARGETS += src/arch/arduino-nano-168/driver/stdout.cc + +# Command-line driver selection ifneq ($(findstring softi2c,${drivers}), ) else ifneq ($(findstring i2c,${arch_drivers}), ) - CXX_TARGETS += src/arch/arduino-nano/driver/i2c.cc + CONFIG_arch_arduino_nano_168_driver_i2c = y endif ifneq ($(findstring adc,${arch_drivers}), ) - CXX_TARGETS += src/arch/arduino-nano/driver/adc.cc + CONFIG_arch_arduino_nano_168_driver_adc = y endif ifneq ($(findstring spi,${arch_drivers}), ) - CXX_TARGETS += src/arch/arduino-nano/driver/spi.cc + CONFIG_arch_arduino_nano_168_driver_spi = y endif ifneq ($(findstring stdin,${arch_drivers}), ) - CXX_TARGETS += src/arch/arduino-nano/driver/stdin.cc + CONFIG_arch_arduino_nano_168_driver_stdin = y endif ifneq ($(findstring timer,${arch_drivers}), ) - CXX_TARGETS += src/arch/arduino-nano/driver/timer.cc + CONFIG_arch_arduino_nano_168_driver_timer = y endif ifneq ($(findstring counter,${arch_drivers}), ) - CXX_TARGETS += src/arch/arduino-nano/driver/counter.cc + CONFIG_arch_arduino_nano_168_driver_counter = y endif ifneq ($(findstring neopixel,${arch_drivers}), ) - CXX_TARGETS += src/arch/arduino-nano/driver/neopixel.cc + CONFIG_arch_arduino_nano_168_driver_neopixel = y +endif + +ifeq (${timer_s}, 1) + CONFIG_arch_arduino_nano_168_driver_uptime = y +endif + +# Kconfig driver selection + +ifdef CONFIG_arch_arduino_nano_168_driver_i2c + CXX_TARGETS += src/arch/arduino-nano-168/driver/i2c.cc +endif + +ifdef CONFIG_arch_arduino_nano_168_driver_adc + CXX_TARGETS += src/arch/arduino-nano-168/driver/adc.cc +endif + +ifdef CONFIG_arch_arduino_nano_168_driver_spi + CXX_TARGETS += src/arch/arduino-nano-168/driver/spi.cc +endif + +ifdef CONFIG_arch_arduino_nano_168_driver_stdin + CXX_TARGETS += src/arch/arduino-nano-168/driver/stdin.cc +endif + +ifdef CONFIG_arch_arduino_nano_168_driver_timer + CXX_TARGETS += src/arch/arduino-nano-168/driver/timer.cc +endif + +ifdef CONFIG_arch_arduino_nano_168_driver_counter + CXX_TARGETS += src/arch/arduino-nano-168/driver/counter.cc +endif + +ifdef CONFIG_arch_arduino_nano_168_driver_neopixel + CXX_TARGETS += src/arch/arduino-nano-168/driver/neopixel.cc +endif + +ifdef CONFIG_arch_arduino_nano_168_driver_uptime + COMMON_FLAGS += -DTIMER_S + CXX_TARGETS += src/arch/arduino-nano-168/driver/uptime.cc endif ifeq (${cpu_freq}, 16000000) diff --git a/src/arch/arduino-nano-168/prompt b/src/arch/arduino-nano-168/prompt new file mode 100644 index 0000000..88c9b61 --- /dev/null +++ b/src/arch/arduino-nano-168/prompt @@ -0,0 +1 @@ +Arduino Nano (Mega168) -- cgit v1.2.3