diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-08-28 15:25:37 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-08-28 15:25:37 +0200 |
commit | 3a66ae51c3f34108428e582ef693866d71496d16 (patch) | |
tree | 6a8ab3774af1b1077720671a92f40a92d5425bcf /src/arch | |
parent | e12d6d528705344628568000dc2fddb919457411 (diff) |
Expose configuration via Kconfig
Diffstat (limited to 'src/arch')
32 files changed, 495 insertions, 86 deletions
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) diff --git a/src/arch/arduino-nano/Kconfig b/src/arch/arduino-nano/Kconfig new file mode 100644 index 0000000..7054d44 --- /dev/null +++ b/src/arch/arduino-nano/Kconfig @@ -0,0 +1,37 @@ +config arch_arduino_nano_driver_adc +bool "ADC (Analog-Digital-Converter)" +select meta_driver_adc + +config arch_arduino_nano_driver_i2c +bool "I2C" +select meta_driver_i2c + +config arch_arduino_nano_driver_neopixel +bool "WS2812b (NeoPixel)" +select meta_driver_neopixel + +config arch_arduino_nano_driver_spi +bool "SPI" +select meta_driver_spi + +config arch_arduino_nano_driver_stdin +bool "UART Input" +select meta_driver_stdin + +config arch_arduino_nano_driver_timer +bool "Timer with Interrupts" +select meta_driver_timer + +choice arch_arduino_nano_timer1 +bool "Timer 1" +optional + +config arch_arduino_nano_driver_uptime +bool "Uptime Counter" +select meta_driver_uptime + +config arch_arduino_nano_driver_counter +bool "Cycle Counter" +select meta_driver_counter + +endchoice diff --git a/src/arch/arduino-nano/Makefile.inc b/src/arch/arduino-nano/Makefile.inc index 5445bc1..a3412fb 100644 --- a/src/arch/arduino-nano/Makefile.inc +++ b/src/arch/arduino-nano/Makefile.inc @@ -30,37 +30,77 @@ 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 + +# 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_driver_i2c = y endif ifneq ($(findstring adc,${arch_drivers}), ) - CXX_TARGETS += src/arch/arduino-nano/driver/adc.cc + CONFIG_arch_arduino_nano_driver_adc = y endif ifneq ($(findstring spi,${arch_drivers}), ) - CXX_TARGETS += src/arch/arduino-nano/driver/spi.cc + CONFIG_arch_arduino_nano_driver_spi = y endif ifneq ($(findstring stdin,${arch_drivers}), ) - CXX_TARGETS += src/arch/arduino-nano/driver/stdin.cc + CONFIG_arch_arduino_nano_driver_stdin = y endif ifneq ($(findstring timer,${arch_drivers}), ) - CXX_TARGETS += src/arch/arduino-nano/driver/timer.cc + CONFIG_arch_arduino_nano_driver_timer = y endif ifneq ($(findstring counter,${arch_drivers}), ) - CXX_TARGETS += src/arch/arduino-nano/driver/counter.cc + CONFIG_arch_arduino_nano_driver_counter = y endif ifneq ($(findstring neopixel,${arch_drivers}), ) + CONFIG_arch_arduino_nano_driver_neopixel = y +endif + +ifeq (${timer_s}, 1) + CONFIG_arch_arduino_nano_driver_uptime = y +endif + +# Kconfig driver selection + +ifdef CONFIG_arch_arduino_nano_driver_i2c + CXX_TARGETS += src/arch/arduino-nano/driver/i2c.cc +endif + +ifdef CONFIG_arch_arduino_nano_driver_adc + CXX_TARGETS += src/arch/arduino-nano/driver/adc.cc +endif + +ifdef CONFIG_arch_arduino_nano_driver_spi + CXX_TARGETS += src/arch/arduino-nano/driver/spi.cc +endif + +ifdef CONFIG_arch_arduino_nano_driver_stdin + CXX_TARGETS += src/arch/arduino-nano/driver/stdin.cc +endif + +ifdef CONFIG_arch_arduino_nano_driver_timer + CXX_TARGETS += src/arch/arduino-nano/driver/timer.cc +endif + +ifdef CONFIG_arch_arduino_nano_driver_counter + CXX_TARGETS += src/arch/arduino-nano/driver/counter.cc +endif + +ifdef CONFIG_arch_arduino_nano_driver_neopixel CXX_TARGETS += src/arch/arduino-nano/driver/neopixel.cc endif +ifdef CONFIG_arch_arduino_nano_driver_uptime + COMMON_FLAGS += -DTIMER_S + CXX_TARGETS += src/arch/arduino-nano/driver/uptime.cc +endif + ifeq (${cpu_freq}, 16000000) uart_baud = 57600 else ifeq (${cpu_freq}, 8000000) diff --git a/src/arch/arduino-nano/arch.cc b/src/arch/arduino-nano/arch.cc index 1023927..48b50f8 100644 --- a/src/arch/arduino-nano/arch.cc +++ b/src/arch/arduino-nano/arch.cc @@ -38,11 +38,6 @@ void Arch::setup(void) #error Unsupported F_CPU #endif -#ifdef TIMER_CYCLES - TCCR0A = 0; - TCCR0B = _BV(CS00); -#endif - #if defined(WITH_LOOP) || defined(TIMER_S) TCCR1A = 0; TCCR1B = _BV(WGM12) | _BV(CS12) | _BV(CS10); // /1024 diff --git a/src/arch/arduino-nano/prompt b/src/arch/arduino-nano/prompt new file mode 100644 index 0000000..1994e4c --- /dev/null +++ b/src/arch/arduino-nano/prompt @@ -0,0 +1 @@ +Arduino Nano (Mega328) diff --git a/src/arch/blinkenrocket/Kconfig b/src/arch/blinkenrocket/Kconfig new file mode 100644 index 0000000..5b9a830 --- /dev/null +++ b/src/arch/blinkenrocket/Kconfig @@ -0,0 +1,10 @@ +config arch_blinkenrocket_driver_i2c +bool "I2C" +select meta_driver_i2c + +config arch_blinkenrocket_driver_uptime +bool "Uptime Counter" +select meta_driver_uptime + +config arch_blinkenrocket_kout_nop +bool "Disable UART emulation for stdout" diff --git a/src/arch/blinkenrocket/Makefile.inc b/src/arch/blinkenrocket/Makefile.inc index ea4e183..ba66152 100644 --- a/src/arch/blinkenrocket/Makefile.inc +++ b/src/arch/blinkenrocket/Makefile.inc @@ -22,13 +22,32 @@ endif CXX_TARGETS += src/arch/blinkenrocket/arch.cc CXX_TARGETS += src/arch/blinkenrocket/driver/gpio.cc CXX_TARGETS += src/arch/blinkenrocket/driver/stdout.cc -CXX_TARGETS += src/arch/blinkenrocket/driver/uptime.cc ifneq ($(findstring softi2c,${drivers}), ) else ifneq ($(findstring i2c,${arch_drivers}), ) + CONFIG_arch_blinkenrocket_driver_i2c = y +endif + +ifeq (${timer_s}, 1) + CONFIG_arch_blinkenrocket_driver_uptime = y +endif + +ifdef CONFIG_arch_blinkenrocket_driver_i2c CXX_TARGETS += src/arch/blinkenrocket/driver/i2c.cc endif +ifdef CONFIG_arch_blinkenrocket_driver_uptime + COMMON_FLAGS += -DTIMER_S + CXX_TARGETS += src/arch/blinkenrocket/driver/uptime.cc +endif + +ifeq (${kout_nop}, 1) + COMMON_FLAGS += -DKOUT_NOP +endif +ifdef CONFIG_arch_blinkenrocket_kout_nop + COMMON_FLAGS += -DKOUT_NOP +endif + OBJECTS = ${CXX_TARGETS:.cc=.o} ${C_TARGETS:.c=.o} .cc.o: diff --git a/src/arch/blinkenrocket/arch.cc b/src/arch/blinkenrocket/arch.cc index 1261515..d49bfda 100644 --- a/src/arch/blinkenrocket/arch.cc +++ b/src/arch/blinkenrocket/arch.cc @@ -5,10 +5,6 @@ void Arch::setup(void) { -#ifdef TIMER_CYCLES - TCCR0A = _BV(CS00); -#endif - #if defined(WITH_LOOP) || defined(TIMER_S) TCCR1A = 0; TCCR1B = _BV(WGM12) | _BV(CS12) | _BV(CS10); // /1024 diff --git a/src/arch/blinkenrocket/prompt b/src/arch/blinkenrocket/prompt new file mode 100644 index 0000000..9972aaa --- /dev/null +++ b/src/arch/blinkenrocket/prompt @@ -0,0 +1 @@ +Blinkenrocket diff --git a/src/arch/esp8266/Kconfig b/src/arch/esp8266/Kconfig new file mode 100644 index 0000000..5542dd5 --- /dev/null +++ b/src/arch/esp8266/Kconfig @@ -0,0 +1,11 @@ +config arch_esp8266_driver_counter +bool "Cycle Counter" +select meta_driver_counter + +config arch_esp8266_driver_stdin +bool "UART Input" +select meta_driver_stdin + +config arch_esp8266_driver_uptime +bool "Uptime Counter" +select meta_driver_uptime diff --git a/src/arch/esp8266/Makefile.inc b/src/arch/esp8266/Makefile.inc index c1bb621..44a3cd7 100644 --- a/src/arch/esp8266/Makefile.inc +++ b/src/arch/esp8266/Makefile.inc @@ -22,7 +22,7 @@ CXXFLAGS = -std=c++11 -fno-rtti -fno-threadsafe-statics LDFLAGS += -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static CXX_TARGETS += src/arch/esp8266/arch.cc src/arch/esp8266/driver/gpio.cc -CXX_TARGETS += src/arch/esp8266/driver/stdout.cc src/arch/esp8266/driver/uptime.cc +CXX_TARGETS += src/arch/esp8266/driver/stdout.cc OBJECTS = ${CXX_TARGETS:.cc=.o} ${C_TARGETS:.c=.o} @@ -30,14 +30,35 @@ ifeq (${esp8266_led2}, 1) COMMON_FLAGS += -DLED_ON_GPIO16 endif +# Commandline + +ifneq ($(findstring counter,${arch_drivers}), ) + CONFIG_arch_esp8266_driver_counter = y +endif + ifneq ($(findstring stdin,${arch_drivers}), ) - CXX_TARGETS += src/arch/esp8266/driver/stdin.cc + CONFIG_arch_esp8266_driver_stdin = y endif -ifneq ($(findstring counter,${arch_drivers}), ) +ifeq (${timer_s}, 1) + CONFIG_arch_esp8266_driver_uptime = y +endif + +# Kconfig + +ifdef CONFIG_arch_esp8266_driver_counter CXX_TARGETS += src/arch/esp8266/driver/counter.cc endif +ifdef CONFIG_arch_esp8266_driver_stdin + CXX_TARGETS += src/arch/esp8266/driver/stdin.cc +endif + +ifdef CONFIG_arch_esp8266_driver_uptime + COMMON_FLAGS += -DTIMER_S + CXX_TARGETS += src/arch/esp8266/driver/uptime.cc +endif + .cc.o: ${QUIET}${CXX} ${INCLUDES} ${COMMON_FLAGS} ${CXXFLAGS} -c -o $@ ${@:.o=.cc} ${QUIET}${OBJCOPY} --rename-section .text=.irom0.text --rename-section .literal=.irom0.literal $@ diff --git a/src/arch/esp8266/prompt b/src/arch/esp8266/prompt new file mode 100644 index 0000000..3428bc3 --- /dev/null +++ b/src/arch/esp8266/prompt @@ -0,0 +1 @@ +ESP8266 diff --git a/src/arch/msp430fr5969lp/Kconfig b/src/arch/msp430fr5969lp/Kconfig new file mode 100644 index 0000000..015d78d --- /dev/null +++ b/src/arch/msp430fr5969lp/Kconfig @@ -0,0 +1,31 @@ +config arch_msp430fr5969lp_driver_adc +bool "ADC (Analog-Digital-Converter)" +select meta_driver_adc + +config arch_msp430fr5969lp_driver_counter +bool "Cycle Counter" +select meta_driver_counter + +config arch_msp430fr5969lp_driver_i2c +bool "I2C on eUSCI_B0" +select meta_driver_i2c + +config arch_msp430fr5969lp_driver_spi_a1 +bool "SPI on eUSCI_A1" +select meta_driver_spi + +config arch_msp430fr5969lp_driver_spi_b +bool "SPI on eUSCI_B0" +select meta_driver_spi + +config arch_msp430fr5969lp_driver_stdin +bool "UART Input" +select meta_driver_stdin + +config arch_msp430fr5969lp_driver_timer +bool "Timer with Interrupts" +select meta_driver_timer + +config arch_msp430fr5969lp_driver_uptime +bool "Uptime Counter" +select meta_driver_uptime diff --git a/src/arch/msp430fr5969lp/Makefile.inc b/src/arch/msp430fr5969lp/Makefile.inc index 2c1e64c..8a48859 100644 --- a/src/arch/msp430fr5969lp/Makefile.inc +++ b/src/arch/msp430fr5969lp/Makefile.inc @@ -25,45 +25,86 @@ SIZE = /opt/msp430/ti/msp430-gcc-full-linux-5.1.2.0/bin/msp430-elf-size ARCH_SHORTNAME = msp430 CXX_TARGETS += src/arch/msp430fr5969lp/arch.cc +CXX_TARGETS += src/arch/msp430fr5969lp/driver/gpio.cc +CXX_TARGETS += src/arch/msp430fr5969lp/driver/stdout.cc ifeq (${aspectc}, 1) CXX = ag++ -r build/repo.acp -v 0 --c_compiler /opt/msp430/ti/msp430-gcc-full-linux-5.1.2.0/bin/msp430-elf-g++ -p . --Xcompiler endif +# Command-line + ifneq ($(findstring adc,${arch_drivers}), ) - CXX_TARGETS += src/arch/msp430fr5969lp/driver/adc.cc + CONFIG_arch_msp430fr5969lp_driver_adc = y endif -CXX_TARGETS += src/arch/msp430fr5969lp/driver/gpio.cc -CXX_TARGETS += src/arch/msp430fr5969lp/driver/stdout.cc -CXX_TARGETS += src/arch/msp430fr5969lp/driver/uptime.cc - ifneq ($(findstring stdin,${arch_drivers}), ) - CXX_TARGETS += src/arch/msp430fr5969lp/driver/stdin.cc + CONFIG_arch_msp430fr5969lp_driver_stdin = y endif ifneq ($(findstring softi2c,${drivers}), ) else ifneq ($(findstring i2c,${arch_drivers}), ) + CONFIG_arch_msp430fr5969lp_driver_i2c = y +endif + +ifneq ($(findstring spi_a1,${arch_drivers}), ) + CONFIG_arch_msp430fr5969lp_driver_spi_a1 = y +endif + +ifneq ($(findstring spi_b,${arch_drivers}), ) + CONFIG_arch_msp430fr5969lp_driver_spi_b = y +endif + +ifneq ($(findstring timer,${arch_drivers}), ) + CONFIG_arch_msp430fr5969lp_driver_timer = y +endif + +ifneq ($(findstring counter,${arch_drivers}), ) + CONFIG_arch_msp430fr5969lp_driver_counter = y +endif + +ifeq (${timer_s}, 1) + CONFIG_arch_msp430fr5969lp_driver_uptime = y +endif + +# Kconfig + +ifdef CONFIG_arch_msp430fr5969lp_driver_adc + CXX_TARGETS += src/arch/msp430fr5969lp/driver/adc.cc +endif + +ifdef CONFIG_arch_msp430fr5969lp_driver_stdin + CXX_TARGETS += src/arch/msp430fr5969lp/driver/stdin.cc +endif + +ifdef CONFIG_arch_msp430fr5969lp_driver_i2c CXX_TARGETS += src/arch/msp430fr5969lp/driver/i2c.cc COMMON_FLAGS += -DDRIVER_I2C endif -ifneq ($(findstring spi_a1,${arch_drivers}), ) +ifdef CONFIG_arch_msp430fr5969lp_driver_spi_a1 CXX_TARGETS += src/arch/msp430fr5969lp/driver/spi_a1.cc endif -ifneq ($(findstring spi_b,${arch_drivers}), ) +ifdef CONFIG_arch_msp430fr5969lp_driver_spi_b CXX_TARGETS += src/arch/msp430fr5969lp/driver/spi_b.cc endif -ifneq ($(findstring timer,${arch_drivers}), ) +ifdef CONFIG_arch_msp430fr5969lp_driver_timer CXX_TARGETS += src/arch/msp430fr5969lp/driver/timer.cc endif -ifneq ($(findstring counter,${arch_drivers}), ) +ifdef CONFIG_arch_msp430fr5969lp_driver_counter CXX_TARGETS += src/arch/msp430fr5969lp/driver/counter.cc endif +ifdef CONFIG_arch_msp430fr5969lp_driver_uptime + COMMON_FLAGS += -DTIMER_S + CXX_TARGETS += src/arch/msp430fr5969lp/driver/uptime.cc +endif + + + ifneq (${cpu_freq}, ) COMMON_FLAGS += -DF_CPU=${cpu_freq}UL else diff --git a/src/arch/msp430fr5969lp/arch.cc b/src/arch/msp430fr5969lp/arch.cc index fb7d167..5385d16 100644 --- a/src/arch/msp430fr5969lp/arch.cc +++ b/src/arch/msp430fr5969lp/arch.cc @@ -89,12 +89,6 @@ void Arch::setup(void) TA1CCR0 = 4096; TA1CTL |= TACLR | TAIE; #endif - -#ifdef TIMER_CYCLES - TA2CTL = TASSEL__SMCLK | ID__1 | MC__CONTINUOUS; - TA2EX0 = 0; - TA2CTL |= TACLR; -#endif } #ifdef WITH_WAKEUP diff --git a/src/arch/msp430fr5969lp/driver/counter.cc b/src/arch/msp430fr5969lp/driver/counter.cc index 7a5aca2..741b543 100644 --- a/src/arch/msp430fr5969lp/driver/counter.cc +++ b/src/arch/msp430fr5969lp/driver/counter.cc @@ -2,10 +2,6 @@ #include "driver/counter.h" #include "driver/gpio.h" -#if defined(TIMER_CYCLES) -#warn "timer_cycles and counter are mutually exclusive. Expect odd behaviour." -#endif - Counter counter; #ifndef __acweaving diff --git a/src/arch/msp430fr5969lp/prompt b/src/arch/msp430fr5969lp/prompt new file mode 100644 index 0000000..a8f2b86 --- /dev/null +++ b/src/arch/msp430fr5969lp/prompt @@ -0,0 +1 @@ +MSP430FR5969 Launchpad diff --git a/src/arch/msp430fr5994lp-256k/Kconfig b/src/arch/msp430fr5994lp-256k/Kconfig new file mode 100644 index 0000000..750ed76 --- /dev/null +++ b/src/arch/msp430fr5994lp-256k/Kconfig @@ -0,0 +1,31 @@ +config arch_msp430fr5994lp_256k_driver_adc +bool "ADC (Analog-Digital-Converter)" +select meta_driver_adc + +config arch_msp430fr5994lp_256k_driver_counter +bool "Cycle Counter" +select meta_driver_counter + +config arch_msp430fr5994lp_256k_driver_i2c +bool "I2C on eUSCI_B1" +select meta_driver_i2c + +config arch_msp430fr5994lp_256k_driver_spi_a1 +bool "SPI on eUSCI_A1" +select meta_driver_spi + +config arch_msp430fr5994lp_256k_driver_spi_b +bool "SPI on eUSCI_B1" +select meta_driver_spi + +config arch_msp430fr5994lp_256k_driver_stdin +bool "UART Input" +select meta_driver_stdin + +config arch_msp430fr5994lp_256k_driver_timer +bool "Timer with Interrupts" +select meta_driver_timer + +config arch_msp430fr5994lp_256k_driver_uptime +bool "Uptime Counter" +select meta_driver_uptime diff --git a/src/arch/msp430fr5994lp-256k/prompt b/src/arch/msp430fr5994lp-256k/prompt new file mode 100644 index 0000000..78b169e --- /dev/null +++ b/src/arch/msp430fr5994lp-256k/prompt @@ -0,0 +1 @@ +MSP430FR5994 Launchpad (Large Memory Model) diff --git a/src/arch/msp430fr5994lp/Kconfig b/src/arch/msp430fr5994lp/Kconfig new file mode 100644 index 0000000..8831867 --- /dev/null +++ b/src/arch/msp430fr5994lp/Kconfig @@ -0,0 +1,31 @@ +config arch_msp430fr5994lp_driver_adc +bool "ADC (Analog-Digital-Converter)" +select meta_driver_adc + +config arch_msp430fr5994lp_driver_counter +bool "Cycle Counter" +select meta_driver_counter + +config arch_msp430fr5994lp_driver_i2c +bool "I2C on eUSCI_B1" +select meta_driver_i2c + +config arch_msp430fr5994lp_driver_spi_a1 +bool "SPI on eUSCI_A1" +select meta_driver_spi + +config arch_msp430fr5994lp_driver_spi_b +bool "SPI on eUSCI_B1" +select meta_driver_spi + +config arch_msp430fr5994lp_driver_stdin +bool "UART Input" +select meta_driver_stdin + +config arch_msp430fr5994lp_driver_timer +bool "Timer with Interrupts" +select meta_driver_timer + +config arch_msp430fr5994lp_driver_uptime +bool "Uptime Counter" +select meta_driver_uptime diff --git a/src/arch/msp430fr5994lp/Makefile.inc b/src/arch/msp430fr5994lp/Makefile.inc index e9d666f..0d2df46 100644 --- a/src/arch/msp430fr5994lp/Makefile.inc +++ b/src/arch/msp430fr5994lp/Makefile.inc @@ -29,6 +29,8 @@ SIZE = /opt/msp430/ti/msp430-gcc-full-linux-5.1.2.0/bin/msp430-elf-size ARCH_SHORTNAME = msp430 CXX_TARGETS += src/arch/msp430fr5994lp/arch.cc +CXX_TARGETS += src/arch/msp430fr5994lp/driver/gpio.cc +CXX_TARGETS += src/arch/msp430fr5994lp/driver/stdout.cc ifeq (${aspectc}, 1) ifeq (${msp430_large}, ) @@ -38,40 +40,78 @@ ifeq (${aspectc}, 1) endif endif +# Command-line + ifneq ($(findstring adc,${arch_drivers}), ) - CXX_TARGETS += src/arch/msp430fr5994lp/driver/adc.cc + CONFIG_arch_msp430fr5994lp_driver_adc = y endif -CXX_TARGETS += src/arch/msp430fr5994lp/driver/gpio.cc -CXX_TARGETS += src/arch/msp430fr5994lp/driver/stdout.cc -CXX_TARGETS += src/arch/msp430fr5994lp/driver/uptime.cc - ifneq ($(findstring stdin,${arch_drivers}), ) - CXX_TARGETS += src/arch/msp430fr5994lp/driver/stdin.cc + CONFIG_arch_msp430fr5994lp_driver_stdin = y endif ifneq ($(findstring softi2c,${drivers}), ) else ifneq ($(findstring i2c,${arch_drivers}), ) + CONFIG_arch_msp430fr5994lp_driver_i2c = y +endif + +ifneq ($(findstring spi_a1,${arch_drivers}), ) + CONFIG_arch_msp430fr5994lp_driver_spi_a1 = y +endif + +ifneq ($(findstring spi_b,${arch_drivers}), ) + CONFIG_arch_msp430fr5994lp_driver_spi_b = y +endif + +ifneq ($(findstring timer,${arch_drivers}), ) + CONFIG_arch_msp430fr5994lp_driver_timer = y +endif + +ifneq ($(findstring counter,${arch_drivers}), ) + CONFIG_arch_msp430fr5994lp_driver_counter = y +endif + +ifeq (${timer_s}, 1) + CONFIG_arch_msp430fr5994lp_driver_uptime = y +endif + +# Kconfig + +ifdef CONFIG_arch_msp430fr5994lp_driver_adc + CXX_TARGETS += src/arch/msp430fr5994lp/driver/adc.cc +endif + +ifdef CONFIG_arch_msp430fr5994lp_driver_stdin + CXX_TARGETS += src/arch/msp430fr5994lp/driver/stdin.cc +endif + +ifdef CONFIG_arch_msp430fr5994lp_driver_i2c CXX_TARGETS += src/arch/msp430fr5994lp/driver/i2c.cc COMMON_FLAGS += -DDRIVER_I2C endif -ifneq ($(findstring spi_a1,${arch_drivers}), ) +ifdef CONFIG_arch_msp430fr5994lp_driver_spi_a1 CXX_TARGETS += src/arch/msp430fr5994lp/driver/spi_a1.cc endif -ifneq ($(findstring spi_b,${arch_drivers}), ) +ifdef CONFIG_arch_msp430fr5994lp_driver_spi_b CXX_TARGETS += src/arch/msp430fr5994lp/driver/spi_b.cc endif -ifneq ($(findstring timer,${arch_drivers}), ) +ifdef CONFIG_arch_msp430fr5994lp_driver_timer CXX_TARGETS += src/arch/msp430fr5994lp/driver/timer.cc endif -ifneq ($(findstring counter,${arch_drivers}), ) +ifdef CONFIG_arch_msp430fr5994lp_driver_counter CXX_TARGETS += src/arch/msp430fr5994lp/driver/counter.cc endif +ifdef CONFIG_arch_msp430fr5994lp_driver_uptime + COMMON_FLAGS += -DTIMER_S + CXX_TARGETS += src/arch/msp430fr5994lp/driver/uptime.cc +endif + + ifneq ($(findstring timed_resistive_load,${arch_drivers}), ) CXX_TARGETS += src/arch/msp430fr5994lp/driver/timed_resistive_load.cc resistor1_pin ?= p3_0 diff --git a/src/arch/msp430fr5994lp/arch.cc b/src/arch/msp430fr5994lp/arch.cc index de75fbb..e7d5ff5 100644 --- a/src/arch/msp430fr5994lp/arch.cc +++ b/src/arch/msp430fr5994lp/arch.cc @@ -89,12 +89,6 @@ void Arch::setup(void) TA1CCR0 = 4096; TA1CTL |= TACLR | TAIE; #endif - -#ifdef TIMER_CYCLES - TA2CTL = TASSEL__SMCLK | ID__1 | MC__CONTINUOUS; - TA2EX0 = 0; - TA2CTL |= TACLR; -#endif } #ifdef WITH_WAKEUP diff --git a/src/arch/msp430fr5994lp/driver/counter.cc b/src/arch/msp430fr5994lp/driver/counter.cc index 98a2c4f..daa7a2d 100644 --- a/src/arch/msp430fr5994lp/driver/counter.cc +++ b/src/arch/msp430fr5994lp/driver/counter.cc @@ -1,9 +1,5 @@ #include "driver/counter.h" -#if defined(TIMER_CYCLES) -#warn "timer_cycles and counter are mutually exclusive. Expect odd behaviour." -#endif - Counter counter; #ifndef __acweaving diff --git a/src/arch/msp430fr5994lp/prompt b/src/arch/msp430fr5994lp/prompt new file mode 100644 index 0000000..60b2621 --- /dev/null +++ b/src/arch/msp430fr5994lp/prompt @@ -0,0 +1 @@ +MSP430FR5994 Launchpad diff --git a/src/arch/posix/Kconfig b/src/arch/posix/Kconfig new file mode 100644 index 0000000..d88cbfc --- /dev/null +++ b/src/arch/posix/Kconfig @@ -0,0 +1,10 @@ +config gpio_trace +bool "Trace GPIO changes on stdout" + +config arch_posix_driver_counter +bool "Cycle counter" +select meta_driver_counter + +config arch_posix_driver_uptime +bool "Uptime counter" +select meta_driver_uptime diff --git a/src/arch/posix/Makefile.inc b/src/arch/posix/Makefile.inc index 7bf4ba0..22ddba9 100644 --- a/src/arch/posix/Makefile.inc +++ b/src/arch/posix/Makefile.inc @@ -13,17 +13,33 @@ ifeq (${aspectc}, 1) endif CXX_TARGETS += src/arch/posix/arch.cc src/arch/posix/driver/gpio.cc -CXX_TARGETS += src/arch/posix/driver/stdout.cc src/arch/posix/driver/uptime.cc +CXX_TARGETS += src/arch/posix/driver/stdout.cc ifneq ($(findstring counter,${arch_drivers}), ) + CONFIG_arch_posix_driver_counter = y +endif + +ifeq (${timer_s}, 1) + CONFIG_arch_arduino_nano_driver_uptime = y +endif + +ifdef CONFIG_arch_posix_driver_counter CXX_TARGETS += src/arch/posix/driver/counter.cc endif +ifdef CONFIG_arch_arduino_nano_driver_uptime + COMMON_FLAGS += -DTIMER_S + CXX_TARGETS += src/arch/arduino-nano/driver/uptime.cc +endif + OBJECTS = ${CXX_TARGETS:.cc=.o} ${C_TARGETS:.c=.o} ifneq (${gpio_trace}, ) COMMON_FLAGS += -DGPIO_TRACE endif +ifdef CONFIG_gpio_trace + COMMON_FLAGS += -DGPIO_TRACE +endif .cc.o: ${QUIET}${CXX} ${INCLUDES} ${COMMON_FLAGS} ${CXXFLAGS} -c -o $@ ${@:.o=.cc} diff --git a/src/arch/posix/prompt b/src/arch/posix/prompt new file mode 100644 index 0000000..9615075 --- /dev/null +++ b/src/arch/posix/prompt @@ -0,0 +1 @@ +POSIX diff --git a/src/arch/stm32f446re-nucleo/Kconfig b/src/arch/stm32f446re-nucleo/Kconfig new file mode 100644 index 0000000..df64674 --- /dev/null +++ b/src/arch/stm32f446re-nucleo/Kconfig @@ -0,0 +1,11 @@ +config arch_stm32f446re_nucleo_driver_counter +bool "Cycle Counter" +select meta_driver_counter + +config arch_stm32f446re_nucleo_driver_timer +bool "Timer with Interrupts" +select meta_driver_timer + +config arch_stm32f446re_nucleo_driver_uptime +bool "Uptime Counter" +select meta_driver_uptime diff --git a/src/arch/stm32f446re-nucleo/Makefile.inc b/src/arch/stm32f446re-nucleo/Makefile.inc index 22115f7..554c7a8 100644 --- a/src/arch/stm32f446re-nucleo/Makefile.inc +++ b/src/arch/stm32f446re-nucleo/Makefile.inc @@ -27,34 +27,37 @@ endif CXX_TARGETS += src/arch/stm32f446re-nucleo/driver/gpio.cc CXX_TARGETS += src/arch/stm32f446re-nucleo/driver/stdout.cc -CXX_TARGETS += src/arch/stm32f446re-nucleo/driver/uptime.cc -ifneq ($(findstring stdin,${arch_drivers}), ) - CXX_TARGETS += src/arch/stm32f446re-nucleo/driver/stdin.cc +# Commandline + +ifneq ($(findstring counter,${arch_drivers}), ) + CONFIG_arch_stm32f446re_nucleo_driver_counter = y endif -ifneq ($(findstring softi2c,${drivers}), ) -else ifneq ($(findstring i2c,${arch_drivers}), ) - CXX_TARGETS += src/arch/stm32f446re-nucleo/driver/i2c.cc - COMMON_FLAGS += -DDRIVER_I2C +ifneq ($(findstring timer,${arch_drivers}), ) + CONFIG_arch_stm32f446re_nucleo_driver_timer = y endif -ifneq ($(findstring spi_a1,${arch_drivers}), ) - CXX_TARGETS += src/arch/stm32f446re-nucleo/driver/spi_a1.cc +ifeq (${timer_s}, 1) + CONFIG_arch_stm32f446re_nucleo_driver_uptime = y endif -ifneq ($(findstring spi_b,${arch_drivers}), ) - CXX_TARGETS += src/arch/stm32f446re-nucleo/driver/spi_b.cc +# Kconfig + +ifdef CONFIG_arch_stm32f446re_nucleo_driver_counter + CXX_TARGETS += src/arch/stm32f446re-nucleo/driver/counter.cc endif -ifneq ($(findstring timer,${arch_drivers}), ) +ifdef CONFIG_arch_stm32f446re_nucleo_driver_timer CXX_TARGETS += src/arch/stm32f446re-nucleo/driver/timer.cc endif -ifneq ($(findstring counter,${arch_drivers}), ) - CXX_TARGETS += src/arch/stm32f446re-nucleo/driver/counter.cc +ifdef CONFIG_arch_stm32f446re_nucleo_driver_uptime + COMMON_FLAGS += -DTIMER_S + CXX_TARGETS += src/arch/stm32f446re-nucleo/driver/uptime.cc endif + ifneq (${cpu_freq}, ) COMMON_FLAGS += -DF_CPU=${cpu_freq}UL else diff --git a/src/arch/stm32f446re-nucleo/prompt b/src/arch/stm32f446re-nucleo/prompt new file mode 100644 index 0000000..e81bb4b --- /dev/null +++ b/src/arch/stm32f446re-nucleo/prompt @@ -0,0 +1 @@ +STM32F446RE Nucleo |