-
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.
Merge remote-tracking branch 'upstream/develop' into rewrite-graphics…
…-API
- Loading branch information
Showing
70 changed files
with
2,526 additions
and
143 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/samg55_xplained_pro/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,36 @@ | ||
#include <modm/board.hpp> | ||
|
||
using namespace modm::platform; | ||
|
||
int main() { | ||
// Test SPI send and receive in loopback mode. If we receive the expected | ||
// characters back, flash slowly. Otherwise, flash fast. | ||
Board::initialize(); | ||
|
||
SpiMaster0::connect<GpioB0::Sck, GpioA9::Miso, GpioA10::Mosi>(); | ||
SpiMaster0::initialize<Board::SystemClock, 1_MHz>(); | ||
|
||
SpiMaster0::setLocalLoopback(true); | ||
|
||
while (true) | ||
{ | ||
uint32_t flash_time_ms; | ||
uint8_t tx[] = {0xa5, 0x21}; | ||
uint8_t rx[2]; | ||
|
||
SpiMaster0::transferBlocking(tx, rx, 2); | ||
|
||
if(rx[0] == 0xa5 && rx[1] == 0x21) { | ||
flash_time_ms = 500; | ||
} else { | ||
flash_time_ms = 100; | ||
} | ||
|
||
for(uint32_t i=0; i<5; i++) { | ||
Board::Led::set(); | ||
modm::delay_ms(flash_time_ms); | ||
Board::Led::reset(); | ||
modm::delay_ms(flash_time_ms); | ||
} | ||
} | ||
} |
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,11 @@ | ||
<library> | ||
<extends>modm:samg55-xplained-pro</extends> | ||
<options> | ||
<option name="modm:build:project.name">samg-spi-demo</option> | ||
<option name="modm:build:build.path">../../../build/samg55_xplained_pro/spi-loopback</option> | ||
</options> | ||
<modules> | ||
<module>modm:build:scons</module> | ||
<module>modm:platform:spi:0</module> | ||
</modules> | ||
</library> |
Oops, something went wrong.