diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a5452548cc..6722d31c22 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -176,7 +176,7 @@ jobs: - name: Examples AVR Series if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py avr arduino_uno arduino_nano) + (cd examples && ../tools/scripts/examples_compile.py avr arduino_uno arduino_nano srxe) - name: Compile AVR Unittests AT90CAN if: always() run: | diff --git a/README.md b/README.md index 60cf4fd45e..12b02e55bf 100644 --- a/README.md +++ b/README.md @@ -523,6 +523,7 @@ We have out-of-box support for many development boards including documentation. Raspberry Pi SAMD21-MINI +SRXE STM32-F4VE STM32F030-DEMO diff --git a/examples/srxe/blink/main.cpp b/examples/srxe/blink/main.cpp new file mode 100644 index 0000000000..d255352002 --- /dev/null +++ b/examples/srxe/blink/main.cpp @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2021, Tomasz Wasilczyk + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#include + +int +main() +{ + using namespace Board; + + initialize(); + + while (true) + { + LedDebug::toggle(); + modm::delay(1s); + } +} diff --git a/examples/srxe/blink/project.xml b/examples/srxe/blink/project.xml new file mode 100644 index 0000000000..5b21e4583c --- /dev/null +++ b/examples/srxe/blink/project.xml @@ -0,0 +1,9 @@ + + modm:srxe + + + + + modm:build:scons + + diff --git a/src/modm/board/srxe/board.hpp b/src/modm/board/srxe/board.hpp new file mode 100644 index 0000000000..5d050fb241 --- /dev/null +++ b/src/modm/board/srxe/board.hpp @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021, Tomasz Wasilczyk + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +// ---------------------------------------------------------------------------- + +#pragma once + +#include + +/// @ingroup modm_board_srxe +namespace Board { + +using namespace modm::literals; + +using SystemClock = modm::platform::SystemClock; + +using LedDebug = modm::platform::GpioB0; +using Leds = modm::platform::SoftwareGpioPort; + +namespace Display { + +using DC = modm::platform::GpioD6; +using CS = modm::platform::GpioE7; +using RST = modm::platform::GpioG2; + +} // namespace Display + +inline void +initialize() { + SystemClock::enable(); + + LedDebug::setOutput(); + + modm::platform::enableInterrupts(); +} + +} // namespace Board diff --git a/src/modm/board/srxe/board.xml b/src/modm/board/srxe/board.xml new file mode 100644 index 0000000000..1cf458ea1f --- /dev/null +++ b/src/modm/board/srxe/board.xml @@ -0,0 +1,15 @@ + + + + ../../../../repo.lb + + + + + + + + + modm:board:srxe + + diff --git a/src/modm/board/srxe/module.lb b/src/modm/board/srxe/module.lb new file mode 100644 index 0000000000..fa8afe62f6 --- /dev/null +++ b/src/modm/board/srxe/module.lb @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2021, Tomasz Wasilczyk +# +# This file is part of the modm project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ----------------------------------------------------------------------------- + +def init(module): + module.name = ":board:srxe" + module.description = "Smart Response XE" + +def prepare(module, options): + if not options[":target"].partname.startswith("atmega128rfa1"): + return False + + module.depends( + ":architecture:clock", + ":architecture:interrupt", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:uart:0") + return True + +def build(env): + env.outbasepath = "modm/src/modm/board" + env.copy('.') + env.collect(":build:default.avrdude.programmer", "usbasp");