Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial support for Smart Response XE #669

Merged
merged 3 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ git clone --recurse-submodules --jobs 8 https://github.com/modm-io/modm.git

## Microcontrollers

modm can create a HAL for <!--allcount-->3138<!--/allcount--> devices of these vendors:
modm can create a HAL for <!--allcount-->3172<!--/allcount--> devices of these vendors:

- STMicroelectronics STM32: <!--stmcount-->2593<!--/stmcount--> devices.
- STMicroelectronics STM32: <!--stmcount-->2621<!--/stmcount--> devices.
- Microchip SAM: <!--samcount-->163<!--/samcount--> devices.
- Microchip AVR: <!--avrcount-->382<!--/avrcount--> devices.
- Microchip AVR: <!--avrcount-->388<!--/avrcount--> devices.

Here is a table with all device families and the peripheral drivers they support:

Expand Down Expand Up @@ -525,6 +525,7 @@ We have out-of-box support for many development boards including documentation.
</tr><tr>
<td align="center"><a href="https://modm.io/reference/module/modm-board-stm32_f4ve">STM32-F4VE</a></td>
<td align="center"><a href="https://modm.io/reference/module/modm-board-stm32f030_demo">STM32F030-DEMO</a></td>
<td align="center"><a href="https://modm.io/reference/module/modm-board-srxe">Smart Response XE</a></td>
</tr>
</table>
<!--/bsptable-->
Expand Down
24 changes: 24 additions & 0 deletions examples/srxe/blink/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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 <modm/board.hpp>

int
main()
{
Board::initialize();

while (true)
{
Board::LedDebug::toggle();
modm::delay(1s);
}
}
9 changes: 9 additions & 0 deletions examples/srxe/blink/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<library>
<extends>modm:srxe</extends>
<options>
<option name="modm:build:build.path">../../../build/srxe/blink</option>
</options>
<modules>
<module>modm:build:scons</module>
</modules>
</library>
2 changes: 1 addition & 1 deletion ext/modm-devices
Submodule modm-devices updated 49 files
+5 −5 README.md
+174 −0 devices/avr/atmega-128-rfa1.xml
+1 −2 devices/stm32/stm32f0-30.xml
+1 −1 devices/stm32/stm32f0-51.xml
+1 −1 devices/stm32/stm32f0-58.xml
+2 −2 devices/stm32/stm32f1-00-8_b.xml
+4 −4 devices/stm32/stm32f1-00-c_d_e.xml
+4 −4 devices/stm32/stm32f1-01-c_d_e.xml
+4 −4 devices/stm32/stm32f1-01-f_g.xml
+2 −2 devices/stm32/stm32f1-01_02-8_b.xml
+6 −6 devices/stm32/stm32f1-03-8_b.xml
+8 −8 devices/stm32/stm32f1-03-c_d_e.xml
+6 −6 devices/stm32/stm32f1-03-f_g.xml
+4 −4 devices/stm32/stm32f1-05_07.xml
+11 −11 devices/stm32/stm32g0-30.xml
+15 −16 devices/stm32/stm32g0-31_41.xml
+9 −46 devices/stm32/stm32g0-70_b0.xml
+15 −38 devices/stm32/stm32g0-71_81.xml
+1 −1 devices/stm32/stm32g0-b1_c1.xml
+4 −0 devices/stm32/stm32g4-31_41.xml
+173 −17 devices/stm32/stm32g4-71_91_a1.xml
+73 −21 devices/stm32/stm32g4-73_83.xml
+77 −21 devices/stm32/stm32g4-74_84.xml
+4 −0 devices/stm32/stm32h7-23_33.xml
+84 −40 devices/stm32/stm32h7-25_35.xml
+4 −0 devices/stm32/stm32h7-30.xml
+17 −13 devices/stm32/stm32h7-42.xml
+4 −0 devices/stm32/stm32h7-43_53.xml
+4 −0 devices/stm32/stm32h7-45_55.xml
+4 −0 devices/stm32/stm32h7-47_57.xml
+17 −39 devices/stm32/stm32h7-50.xml
+4 −0 devices/stm32/stm32h7-a3.xml
+4 −0 devices/stm32/stm32h7-b0.xml
+4 −0 devices/stm32/stm32h7-b3.xml
+13 −9 devices/stm32/stm32l0-71_72_73_81_82_83.xml
+1 −2 devices/stm32/stm32l1-00.xml
+0 −1 devices/stm32/stm32l1-51_52-6_8_b.xml
+0 −6 devices/stm32/stm32l1-51_52_62-c_d_e.xml
+3 −0 devices/stm32/stm32l4-12_22.xml
+5 −0 devices/stm32/stm32l4-51_71.xml
+4 −1 devices/stm32/stm32l4-96_a6.xml
+44 −25 devices/stm32/stm32wb-10_15.xml
+1 −0 devices/stm32/stm32wb-5m.xml
+5 −3 devices/stm32/stm32wl-54_55.xml
+5 −4 devices/stm32/stm32wl-e4_e5.xml
+1 −1 modm_devices/__init__.py
+2 −0 tools/generator/dfg/avr/avr_device_tree.py
+17 −4 tools/generator/raw-data-extractor/extract-stm32.py
+329 −0 tools/generator/raw-data-extractor/patches/avr.patch
45 changes: 45 additions & 0 deletions src/modm/board/srxe/board.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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 <modm/platform.hpp>

twasilczyk marked this conversation as resolved.
Show resolved Hide resolved
using namespace modm::platform;

/// @ingroup modm_board_srxe
namespace Board {

using namespace modm::literals;

using SystemClock = modm::platform::SystemClock;

using LedDebug = GpioB0;
using Leds = SoftwareGpioPort<LedDebug>;

namespace Display {

using DC = GpioD6;
using CS = GpioE7;
using RST = GpioG2;

} // namespace Display

inline void
initialize() {
SystemClock::enable();

LedDebug::setOutput();

enableInterrupts();
}

} // namespace Board
15 changes: 15 additions & 0 deletions src/modm/board/srxe/board.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<library>
<repositories>
<repository>
<path>../../../../repo.lb</path>
</repository>
</repositories>

<options>
<option name="modm:target">atmega128rfa1-zu</option>
<option name="modm:platform:core:f_cpu">16000000</option>
</options>
<modules>
<module>modm:board:srxe</module>
twasilczyk marked this conversation as resolved.
Show resolved Hide resolved
</modules>
</library>
51 changes: 51 additions & 0 deletions src/modm/board/srxe/module.lb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/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

Smart Response XE is an obsolete classroom clicker, sold for as little as 5 USD on well known online auction site.
It's a compelling platform that's fully reverse engineered and ready to hack out of box, featuring:
- ATmega128RFA1 MCU
- 384x160 LCD display
- QWERTY keyboard
- External 1M SPI flash
- Exposed ISP and JTAG headers
- ZigBee transciever w/ antennas
- Powered by 4 AAA batteries
- Optional (unpopulated):
- RS232
- Debug LED
- Buzzer
- Accelerometer
"""

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");
3 changes: 2 additions & 1 deletion src/modm/platform/clock/avr/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def prepare(module, options):
target = options[":target"].identifier
if target.family in {"tiny"} and target.name in {"861", "88"}:
return False
if target.family in {"mega"} and target.name in {"8", "16", "32", "64", "128"}:
if (target.family in {"mega"} and target.name in {"8", "16", "32", "64", "128"}
and target.type not in {"rfa1"}):
return False

module.depends(":architecture:atomic", ":architecture:clock")
Expand Down
1 change: 0 additions & 1 deletion test/all/ignored.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ at90usb646
at90usb647
at90usb82
atmega1284rfr2
atmega128rfa1
atmega128rfr2
atmega162
atmega165a
Expand Down
1 change: 1 addition & 0 deletions tools/scripts/synchronize_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def name(raw_name):
.replace("ARDUINO-UNO", "Arduino UNO")\
.replace("ARDUINO-NANO", "Arduino NANO")\
.replace("RASPBERRYPI", "Raspberry Pi")\
.replace("SRXE", "Smart Response XE")\
.replace("GENERIC", "Generic")\
.replace("LINUX", "Linux")\
.replace("WINDOWS", "Windows")\
Expand Down