Skip to content

Commit

Permalink
[board] Add Raspberry Pi BSP
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikssn authored and salkinium committed Sep 7, 2020
1 parent 3ff3436 commit b0d84ba
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ documentation.
<td align="center">NUCLEO-L476RG</td>
<td align="center">OLIMEXINO-STM32</td>
</tr><tr>
<td align="center">RASPBERRYPI</td>
<td align="center">SAMD21-MINI</td>
<td align="center">STM32F030F4P6-DEMO</td>
</tr>
Expand Down
32 changes: 32 additions & 0 deletions src/modm/board/raspberrypi/board.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2020, Erik Henriksson
*
* 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/debug/logger.hpp>
#include <modm/platform.hpp>

#include <wiringPi.h>

using namespace modm::platform;

namespace Board
{

struct SystemClock {};

inline void
initialize()
{
wiringPiSetup();
}

} // Board namespace
14 changes: 14 additions & 0 deletions src/modm/board/raspberrypi/board.xml
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">hosted-rpi</option>
</options>
<modules>
<module>modm:board:raspberrypi</module>
</modules>
</library>
29 changes: 29 additions & 0 deletions src/modm/board/raspberrypi/module.lb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020, Erik Henriksson
#
# 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:raspberrypi"
module.description = """\
# Raspberry Pi
"""

def prepare(module, options):
if options[":target"].partname != "hosted-rpi":
return False

module.depends(":platform:core", ":platform:gpio", ":debug")
return True

def build(env):
env.outbasepath = "modm/src/modm/board"
env.copy('.')

0 comments on commit b0d84ba

Please sign in to comment.