diff options
Diffstat (limited to 'src')
70 files changed, 699 insertions, 138 deletions
diff --git a/src/app/aemr/Kconfig b/src/app/aemr/Kconfig new file mode 100644 index 0000000..9c5fc80 --- /dev/null +++ b/src/app/aemr/Kconfig @@ -0,0 +1,2 @@ +prompt "Automatic Energy Model Refinement" +depends on !loop && !wakeup diff --git a/src/app/aemr/Makefile.inc b/src/app/aemr/Makefile.inc index 6e2dda3..7ed7630 100644 --- a/src/app/aemr/Makefile.inc +++ b/src/app/aemr/Makefile.inc @@ -1 +1,3 @@ -override arch_drivers += ,counter +ifdef app + override arch_drivers += ,counter +endif diff --git a/src/app/blinkencat3/Kconfig b/src/app/blinkencat3/Kconfig new file mode 100644 index 0000000..f9230ea --- /dev/null +++ b/src/app/blinkencat3/Kconfig @@ -0,0 +1,2 @@ +prompt "Blinkencat 3" +depends on (arch_arduino_nano || arch_arduino_nano_168) && meta_driver_neopixel && !loop && !wakeup diff --git a/src/app/blinkencat3/Makefile.inc b/src/app/blinkencat3/Makefile.inc index 1bf2b59..2d2d859 100644 --- a/src/app/blinkencat3/Makefile.inc +++ b/src/app/blinkencat3/Makefile.inc @@ -1,2 +1,4 @@ -override loop = 1 -override arch_drivers += ,neopixel +ifdef app + override loop = 1 + override arch_drivers += ,neopixel +endif diff --git a/src/app/button-and-motion-logger/Kconfig b/src/app/button-and-motion-logger/Kconfig new file mode 100644 index 0000000..fe5d888 --- /dev/null +++ b/src/app/button-and-motion-logger/Kconfig @@ -0,0 +1,2 @@ +prompt "Button and Motion Logger" +depends on meta_driver_adc && driver_mpu9250 && !loop && !wakeup diff --git a/src/app/button-and-motion-logger/Makefile.inc b/src/app/button-and-motion-logger/Makefile.inc index f433287..eff5706 100644 --- a/src/app/button-and-motion-logger/Makefile.inc +++ b/src/app/button-and-motion-logger/Makefile.inc @@ -1,2 +1,4 @@ -arch_drivers += ,adc,i2c -override drivers += ,mpu9250 +ifdef app + override arch_drivers += ,adc,i2c + override drivers += ,mpu9250 +endif diff --git a/src/app/ccs811test/Kconfig b/src/app/ccs811test/Kconfig new file mode 100644 index 0000000..a219a0f --- /dev/null +++ b/src/app/ccs811test/Kconfig @@ -0,0 +1,2 @@ +prompt "CCS811 Logger" +depends on driver_ccs811 && loop && !wakeup diff --git a/src/app/ccs811test/Makefile.inc b/src/app/ccs811test/Makefile.inc index 4889e55..6bc097a 100644 --- a/src/app/ccs811test/Makefile.inc +++ b/src/app/ccs811test/Makefile.inc @@ -1,3 +1,5 @@ -override arch_drivers += ,i2c -override drivers += ,ccs811 -loop ?= 1 +ifdef app + override arch_drivers += ,i2c + override drivers += ,ccs811 + override loop = 1 +endif diff --git a/src/app/countertest/Kconfig b/src/app/countertest/Kconfig new file mode 100644 index 0000000..141c3f6 --- /dev/null +++ b/src/app/countertest/Kconfig @@ -0,0 +1,2 @@ +prompt "Cycle Counter Test" +depends on meta_driver_counter && loop && !wakeup diff --git a/src/app/countertest/Makefile.inc b/src/app/countertest/Makefile.inc index f8a5514..0bf380e 100644 --- a/src/app/countertest/Makefile.inc +++ b/src/app/countertest/Makefile.inc @@ -1,2 +1,4 @@ -loop ?= 1 -override arch_drivers += ,counter +ifdef app + override loop = 1 + override arch_drivers += ,counter +endif diff --git a/src/app/donothing/Makefile.inc b/src/app/donothing/Makefile.inc index 0608a82..bf22978 100644 --- a/src/app/donothing/Makefile.inc +++ b/src/app/donothing/Makefile.inc @@ -1,3 +1,4 @@ -timer_cycles = 0 -timer_s = 0 -loop = 0 +ifdef app + override timer_s = 0 + override loop = 0 +endif diff --git a/src/app/i2cbench/Makefile.inc b/src/app/i2cbench/Makefile.inc index 15ce127..c5241fd 100644 --- a/src/app/i2cbench/Makefile.inc +++ b/src/app/i2cbench/Makefile.inc @@ -1,4 +1,6 @@ -arch_drivers += ,i2c +ifdef app + override arch_drivers += ,i2c +endif ifneq (${i2cbench_setos}, ) COMMON_FLAGS += -DI2CBENCH_SETOS=${i2cbench_setos} diff --git a/src/app/i2cdetect/Kconfig b/src/app/i2cdetect/Kconfig new file mode 100644 index 0000000..d0415f0 --- /dev/null +++ b/src/app/i2cdetect/Kconfig @@ -0,0 +1,2 @@ +prompt "I2C Bus Scanner" +depends on meta_driver_i2c diff --git a/src/app/i2cdetect/Makefile.inc b/src/app/i2cdetect/Makefile.inc index 7620800..c76489c 100644 --- a/src/app/i2cdetect/Makefile.inc +++ b/src/app/i2cdetect/Makefile.inc @@ -1,3 +1,4 @@ -arch_drivers += ,i2c -drivers += ,lm75 -loop ?= 1 +ifdef app + override loop = 1 + override arch_drivers += ,i2c +endif diff --git a/src/app/ledblink/Kconfig b/src/app/ledblink/Kconfig new file mode 100644 index 0000000..0075bf8 --- /dev/null +++ b/src/app/ledblink/Kconfig @@ -0,0 +1,2 @@ +prompt "LED Blink" +depends on loop && !wakeup diff --git a/src/app/ledblink/Makefile.inc b/src/app/ledblink/Makefile.inc index 2cb8a42..ec71d40 100644 --- a/src/app/ledblink/Makefile.inc +++ b/src/app/ledblink/Makefile.inc @@ -1 +1,3 @@ -loop ?= 1 +ifdef app + override loop = 1 +endif diff --git a/src/app/loratest/Makefile.inc b/src/app/loratest/Makefile.inc index 2cb8a42..ec71d40 100644 --- a/src/app/loratest/Makefile.inc +++ b/src/app/loratest/Makefile.inc @@ -1 +1,3 @@ -loop ?= 1 +ifdef app + override loop = 1 +endif diff --git a/src/app/luxlog/Kconfig b/src/app/luxlog/Kconfig new file mode 100644 index 0000000..6e1c6e6 --- /dev/null +++ b/src/app/luxlog/Kconfig @@ -0,0 +1,2 @@ +prompt "Ambient Brightness Logger" +depends on driver_max44009 diff --git a/src/app/luxlog/Makefile.inc b/src/app/luxlog/Makefile.inc index bcee1d0..a0cbcd8 100644 --- a/src/app/luxlog/Makefile.inc +++ b/src/app/luxlog/Makefile.inc @@ -1,3 +1,5 @@ -arch_drivers += ,i2c -drivers += ,max44009 -loop ?= 1 +ifdef app + override loop = 1 + override arch_drivers += ,i2c + override drivers += ,max44009 +endif diff --git a/src/app/mpu9250_motionlog/Kconfig b/src/app/mpu9250_motionlog/Kconfig new file mode 100644 index 0000000..27d605f --- /dev/null +++ b/src/app/mpu9250_motionlog/Kconfig @@ -0,0 +1,2 @@ +prompt "Motion Logger" +depends on driver_mpu9250 diff --git a/src/app/mpu9250_motionlog/Makefile.inc b/src/app/mpu9250_motionlog/Makefile.inc index 5da92be..ed959ca 100644 --- a/src/app/mpu9250_motionlog/Makefile.inc +++ b/src/app/mpu9250_motionlog/Makefile.inc @@ -1,2 +1,4 @@ -arch_drivers += ,i2c -override drivers += ,mpu9250 +ifdef app + override arch_drivers += ,i2c + override drivers += ,mpu9250 +endif diff --git a/src/app/nrf24l01test/Makefile.inc b/src/app/nrf24l01test/Makefile.inc index 6713ddb..f84bcbd 100644 --- a/src/app/nrf24l01test/Makefile.inc +++ b/src/app/nrf24l01test/Makefile.inc @@ -1,6 +1,8 @@ -override drivers += ,nrf24l01 -timer_s ?= 1 -loop ?= 1 +ifdef app + override loop = 1 + override timer_s = 1 + override drivers += ,nrf24l01 +endif ifeq (${tx}, 1) COMMON_FLAGS += -DNRF24L01TEST_TX diff --git a/src/app/sharp96test/Kconfig b/src/app/sharp96test/Kconfig new file mode 100644 index 0000000..30b9ac3 --- /dev/null +++ b/src/app/sharp96test/Kconfig @@ -0,0 +1,2 @@ +prompt "Sharp96 Test" +depends on driver_sharp96 diff --git a/src/app/sharp96test/Makefile.inc b/src/app/sharp96test/Makefile.inc index 4dbcaca..37bb857 100644 --- a/src/app/sharp96test/Makefile.inc +++ b/src/app/sharp96test/Makefile.inc @@ -1 +1,5 @@ -driver_sharp96 ?= 1 +ifdef app + override loop = 1 + override arch_drivers += spi_b + override drivers += sharp96 +endif diff --git a/src/app/shell/Kconfig b/src/app/shell/Kconfig new file mode 100644 index 0000000..a4626d6 --- /dev/null +++ b/src/app/shell/Kconfig @@ -0,0 +1,2 @@ +prompt "Shell / UART Echo" +depends on meta_driver_stdin && wakeup diff --git a/src/app/shell/Makefile.inc b/src/app/shell/Makefile.inc index 66d80ec..3d73351 100644 --- a/src/app/shell/Makefile.inc +++ b/src/app/shell/Makefile.inc @@ -1,2 +1,5 @@ -arch_drivers += ,stdin -wakeup ?= 1 +ifdef app + override loop = 0 + override wakeup = 1 + override arch_drivers += ,stdin +endif diff --git a/src/app/shell/main.cc b/src/app/shell/main.cc index 33896e4..0a7d4ca 100644 --- a/src/app/shell/main.cc +++ b/src/app/shell/main.cc @@ -2,7 +2,6 @@ #include "driver/gpio.h" #include "driver/stdout.h" #include "driver/stdin.h" -#include "driver/uptime.h" /* void check_command(unsigned char argc, char** argv) diff --git a/src/app/sysinfo/Makefile.inc b/src/app/sysinfo/Makefile.inc index 4cc2151..ec71d40 100644 --- a/src/app/sysinfo/Makefile.inc +++ b/src/app/sysinfo/Makefile.inc @@ -1 +1,3 @@ -loop = 1 +ifdef app + override loop = 1 +endif diff --git a/src/app/timertest/Makefile.inc b/src/app/timertest/Makefile.inc index 9d375f1..9754020 100644 --- a/src/app/timertest/Makefile.inc +++ b/src/app/timertest/Makefile.inc @@ -1,3 +1,5 @@ -loop ?= 1 -timer_s ?= 1 -arch_drivers += ,timer +ifdef app + override loop = 1 + override timer_s = 1 + override arch_drivers += ,timer +endif diff --git a/src/app/transactiontest/Makefile.inc b/src/app/transactiontest/Makefile.inc index 63d2323..25d4378 100644 --- a/src/app/transactiontest/Makefile.inc +++ b/src/app/transactiontest/Makefile.inc @@ -1,7 +1,6 @@ -timer_cycles ?= 1 -timer_s ?= 1 -loop ?= 1 +ifdef app + override loop = 1 + override timer_s = 1 +endif -driver_sharp96 ?= 1 - -ASM_TARGETS += src/app/transactiontest/util.S
\ No newline at end of file +ASM_TARGETS += src/app/transactiontest/util.S diff --git a/src/app/waittest/Makefile.inc b/src/app/waittest/Makefile.inc index 9d375f1..9754020 100644 --- a/src/app/waittest/Makefile.inc +++ b/src/app/waittest/Makefile.inc @@ -1,3 +1,5 @@ -loop ?= 1 -timer_s ?= 1 -arch_drivers += ,timer +ifdef app + override loop = 1 + override timer_s = 1 + override arch_drivers += ,timer +endif diff --git a/src/app/wetterstation/Kconfig b/src/app/wetterstation/Kconfig new file mode 100644 index 0000000..691784c --- /dev/null +++ b/src/app/wetterstation/Kconfig @@ -0,0 +1,2 @@ +prompt "Wetterstation" +depends on meta_driver_adc && (arch_arduino_nano || arch_arduino_nano_168) diff --git a/src/app/wetterstation/Makefile.inc b/src/app/wetterstation/Makefile.inc index 2cb8a42..ec71d40 100644 --- a/src/app/wetterstation/Makefile.inc +++ b/src/app/wetterstation/Makefile.inc @@ -1 +1,3 @@ -loop ?= 1 +ifdef app + override loop = 1 +endif diff --git a/src/app/ws2812b_dmap/Makefile.inc b/src/app/ws2812b_dmap/Makefile.inc index ce0a386..a515d32 100644 --- a/src/app/ws2812b_dmap/Makefile.inc +++ b/src/app/ws2812b_dmap/Makefile.inc @@ -1,2 +1,4 @@ -loop ?= 1 -arch_drivers += ,stdin,neopixel +ifdef app + override loop = 1 + override arch_drivers += ,stdin,neopixel +endif diff --git a/src/app/ws2812b_uart/Kconfig b/src/app/ws2812b_uart/Kconfig new file mode 100644 index 0000000..7566e4c --- /dev/null +++ b/src/app/ws2812b_uart/Kconfig @@ -0,0 +1,2 @@ +prompt "UART to WS2812b" +depends on (arch_arduino_nano || arch_arduino_nano_168) && meta_driver_neopixel diff --git a/src/app/ws2812b_uart/Makefile.inc b/src/app/ws2812b_uart/Makefile.inc index ce0a386..a515d32 100644 --- a/src/app/ws2812b_uart/Makefile.inc +++ b/src/app/ws2812b_uart/Makefile.inc @@ -1,2 +1,4 @@ -loop ?= 1 -arch_drivers += ,stdin,neopixel +ifdef app + override loop = 1 + override arch_drivers += ,stdin,neopixel +endif 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 diff --git a/src/driver/Kconfig b/src/driver/Kconfig new file mode 100644 index 0000000..49bfbdd --- /dev/null +++ b/src/driver/Kconfig @@ -0,0 +1,88 @@ +config meta_driver_adc +bool +config meta_driver_counter +bool +config meta_driver_i2c +bool +config meta_driver_neopixel +bool +config meta_driver_spi +bool +config meta_driver_stdin +bool +config meta_driver_timer +bool + +menu "Drivers" + +config driver_am2320 +bool "AM2320 TH Sensor" +depends on meta_driver_i2c + +config driver_bme280 +bool "BME280 TPH Sensor" +depends on meta_driver_i2c + +config driver_bme680 +bool "BME680 TPH+IAQ Sensor" +depends on meta_driver_i2c + +config driver_ccs811 +bool "CCS811 VOC Sensor" +depends on meta_driver_i2c + +config driver_dummy +bool "Dummy driver" + +config driver_eepom24lc64 +bool "24LC64 EEPROM" + +config driver_hcd1080 +bool "HDC1080 TH Sensor with Heated Plate" +depends on meta_driver_i2c + +config driver_lm75 +bool "LM75 Temperature Sensor" +depends on meta_driver_i2c +# depends on I2C + +config driver_max44006 +bool "MAX44006 RGB Sensor" +depends on meta_driver_i2c + +config driver_max44009 +bool "MAX44009 Ambient Light Sensor" +depends on meta_driver_i2c + +config driver_mmsimple +bool "MicroMoody simple" +depends on meta_driver_i2c + +config driver_mmsubstate +bool "MicroMoody with Sub-States" +depends on meta_driver_i2c + +config driver_mpu9250 +bool "MPU9250 Accelerometer/Gyroscope/Magnetometer" +depends on meta_driver_i2c + +config driver_nrf24l01 +bool "nRF24L01+ 2.4GHz Radio" +depends on meta_driver_spi + +config driver_resistive_load +bool "Resistive Load for Energy Model Generation Evaluation" + +config driver_s5851a +bool "S5851A LoRaWAN Radio" + +config driver_sharp96 +bool "sharp LS013B4DN 96x96px Transflective LC Display" +depends on meta_driver_spi + +config driver_soft_i2c +bool "Software I2C" +#depends on !driver_i2c +select meta_driver_i2c + +endmenu diff --git a/src/driver/soft_i2c.cc b/src/driver/soft_i2c.cc index 285caef..b03b9e1 100644 --- a/src/driver/soft_i2c.cc +++ b/src/driver/soft_i2c.cc @@ -7,9 +7,6 @@ #endif #ifdef SOFTI2C_TIMER -#ifdef TIMER_CYCLES -#error "SOFTI2C_TIMER and TIMER_CYCLES are mutually exclusive" -#endif #include "driver/timer.h" volatile unsigned char timer_done = 0; #endif |