Skip to content

Commit

Permalink
Implement support for SAMV devices
Browse files Browse the repository at this point in the history
  • Loading branch information
twasilczyk committed Sep 12, 2021
1 parent f4d5d6c commit 9a08b11
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ jobs:
if: always()
run: |
(cd examples && ../tools/scripts/examples_compile.py samg55_xplained_pro)
- name: Examples SAMV Devices
if: always()
run: |
(cd examples && ../tools/scripts/examples_compile.py samv)
- name: Execute Python Scripts
if: always()
run: |
Expand Down
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ git clone --recurse-submodules --jobs 8 https://github.com/modm-io/modm.git

## Microcontrollers

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

- STMicroelectronics STM32: <!--stmcount-->2621<!--/stmcount--> devices.
- Microchip SAM: <!--samcount-->166<!--/samcount--> devices.
- Microchip SAM: <!--samcount-->186<!--/samcount--> devices.
- Microchip AVR: <!--avrcount-->388<!--/avrcount--> devices.

Here is a table with all device families and the peripheral drivers they support:
Expand All @@ -96,7 +96,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<tr>
<th align="center"></th>
<th align="center" colspan="12">STM32</th>
<th align="center" colspan="2">SAM</th>
<th align="center" colspan="3">SAM</th>
<th align="center" colspan="3">AT</th>
</tr><tr>
<th align="left">Peripheral</th>
Expand All @@ -114,6 +114,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<th align="center">L4</th>
<th align="center">D21</th>
<th align="center">G</th>
<th align="center">V</th>
<th align="center">90</th>
<th align="center">Mega</th>
<th align="center">Tiny</th>
Expand All @@ -134,6 +135,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
</tr><tr>
Expand All @@ -154,6 +156,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✗</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✗</td>
</tr><tr>
<td align="left">Comparator</td>
Expand All @@ -174,6 +177,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
</tr><tr>
<td align="left">DAC</td>
<td align="center">✅</td>
Expand All @@ -190,6 +194,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">○</td>
<td align="center">✗</td>
Expand All @@ -209,6 +214,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
Expand All @@ -231,6 +237,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
</tr><tr>
<td align="left">External Interrupt</td>
<td align="center">✅</td>
Expand All @@ -250,6 +257,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
</tr><tr>
<td align="left">External Memory</td>
<td align="center">✗</td>
Expand All @@ -266,6 +274,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
Expand All @@ -288,6 +297,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
</tr><tr>
<td align="left">I<sup>2</sup>C</td>
<td align="center">✅</td>
Expand All @@ -304,6 +314,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
Expand All @@ -322,7 +333,8 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
Expand All @@ -342,6 +354,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
Expand All @@ -361,6 +374,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
Expand All @@ -383,6 +397,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
</tr><tr>
<td align="left">Timer</td>
<td align="center">✅</td>
Expand All @@ -402,6 +417,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">○</td>
</tr><tr>
<td align="left">UART</td>
<td align="center">✅</td>
Expand All @@ -418,6 +434,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">○</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
Expand All @@ -440,6 +457,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
</tr><tr>
<td align="left">USB</td>
<td align="center">✅</td>
Expand All @@ -456,6 +474,7 @@ Please [discover modm's peripheral drivers for your specific device][discover].
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">✅</td>
<td align="center">○</td>
<td align="center">✗</td>
<td align="center">✗</td>
<td align="center">✗</td>
Expand Down
26 changes: 26 additions & 0 deletions examples/samv/blink/main.cpp
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/architecture/interface/clock.hpp>
#include <modm/platform.hpp>

int
main()
{
#if 0
while (1)
{
Led::toggle();
modm::delay(500ms);
}
#endif

return 0;
}
11 changes: 11 additions & 0 deletions examples/samv/blink/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<library>
<options>
<option name="modm:target">samv70n20b-aabt</option>
<option name="modm:build:build.path">../../../build/samv/blink</option>
</options>
<modules>
<module>modm:build:scons</module>
<module>modm:platform:core</module>
<module>modm:platform:clock</module>
</modules>
</library>
2 changes: 1 addition & 1 deletion ext/microchip/sam
Submodule sam updated 216 files
2 changes: 1 addition & 1 deletion ext/modm-devices
3 changes: 1 addition & 2 deletions repo.lb
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ class DevicesCache(dict):
"stm32h7",
"stm32l0", "stm32l1", "stm32l4",
"at90", "attiny", "atmega",
"samd21",
"samg55",
"samd21", "samg55", "samv70",
"hosted"]
device_file_names = [dfn for dfn in device_file_names if any(s in dfn for s in supported)]
# These files are ignored due to various issues
Expand Down
18 changes: 11 additions & 7 deletions tools/scripts/generate_hal_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,20 @@ def hal_get_modules():
all_targets[target] = (drivers, modules)

# Some information cannot be extracted from the module.lb files
mapping["ADC"].add("afec")
mapping["DAC"].add("dacc")
mapping["Ethernet"].add("gmac")
mapping["Random Generator"].add("trng")
mapping["UART"].update({"usi", "sercom"})
mapping["Timer"].update({"tc", "tcc"})
mapping["SPI"].add("sercom")
mapping["I<sup>2</sup>C"].add("sercom")
mapping["USB"].add("usb")
mapping["CAN"].add("fdcan")
mapping["DMA"].add("dmac")
mapping["Comparator"].add("ac")
mapping["Internal Flash"].add("nvmctrl")
mapping["External Memory"].add("quadspi")
mapping["I<sup>2</sup>C"].update({"sercom", "twihs"})
mapping["USB"].update({"usb", "usbhs"})
mapping["CAN"].update({"fdcan", "mcan"})
mapping["DMA"].update({"dmac", "xdmac"})
mapping["Comparator"].update({"ac", "acc"})
mapping["Internal Flash"].update({"efc", "nvmctrl"})
mapping["External Memory"].update({"sdramc", "smc", "quadspi"})

print(); print()
return (all_targets, mapping)
Expand Down

0 comments on commit 9a08b11

Please sign in to comment.