Skip to content

Add support for VK micropython boards. #2414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mu/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
LegoMode,
PicoMode,
SnekMode,
VkMode,
)
from .interface.themes import NIGHT_STYLE, DAY_STYLE, CONTRAST_STYLE
from . import settings
Expand Down Expand Up @@ -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),
}


Expand Down
2 changes: 2 additions & 0 deletions mu/modes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .pyboard import PyboardMode
from .lego import LegoMode
from .pico import PicoMode
from .vk import VkMode

__all__ = [
"PythonMode",
Expand All @@ -22,4 +23,5 @@
"PyboardMode",
"LegoMode",
"PicoMode",
"VkMode",
]
51 changes: 51 additions & 0 deletions mu/modes/vk.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
"""
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
Binary file added mu/resources/images/vk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.