"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.
Clone the repository:
git clone https://github.com/semitov/SemiTOV-MCL.gitSync the project (creates virtual environment and installs dependencies):
cd SemiTOV-MCL
uv syncInstall the package:
uv pip install -e .uv run examples/<script_name.py>from mcl import Boardboard = Board("/dev/ttyACM0", baudrate=115200)
board.add_import("machine")
board.add_import("Pin", from_module="machine")After creating (or setting) a variable you will be able to use it as a normal one.
led = board.set_variable("led", "Pin(10, Pin.OUT)")
led.value(1)See more examples here.
Run tests:
uv run pytestIf you encounter a "Permission denied" error when accessing /dev/ttyACM0, add your user to the dialout group:
sudo usermod -a -G dialout $USERImportant: You must log out and log back in (or reboot) for the changes to take effect.
To verify the change:
groups $USERIn 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 main branch.
If you want to push new code and no issue match with it, create a new one first.