diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/app/bad-apple-msp430fr-sharp96/.config | 73 | ||||
| -rw-r--r-- | src/arch/arduino-uno/Kconfig | 80 | ||||
| -rw-r--r-- | src/arch/arduino-uno/Makefile.inc | 195 | ||||
| l--------- | src/arch/arduino-uno/arch.cc | 1 | ||||
| l--------- | src/arch/arduino-uno/driver/adc.cc | 1 | ||||
| l--------- | src/arch/arduino-uno/driver/counter.cc | 1 | ||||
| l--------- | src/arch/arduino-uno/driver/dmx.cc | 1 | ||||
| l--------- | src/arch/arduino-uno/driver/gpio.cc | 1 | ||||
| l--------- | src/arch/arduino-uno/driver/i2c.cc | 1 | ||||
| l--------- | src/arch/arduino-uno/driver/neopixel.cc | 1 | ||||
| l--------- | src/arch/arduino-uno/driver/spi.cc | 1 | ||||
| l--------- | src/arch/arduino-uno/driver/stdin.cc | 1 | ||||
| l--------- | src/arch/arduino-uno/driver/stdout.cc | 1 | ||||
| l--------- | src/arch/arduino-uno/driver/timer.cc | 1 | ||||
| l--------- | src/arch/arduino-uno/driver/uptime.cc | 1 | ||||
| -rw-r--r-- | src/arch/arduino-uno/prompt | 1 |
16 files changed, 361 insertions, 0 deletions
diff --git a/src/app/bad-apple-msp430fr-sharp96/.config b/src/app/bad-apple-msp430fr-sharp96/.config new file mode 100644 index 0000000..26a9fa1 --- /dev/null +++ b/src/app/bad-apple-msp430fr-sharp96/.config @@ -0,0 +1,73 @@ +# +# Automatically generated file; DO NOT EDIT. +# Configuration +# + +# +# System +# +# CONFIG_loop is not set +# CONFIG_wakeup is not set +# CONFIG_ostream is not set +# CONFIG_aspectc is not set +CONFIG_timer_freq=10 +# CONFIG_framebuffer is not set + +# +# Libraries +# +CONFIG_lib_inflate=y +# CONFIG_lib_inflate_checksum is not set +CONFIG_lib_inflate_lut=y +# CONFIG_arch_arduino_nano is not set +# CONFIG_arch_atmega2560 is not set +# CONFIG_arch_blinkenrocket is not set +# CONFIG_arch_infineon_tc299_mock is not set +# CONFIG_arch_infineon_tc397_mock is not set +# CONFIG_arch_lm4f120h5qr_stellaris is not set +# CONFIG_arch_lora32u4ii is not set +# CONFIG_arch_msp430fr5969lp is not set +CONFIG_arch_msp430fr5994lp=y +# CONFIG_arch_posix is not set +# CONFIG_arch_rm46l8lp is not set +# CONFIG_arch_stm32f103c8t6 is not set +# CONFIG_arch_stm32f446re_nucleo is not set +# CONFIG_arch_stm32f746zg_nucleo is not set +# CONFIG_arch_stm32h747i_disco is not set +# CONFIG_arch_tc1796_triboard is not set +CONFIG_arch="msp430fr5994lp" + +# +# MSP430FR5994 Launchpad Configuration +# +# CONFIG_arch_msp430fr5994lp_driver_adc is not set +# CONFIG_arch_msp430fr5994lp_driver_counter is not set +# CONFIG_arch_msp430fr5994lp_driver_dmx1 is not set +# CONFIG_arch_msp430fr5994lp_driver_dmx2 is not set +# CONFIG_arch_msp430fr5994lp_driver_dmx3 is not set +# CONFIG_arch_msp430fr5994lp_driver_i2c is not set +CONFIG_arch_msp430fr5994lp_driver_spi=y +# CONFIG_arch_msp430fr5994lp_driver_stdout1 is not set +# CONFIG_arch_msp430fr5994lp_driver_stdout2 is not set +# CONFIG_arch_msp430fr5994lp_driver_stdout3 is not set +# CONFIG_arch_msp430fr5994lp_driver_stdin is not set +CONFIG_arch_msp430fr5994lp_driver_timer=y +# CONFIG_arch_msp430fr5994lp_driver_uptime is not set +CONFIG_arch_msp430fr5994lp_large_mode=y +CONFIG_app_bad_apple_msp430fr_sharp96=y +# CONFIG_app_donothing is not set +# CONFIG_app_energybench is not set +# CONFIG_app_etcontroller is not set +# CONFIG_app_treebench is not set +# CONFIG_app_treebench_copy is not set +CONFIG_app="bad-apple-msp430fr-sharp96" +CONFIG_meta_driver_spi=y +CONFIG_meta_driver_timer=y + +# +# Drivers +# +# CONFIG_driver_nrf24l01 is not set +# CONFIG_driver_pervasive_aurora_mb is not set +CONFIG_driver_sharp96=y +# CONFIG_driver_softi2c is not set diff --git a/src/arch/arduino-uno/Kconfig b/src/arch/arduino-uno/Kconfig new file mode 100644 index 0000000..6904e65 --- /dev/null +++ b/src/arch/arduino-uno/Kconfig @@ -0,0 +1,80 @@ +# Copyright 2026 Birte Kristina Friesel +# +# SPDX-License-Identifier: CC0-1.0 + +config arch_arduino_uno_cpufreq +int "CPU Frequency" +#!accept [62500, 125000, 250000, 500000, 1000000, 2000000, 4000000, 8000000, 16000000] +range 62500 16000000 +default 16000000 +help + Assumes an externel 16MHz crystal to be present + Must be one of 62500, 125000, 250000, 500000, 1000000, 2000000, 4000000, 8000000, 16000000. + +config arch_arduino_uno_driver_adc +bool "ADC on PC<0-5>" +help + ADC0: PC0 + ADC1: PC1 + ADC2: PC2 + ADC3: PC3 + ADC4: PC4 + ADC5: PC5 + ADC6: --- + ADC7: --- +select meta_driver_adc + +config arch_arduino_uno_driver_i2c +bool "I²C on PC[45]" +help + SDA: PC4 + SCL: PC5 +select meta_driver_hardware_i2c +select meta_driver_i2c + +config arch_arduino_uno_driver_neopixel +bool "WS2812b (NeoPixel)" +select meta_driver_neopixel + +config arch_arduino_uno_driver_spi +bool "SPI on PB[2345]" +help + SS: PB2 + MOSI: PB3 + MISO: PB4 + SCK: PB5 +select meta_driver_spi + +config arch_arduino_uno_driver_stdin +bool "UART Input on PD0" +help + RX: PD0 (USB) +select meta_driver_stdin + +config arch_arduino_uno_driver_timer +bool "Timer with Interrupts" +select meta_driver_timer + +config arch_arduino_uno_driver_dmx +bool "DMX" +select meta_driver_dmx + +config arch_arduino_uno_driver_dmx_pin +string "DMX Pin" +default "pb5" +depends on arch_arduino_uno_driver_dmx + +choice arch_arduino_uno_timer1 + +bool "Timer 1" +optional + +config arch_arduino_uno_driver_uptime +bool "Uptime Counter" +select meta_driver_uptime + +config arch_arduino_uno_driver_counter +bool "Cycle Counter" +select meta_driver_counter + +endchoice diff --git a/src/arch/arduino-uno/Makefile.inc b/src/arch/arduino-uno/Makefile.inc new file mode 100644 index 0000000..2a388a1 --- /dev/null +++ b/src/arch/arduino-uno/Makefile.inc @@ -0,0 +1,195 @@ +# vim:ft=make +# +# Copyright 2020 Birte Kristina Friesel +# +# SPDX-License-Identifier: BSD-2-Clause + +MCU = atmega328p +SERIAL_PORT ?= /dev/ttyACM0 +BAUD = 115200 + +ifdef CONFIG_arch_arduino_uno_cpufreq + cpu_freq = ${CONFIG_arch_arduino_uno_cpufreq} +endif + +cpu_freq ?= 16000000 + +COMMON_FLAGS += -Werror=overflow +COMMON_FLAGS += -mmcu=${MCU} -DMULTIPASS_ARCH_arduino_uno +COMMON_FLAGS += -DF_CPU=${cpu_freq}UL +COMMON_FLAGS += -DHAVE_PROGMEM + +ifeq (${stack_usage}, ) + COMMON_FLAGS += -flto +endif + +CC = avr-gcc +CXX = avr-g++ +NM = avr-nm +OBJCOPY = avr-objcopy +OBJDUMP = avr-objdump + +ARCH_SHORTNAME = avr + +ifdef CONFIG_aspectc + CXX = ag++ -r build/repo.acp -v 0 --c_compiler avr-g++ -p . --Xcompiler +endif + +CXX_TARGETS += src/arch/arduino-uno/arch.cc +CXX_TARGETS += src/arch/arduino-uno/driver/gpio.cc +CXX_TARGETS += src/arch/arduino-uno/driver/stdout.cc + +# Command-line driver selection + +ifneq ($(findstring softi2c,${drivers}), ) +else ifneq ($(findstring i2c,${arch_drivers}), ) + CONFIG_arch_arduino_uno_driver_i2c = y +endif + +ifneq ($(findstring adc,${arch_drivers}), ) + CONFIG_arch_arduino_uno_driver_adc = y +endif + +ifneq ($(findstring spi,${arch_drivers}), ) + CONFIG_arch_arduino_uno_driver_spi = y +endif + +ifneq ($(findstring stdin,${arch_drivers}), ) + CONFIG_arch_arduino_uno_driver_stdin = y +endif + +ifneq ($(findstring timer,${arch_drivers}), ) + CONFIG_arch_arduino_uno_driver_timer = y +endif + +ifneq ($(findstring counter,${arch_drivers}), ) + CONFIG_arch_arduino_uno_driver_counter = y +endif + +ifneq ($(findstring neopixel,${arch_drivers}), ) + CONFIG_arch_arduino_uno_driver_neopixel = y +endif + +ifeq (${timer_s}, 1) + CONFIG_arch_arduino_uno_driver_uptime = y +endif + +# Kconfig driver selection + +ifdef CONFIG_arch_arduino_uno_driver_i2c + CXX_TARGETS += src/arch/arduino-uno/driver/i2c.cc +endif + +ifdef CONFIG_arch_arduino_uno_driver_adc + CXX_TARGETS += src/arch/arduino-uno/driver/adc.cc +endif + +ifdef CONFIG_arch_arduino_uno_driver_dmx + CXX_TARGETS += src/arch/arduino-uno/driver/dmx.cc +endif + +ifdef CONFIG_arch_arduino_uno_driver_spi + CXX_TARGETS += src/arch/arduino-uno/driver/spi.cc +endif + +ifdef CONFIG_arch_arduino_uno_driver_stdin + CXX_TARGETS += src/arch/arduino-uno/driver/stdin.cc +endif + +ifdef CONFIG_arch_arduino_uno_driver_timer + CXX_TARGETS += src/arch/arduino-uno/driver/timer.cc +endif + +ifdef CONFIG_arch_arduino_uno_driver_counter + CXX_TARGETS += src/arch/arduino-uno/driver/counter.cc +endif + +ifdef CONFIG_arch_arduino_uno_driver_neopixel + CXX_TARGETS += src/arch/arduino-uno/driver/neopixel.cc +endif + +ifdef CONFIG_arch_arduino_uno_driver_uptime + COMMON_FLAGS += -DTIMER_S + CXX_TARGETS += src/arch/arduino-uno/driver/uptime.cc +endif + +ifeq (${cpu_freq}, 16000000) + uart_baud = 57600 +else ifeq (${cpu_freq}, 8000000) + uart_baud = 38400 +else ifeq (${cpu_freq}, 4000000) + uart_baud = 38400 +else ifeq (${cpu_freq}, 2000000) + uart_baud = 19200 +else ifeq (${cpu_freq}, 1000000) + uart_baud = 9600 +else ifeq (${cpu_freq}, 500000) + uart_baud = 4800 +else ifeq (${cpu_freq}, 250000) + uart_baud = 2400 +else ifeq (${cpu_freq}, 125000) + uart_baud = 1200 +else ifeq (${cpu_freq}, 62500) + uart_baud = 300 +else + uart_baud = 9600 +endif + +COMMON_FLAGS += -DBAUD=${uart_baud}UL + +OBJECTS = ${SO_TARGETS:.a=.so} ${CXX_TARGETS:.cc=.o} ${C_TARGETS:.c=.o} + +%.o : %.cc | include/config.h + ${QUIET}${CXX} ${INCLUDES} ${COMMON_FLAGS} ${CXXFLAGS} -c -o $@ ${@:.o=.cc} + +%.o : %.c | include/config.h + ${QUIET}${CC} ${INCLUDES} ${COMMON_FLAGS} ${CFLAGS} -c -o $@ ${@:.o=.c} + +%.so : %.a | include/config.h + ${QUIET}${CC} ${COMMON_FLAGS} -o $@ -Wl,--whole-archive ${@:.so=.a} -Wl,--no-whole-archive + +build/system.elf: ${OBJECTS} + ${QUIET}mkdir -p build + ${QUIET}${CXX} ${COMMON_FLAGS} ${CXXFLAGS} -Wl,--gc-sections -o $@ ${OBJECTS} + ${QUIET}avr-size --format=avr --mcu=${MCU} $@ + ${QUIET}test $$(avr-size --format=avr --mcu=${MCU} build/system.elf | fgrep Program | grep -o '[0-9.]*%' | cut -d . -f 1) -lt 100 + +build/system.hex: build/system.elf + ${QUIET}${OBJCOPY} -O ihex ${@:.hex=.elf} $@ + +program: build/system.hex + ${QUIET}avrdude -p ${MCU} -c arduino -P ${SERIAL_PORT} -b ${BAUD} -U flash:w:build/system.hex + +arch_clean: + ${QUIET}rm -f ${OBJECTS} build/system.hex + +cat: + ${QUIET}script/cat.py ${SERIAL_PORT} ${uart_baud} ${cpu_freq} 65536 + +monitor: + ${QUIET}screen ${SERIAL_PORT} ${uart_baud} + +size: build/system.elf + ${QUIET}avr-size --format=avr --mcu=atmega328p build/system.elf | fgrep Program | perl -nE 'if (m{(\d+) bytes \(([0-9.]+%)}) { print("$$1;$$2;") }' + ${QUIET}avr-size --format=avr --mcu=atmega328p build/system.elf | fgrep Data | perl -nE 'if (m{(\d+) bytes \(([0-9.]+%)}) { print("$$1;$$2;") }' + ${QUIET}echo + +arch_help: + @echo "arduino-uno specific flags:" + @echo " SERIAL_PORT = ${SERIAL_PORT}" + @echo " BAUD = ${BAUD} (only used for programming)" + +arch_info: + @echo "CPU Freq: ${cpu_freq} Hz" + @echo "Timer Freq: ${timer_freq} Hz" + @echo "I2C Freq: ${i2c_freq} Hz" + @echo "Counter Overflow: 65536/255" + @echo "Monitor: ${SERIAL_PORT} ${uart_baud}" + +attributes: build/system.elf + ${QUIET}script/size.py avr-size text,data data,bss + +nfpvalues: build/system.elf + ${QUIET}script/nfpvalues.py avr-size text,data data,bss + +.PHONY: arch_clean arch_help arch_info attributes cat monitor program size diff --git a/src/arch/arduino-uno/arch.cc b/src/arch/arduino-uno/arch.cc new file mode 120000 index 0000000..808ad49 --- /dev/null +++ b/src/arch/arduino-uno/arch.cc @@ -0,0 +1 @@ +../arduino-nano/arch.cc
\ No newline at end of file diff --git a/src/arch/arduino-uno/driver/adc.cc b/src/arch/arduino-uno/driver/adc.cc new file mode 120000 index 0000000..2af9b2a --- /dev/null +++ b/src/arch/arduino-uno/driver/adc.cc @@ -0,0 +1 @@ +../../arduino-nano/driver/adc.cc
\ No newline at end of file diff --git a/src/arch/arduino-uno/driver/counter.cc b/src/arch/arduino-uno/driver/counter.cc new file mode 120000 index 0000000..298b552 --- /dev/null +++ b/src/arch/arduino-uno/driver/counter.cc @@ -0,0 +1 @@ +../../arduino-nano/driver/counter.cc
\ No newline at end of file diff --git a/src/arch/arduino-uno/driver/dmx.cc b/src/arch/arduino-uno/driver/dmx.cc new file mode 120000 index 0000000..1fa663a --- /dev/null +++ b/src/arch/arduino-uno/driver/dmx.cc @@ -0,0 +1 @@ +../../arduino-nano/driver/dmx.cc
\ No newline at end of file diff --git a/src/arch/arduino-uno/driver/gpio.cc b/src/arch/arduino-uno/driver/gpio.cc new file mode 120000 index 0000000..cfdbbcc --- /dev/null +++ b/src/arch/arduino-uno/driver/gpio.cc @@ -0,0 +1 @@ +../../arduino-nano/driver/gpio.cc
\ No newline at end of file diff --git a/src/arch/arduino-uno/driver/i2c.cc b/src/arch/arduino-uno/driver/i2c.cc new file mode 120000 index 0000000..d31e7a1 --- /dev/null +++ b/src/arch/arduino-uno/driver/i2c.cc @@ -0,0 +1 @@ +../../arduino-nano/driver/i2c.cc
\ No newline at end of file diff --git a/src/arch/arduino-uno/driver/neopixel.cc b/src/arch/arduino-uno/driver/neopixel.cc new file mode 120000 index 0000000..fea98ca --- /dev/null +++ b/src/arch/arduino-uno/driver/neopixel.cc @@ -0,0 +1 @@ +../../arduino-nano/driver/neopixel.cc
\ No newline at end of file diff --git a/src/arch/arduino-uno/driver/spi.cc b/src/arch/arduino-uno/driver/spi.cc new file mode 120000 index 0000000..16c9bf4 --- /dev/null +++ b/src/arch/arduino-uno/driver/spi.cc @@ -0,0 +1 @@ +../../arduino-nano/driver/spi.cc
\ No newline at end of file diff --git a/src/arch/arduino-uno/driver/stdin.cc b/src/arch/arduino-uno/driver/stdin.cc new file mode 120000 index 0000000..5b0e596 --- /dev/null +++ b/src/arch/arduino-uno/driver/stdin.cc @@ -0,0 +1 @@ +../../arduino-nano/driver/stdin.cc
\ No newline at end of file diff --git a/src/arch/arduino-uno/driver/stdout.cc b/src/arch/arduino-uno/driver/stdout.cc new file mode 120000 index 0000000..3d2bcb4 --- /dev/null +++ b/src/arch/arduino-uno/driver/stdout.cc @@ -0,0 +1 @@ +../../arduino-nano/driver/stdout.cc
\ No newline at end of file diff --git a/src/arch/arduino-uno/driver/timer.cc b/src/arch/arduino-uno/driver/timer.cc new file mode 120000 index 0000000..ccc5a3e --- /dev/null +++ b/src/arch/arduino-uno/driver/timer.cc @@ -0,0 +1 @@ +../../arduino-nano/driver/timer.cc
\ No newline at end of file diff --git a/src/arch/arduino-uno/driver/uptime.cc b/src/arch/arduino-uno/driver/uptime.cc new file mode 120000 index 0000000..8961f79 --- /dev/null +++ b/src/arch/arduino-uno/driver/uptime.cc @@ -0,0 +1 @@ +../../arduino-nano/driver/uptime.cc
\ No newline at end of file diff --git a/src/arch/arduino-uno/prompt b/src/arch/arduino-uno/prompt new file mode 100644 index 0000000..02085ae --- /dev/null +++ b/src/arch/arduino-uno/prompt @@ -0,0 +1 @@ +Arduino Uno |
