-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Basic clock configuration - Gpio driver - BSP for samg55_xplained_pro - simply blinky example for that board
- Loading branch information
Showing
24 changed files
with
777 additions
and
51 deletions.
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,13 @@ | ||
#include "modm/board.hpp" | ||
|
||
using namespace modm::platform; | ||
|
||
int main() { | ||
Board::initialize(); | ||
|
||
while(true) { | ||
Board::Led::toggle(); | ||
modm::delay_ms(500); | ||
} | ||
|
||
} |
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:samg55-xplained-pro</extends> | ||
<options> | ||
<option name="modm:build:build.path">../../../build/samg/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
Submodule modm-devices
updated
8 files
+190 −0 | devices/sam/samg51.xml | |
+221 −0 | devices/sam/samg53.xml | |
+222 −0 | devices/sam/samg54.xml | |
+652 −0 | devices/sam/samg55.xml | |
+1 −1 | tools/generator/Makefile | |
+19 −5 | tools/generator/dfg/sam/sam_device_tree.py | |
+17 −0 | tools/generator/dfg/sam/sam_groups.py | |
+4 −3 | tools/generator/dfg/sam/sam_identifier.py |
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,55 @@ | ||
/* | ||
* Copyright (c) 2021, Jeff McBride | ||
* | ||
* 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_samg55_xplained_pro | ||
namespace Board | ||
{ | ||
using namespace modm::literals; | ||
using namespace modm::platform; | ||
|
||
struct SystemClock | ||
{ | ||
static constexpr uint32_t PllAMult = 3662; | ||
static constexpr uint32_t Frequency = PllAMult * SlowClkFreqHz; | ||
static bool inline | ||
enable() | ||
{ | ||
ClockGen::setFlashLatency<Frequency>(); | ||
ClockGen::updateCoreFrequency<Frequency>(); | ||
ClockGen::enableExternal32Khz(false); | ||
ClockGen::enablePllA<PllAMult>(); | ||
ClockGen::selectMasterClk<MasterClkSource::PLLA_CLK, MasterClkPrescaler::CLK_1>(); | ||
return true; | ||
} | ||
}; | ||
|
||
using Led = GpioA6; | ||
using Button = GpioA2; | ||
|
||
inline void | ||
initialize() | ||
{ | ||
// Turn off the watchdog | ||
WDT->WDT_MR = (WDT_MR_WDDIS_Msk); | ||
|
||
SystemClock::enable(); | ||
SysTickTimer::initialize<SystemClock>(); | ||
|
||
Led::setOutput(modm::Gpio::Low); | ||
|
||
Button::setInput(); | ||
} | ||
|
||
} // 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,14 @@ | ||
<library> | ||
<repositories> | ||
<repository> | ||
<path>../../../../repo.lb</path> | ||
</repository> | ||
</repositories> | ||
|
||
<options> | ||
<option name="modm:target">samg55j19a-au</option> | ||
</options> | ||
<modules> | ||
<module>modm:board:samg55-xplained-pro</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,28 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (c) 2021, Jeff McBride | ||
# | ||
# 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:samg55-xplained-pro" | ||
module.description = "Microchip SAMG55 Xplained Pro" | ||
|
||
def prepare(module, options): | ||
if not options[":target"].partname == "samg55j19a-au": | ||
return False | ||
|
||
module.depends(":platform:clockgen", ":platform:gpio", ":platform:core"); | ||
return True | ||
|
||
def build(env): | ||
env.outbasepath = "modm/src/modm/board" | ||
env.copy('board.hpp') | ||
|
||
# TODO: openocd config? |
Oops, something went wrong.