-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of SRXE board and blinky example
- Loading branch information
1 parent
4d64b6c
commit 7ec9ce1
Showing
7 changed files
with
129 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <modm/board.hpp> | ||
|
||
int | ||
main() | ||
{ | ||
using namespace Board; | ||
|
||
initialize(); | ||
|
||
while (true) | ||
{ | ||
LedDebug::toggle(); | ||
modm::delay(1s); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <modm/platform.hpp> | ||
|
||
/// @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<LedDebug>; | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
</modules> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |