Skip to content

semitov/SemiTOV-MCL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SemiTO-V Micropython Compatibility Layer

"MCL" (Micropython Compatibility Layer) library allowing inclusion of Micropython code targeting MCUs within CPython. Made for RISC-V based RP2350 GPIO Expansion Card for Framework Laptops. Works well with any MCU that supports Micropython connected to RISC-V, ARM and X86 PCs.

Requirements

How to build

Clone the repository:

git clone https://github.com/semitov/SemiTOV-MCL.git

Sync the project (creates virtual environment and installs dependencies):

cd SemiTOV-MCL
uv sync

Install the package:

uv pip install -e .

How to run

uv run examples/<script_name.py>

How to use

from mcl import Board

Add a module in Micropython

board = Board("/dev/ttyACM0", 115200)
board.add_import("machine")
board.add_from_import("machine", "Pin")

Add a variable in Micropython

led = board.set_variable("led", "Pin(10, Pin.OUT)")
led.value(1)  # Use it

After creating (or setting) a variable you will be able to use it as a normal one.

Development

Run tests:

uv run pytest

How to contribute

In order to contribute, first check the opened issues and choose one. All the new code that fixes something or implements a new feature must be pushed on a new branch with the name of the issue that is fixing. Only after it will be merged into the develop branch. DO NOT PUSH ON THE MASTER BRANCH. If you want to push new code and no issue match with it, create a new one first.

About

A compatibility layer between MicroPython and Python.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5

Languages