diff --git a/mu/app.py b/mu/app.py index 822f085a8..db022fad5 100644 --- a/mu/app.py +++ b/mu/app.py @@ -59,6 +59,7 @@ LegoMode, PicoMode, SnekMode, + VkMode, ) from .interface.themes import NIGHT_STYLE, DAY_STYLE, CONTRAST_STYLE from . import settings @@ -254,6 +255,7 @@ def setup_modes(editor, view): "pygamezero": PyGameZeroMode(editor, view), "lego": LegoMode(editor, view), "pico": PicoMode(editor, view), + "vk": VkMode(editor, view), } diff --git a/mu/modes/__init__.py b/mu/modes/__init__.py index 9cf955976..8499520d6 100644 --- a/mu/modes/__init__.py +++ b/mu/modes/__init__.py @@ -9,6 +9,7 @@ from .pyboard import PyboardMode from .lego import LegoMode from .pico import PicoMode +from .vk import VkMode __all__ = [ "PythonMode", @@ -22,4 +23,5 @@ "PyboardMode", "LegoMode", "PicoMode", + "VkMode", ] diff --git a/mu/modes/vk.py b/mu/modes/vk.py new file mode 100644 index 000000000..deb980720 --- /dev/null +++ b/mu/modes/vk.py @@ -0,0 +1,51 @@ +""" +A mode for working with Vekatech's boards running MicroPython. + +Copyright (c) 2020 Nicholas H.Tollervey and others (see the AUTHORS file). + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +""" +import logging +from mu.modes.esp import ESPMode +from mu.modes.api import SHARED_APIS + + +logger = logging.getLogger(__name__) + + +class VkMode(ESPMode): + """ + Represents the functionality required for running MicroPython on VK boards. + This is simply a modified version of the ESP mode. + """ + + name = _("VK board") + short_name = "vk" + board_name = "VK-RAxxx" + description = _("Write MicroPython directly on a VK uPy enabled boards.") + icon = "vk" + fs = None + + valid_boards = [ + # VID , PID, Manufacturer string, Device name + (0x045B, 0x5310, None, "CDC"), + (0x1366, 0x0105, "SEGGER", "SWD"), + ] + + def api(self): + """ + Return a list of API specifications to be used by auto-suggest and call + tips. + """ + return SHARED_APIS diff --git a/mu/resources/images/vk.png b/mu/resources/images/vk.png new file mode 100644 index 000000000..cf52c81af Binary files /dev/null and b/mu/resources/images/vk.png differ