rp2040py 0.1.0b1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rp2040py-0.1.0b1/.github/dependabot.yml +29 -0
- rp2040py-0.1.0b1/.github/workflows/ci-micropython.yml +67 -0
- rp2040py-0.1.0b1/.github/workflows/ci-pico-sdk.yml +79 -0
- rp2040py-0.1.0b1/.github/workflows/pre-commit.yml +43 -0
- rp2040py-0.1.0b1/.github/workflows/publish.yml +76 -0
- rp2040py-0.1.0b1/.gitignore +95 -0
- rp2040py-0.1.0b1/.pre-commit-config.yaml +48 -0
- rp2040py-0.1.0b1/.python-version +1 -0
- rp2040py-0.1.0b1/CHANGELOG.md +38 -0
- rp2040py-0.1.0b1/LICENSE +22 -0
- rp2040py-0.1.0b1/PKG-INFO +226 -0
- rp2040py-0.1.0b1/README.md +178 -0
- rp2040py-0.1.0b1/demo/benchmark.py +167 -0
- rp2040py-0.1.0b1/demo/bootrom.py +4103 -0
- rp2040py-0.1.0b1/demo/emulator_run.py +69 -0
- rp2040py-0.1.0b1/demo/intelhex.py +28 -0
- rp2040py-0.1.0b1/demo/load_flash.py +78 -0
- rp2040py-0.1.0b1/demo/micropython_run.py +139 -0
- rp2040py-0.1.0b1/docs/PORTING.md +242 -0
- rp2040py-0.1.0b1/pyproject.toml +70 -0
- rp2040py-0.1.0b1/src/rp2040py/__init__.py +74 -0
- rp2040py-0.1.0b1/src/rp2040py/clock/__init__.py +0 -0
- rp2040py-0.1.0b1/src/rp2040py/clock/clock.py +22 -0
- rp2040py-0.1.0b1/src/rp2040py/clock/mock_clock.py +8 -0
- rp2040py-0.1.0b1/src/rp2040py/clock/simulation_clock.py +96 -0
- rp2040py-0.1.0b1/src/rp2040py/cortex_m0_core.py +1515 -0
- rp2040py-0.1.0b1/src/rp2040py/gdb/__init__.py +0 -0
- rp2040py-0.1.0b1/src/rp2040py/gdb/gdb_connection.py +56 -0
- rp2040py-0.1.0b1/src/rp2040py/gdb/gdb_server.py +254 -0
- rp2040py-0.1.0b1/src/rp2040py/gdb/gdb_target.py +17 -0
- rp2040py-0.1.0b1/src/rp2040py/gdb/gdb_tcp_server.py +50 -0
- rp2040py-0.1.0b1/src/rp2040py/gdb/gdb_utils.py +53 -0
- rp2040py-0.1.0b1/src/rp2040py/gpio_pin.py +269 -0
- rp2040py-0.1.0b1/src/rp2040py/interpolator.py +161 -0
- rp2040py-0.1.0b1/src/rp2040py/irq.py +38 -0
- rp2040py-0.1.0b1/src/rp2040py/memory_map.py +22 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/__init__.py +0 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/adc.py +284 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/busctrl.py +80 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/clocks.py +179 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/dma.py +466 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/i2c.py +495 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/io.py +78 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/pads.py +57 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/peripheral.py +72 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/pio.py +1049 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/ppb.py +244 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/psm.py +45 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/pwm.py +348 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/reset.py +37 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/rtc.py +122 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/spi.py +249 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/ssi.py +113 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/syscfg.py +19 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/sysinfo.py +19 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/tbman.py +13 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/timer.py +165 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/uart.py +206 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/usb.py +864 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/watchdog.py +133 -0
- rp2040py-0.1.0b1/src/rp2040py/peripherals/xosc.py +120 -0
- rp2040py-0.1.0b1/src/rp2040py/py.typed +0 -0
- rp2040py-0.1.0b1/src/rp2040py/rp2040.py +327 -0
- rp2040py-0.1.0b1/src/rp2040py/simulator.py +51 -0
- rp2040py-0.1.0b1/src/rp2040py/sio.py +385 -0
- rp2040py-0.1.0b1/src/rp2040py/usb/__init__.py +0 -0
- rp2040py-0.1.0b1/src/rp2040py/usb/cdc.py +149 -0
- rp2040py-0.1.0b1/src/rp2040py/usb/interfaces.py +65 -0
- rp2040py-0.1.0b1/src/rp2040py/usb/setup.py +70 -0
- rp2040py-0.1.0b1/src/rp2040py/usb/usb_device.py +153 -0
- rp2040py-0.1.0b1/src/rp2040py/utils/__init__.py +0 -0
- rp2040py-0.1.0b1/src/rp2040py/utils/assembler.py +322 -0
- rp2040py-0.1.0b1/src/rp2040py/utils/bit.py +73 -0
- rp2040py-0.1.0b1/src/rp2040py/utils/fifo.py +49 -0
- rp2040py-0.1.0b1/src/rp2040py/utils/logging.py +50 -0
- rp2040py-0.1.0b1/src/rp2040py/utils/pio_assembler.py +77 -0
- rp2040py-0.1.0b1/src/rp2040py/utils/time.py +26 -0
- rp2040py-0.1.0b1/src/rp2040py/utils/timer32.py +222 -0
- rp2040py-0.1.0b1/tests/micropython/main-spi.py +18 -0
- rp2040py-0.1.0b1/tests/micropython/main.py +9 -0
- rp2040py-0.1.0b1/tests/micropython_spi_run.py +93 -0
- rp2040py-0.1.0b1/tests/mklittlefs.py +28 -0
- rp2040py-0.1.0b1/tests/test_assembler.py +404 -0
- rp2040py-0.1.0b1/tests/test_dispatch_table.py +34 -0
- rp2040py-0.1.0b1/tests/test_dma.py +107 -0
- rp2040py-0.1.0b1/tests/test_fifo.py +45 -0
- rp2040py-0.1.0b1/tests/test_instructions.py +1531 -0
- rp2040py-0.1.0b1/tests/test_pio_assembler.py +54 -0
- rp2040py-0.1.0b1/tests/test_time.py +7 -0
- rp2040py-0.1.0b1/tests/test_timer.py +60 -0
- rp2040py-0.1.0b1/tests/test_uart.py +21 -0
- rp2040py-0.1.0b1/tests/utils/__init__.py +0 -0
- rp2040py-0.1.0b1/tests/utils/cortex_test_driver.py +53 -0
- rp2040py-0.1.0b1/tests/utils/create_test_driver.py +11 -0
- rp2040py-0.1.0b1/tests/utils/rp2040_test_driver.py +130 -0
- rp2040py-0.1.0b1/uv.lock +736 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
5
|
+
|
|
6
|
+
version: 2
|
|
7
|
+
updates:
|
|
8
|
+
- package-ecosystem: "uv" # See documentation for possible values
|
|
9
|
+
directory: "/" # Location of package manifests
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "weekly"
|
|
12
|
+
groups:
|
|
13
|
+
python-dependencies:
|
|
14
|
+
patterns:
|
|
15
|
+
- "*"
|
|
16
|
+
|
|
17
|
+
- package-ecosystem: "github-actions"
|
|
18
|
+
directory: "/"
|
|
19
|
+
schedule:
|
|
20
|
+
interval: "weekly"
|
|
21
|
+
groups:
|
|
22
|
+
actions:
|
|
23
|
+
patterns:
|
|
24
|
+
- "*"
|
|
25
|
+
|
|
26
|
+
- package-ecosystem: "pre-commit"
|
|
27
|
+
directory: "/"
|
|
28
|
+
schedule:
|
|
29
|
+
interval: "weekly"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
name: Test MicroPython Releases
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ci-micropython-${{ github.workflow }}-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test-micropython:
|
|
14
|
+
name: Micropython ${{ matrix.micropython_version }} / ${{ matrix.python_runtime }}
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
micropython_version:
|
|
20
|
+
- 20210618-v1.16
|
|
21
|
+
- 20210902-v1.17
|
|
22
|
+
- 20220117-v1.18
|
|
23
|
+
- 20220618-v1.19.1
|
|
24
|
+
- 20230426-v1.20.0
|
|
25
|
+
- 20231005-v1.21.0
|
|
26
|
+
- 20260406-v1.28.0
|
|
27
|
+
python_runtime:
|
|
28
|
+
- pypy-3.10
|
|
29
|
+
- cpython-3.10
|
|
30
|
+
- cpython-3.14
|
|
31
|
+
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v7
|
|
34
|
+
|
|
35
|
+
- name: Install uv
|
|
36
|
+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9
|
|
37
|
+
with:
|
|
38
|
+
python-version: "3.10"
|
|
39
|
+
|
|
40
|
+
- name: Install dependencies
|
|
41
|
+
run: uv sync
|
|
42
|
+
|
|
43
|
+
- name: Download MicroPython ${{ matrix.micropython_version }}
|
|
44
|
+
run: curl -o micropython.uf2 "https://micropython.org/resources/firmware/RPI_PICO-${VERSION}.uf2"
|
|
45
|
+
env:
|
|
46
|
+
VERSION: ${{ matrix.micropython_version }}
|
|
47
|
+
|
|
48
|
+
- name: Create filesystem
|
|
49
|
+
run: uv run python tests/mklittlefs.py littlefs.img tests/micropython/main.py
|
|
50
|
+
|
|
51
|
+
- name: Create SPI test filesystem
|
|
52
|
+
run: uv run python tests/mklittlefs.py littlefs-spi.img tests/micropython/main-spi.py
|
|
53
|
+
|
|
54
|
+
- name: Setup Python ${{ matrix.python_runtime }}
|
|
55
|
+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9
|
|
56
|
+
with:
|
|
57
|
+
python-version: ${{ matrix.python_runtime }}
|
|
58
|
+
|
|
59
|
+
- name: Test MicroPython ${{matrix.python_runtime}}-${{ matrix.micropython_version }}
|
|
60
|
+
run: timeout 10m uv run --python ${{ matrix.python_runtime }} --no-dev -- python demo/micropython_run.py --image micropython.uf2 --expect-text "Hello, MicroPython!"
|
|
61
|
+
env:
|
|
62
|
+
PYTHON_JIT: ${{ matrix.python_runtime == 'cpython-3.14' && '1' || '' }}
|
|
63
|
+
|
|
64
|
+
- name: Test MicroPython SPI ${{matrix.python_runtime}}-${{ matrix.micropython_version }}
|
|
65
|
+
run: timeout 10m uv run --python ${{ matrix.python_runtime }} --no-dev -- python tests/micropython_spi_run.py "hello world" "h" "0123456789abcdef0123456789abcdef0123456789abcdef"
|
|
66
|
+
env:
|
|
67
|
+
PYTHON_JIT: ${{ matrix.python_runtime == 'cpython-3.14' && '1' || '' }}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: Test Pi Pico SDK
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ci-pico-sdk-${{ github.workflow }}-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test-pico-sdk:
|
|
14
|
+
name: Pico SDK ${{ matrix.sdk_version }} / ${{ matrix.python_runtime }}
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
sdk_version:
|
|
20
|
+
- 1.2.0
|
|
21
|
+
- 1.3.1
|
|
22
|
+
- 1.4.0
|
|
23
|
+
- 1.5.1
|
|
24
|
+
- 2.0.0
|
|
25
|
+
- 2.1.1
|
|
26
|
+
- 2.2.0
|
|
27
|
+
- 2.3.0
|
|
28
|
+
python_runtime:
|
|
29
|
+
- pypy-3.10
|
|
30
|
+
- cpython-3.10
|
|
31
|
+
- cpython-3.14
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v7
|
|
34
|
+
|
|
35
|
+
- name: Cache Pico SDK
|
|
36
|
+
id: cache-pico-sdk
|
|
37
|
+
uses: actions/cache@v6
|
|
38
|
+
with:
|
|
39
|
+
path: ~/pico
|
|
40
|
+
key: ${{ runner.os }}-pico-sdk-${{ matrix.sdk_version }}
|
|
41
|
+
|
|
42
|
+
- name: Set up the toolchain
|
|
43
|
+
if: steps.cache-pico-sdk.outputs.cache-hit != 'true'
|
|
44
|
+
run: |
|
|
45
|
+
sudo apt-get update
|
|
46
|
+
sudo apt-get install -y cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential
|
|
47
|
+
|
|
48
|
+
- name: Set up the Pi Pico SDK and examples
|
|
49
|
+
if: steps.cache-pico-sdk.outputs.cache-hit != 'true'
|
|
50
|
+
run: |
|
|
51
|
+
mkdir ~/pico
|
|
52
|
+
cd ~/pico
|
|
53
|
+
git clone https://github.com/raspberrypi/pico-sdk.git --depth 1 --branch ${SDK_VERSION}
|
|
54
|
+
cd pico-sdk && git submodule update --init && cd ..
|
|
55
|
+
git clone https://github.com/raspberrypi/pico-examples.git --depth 1 --branch "sdk-${SDK_VERSION}"
|
|
56
|
+
cd pico-examples && mkdir build && cd build && cmake .. && make -C hello_world/usb -j4
|
|
57
|
+
env:
|
|
58
|
+
SDK_VERSION: ${{ matrix.sdk_version }}
|
|
59
|
+
PICO_SDK_PATH: ~/pico/pico-sdk
|
|
60
|
+
|
|
61
|
+
- name: Install uv
|
|
62
|
+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9
|
|
63
|
+
with:
|
|
64
|
+
python-version: "3.10"
|
|
65
|
+
|
|
66
|
+
- name: Setup Python ${{ matrix.python_runtime }}
|
|
67
|
+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9
|
|
68
|
+
with:
|
|
69
|
+
python-version: ${{ matrix.python_runtime }}
|
|
70
|
+
|
|
71
|
+
# CortexM0Core.execute_instruction() is a pure-Python instruction interpreter; CPython is
|
|
72
|
+
# much slower here than V8 JIT-compiling the equivalent JS in rp2040js, hence the generous
|
|
73
|
+
# 10-minute timeout - and why this also runs under PyPy and CPython 3.14's experimental JIT
|
|
74
|
+
# (see docs/PORTING.md#known-differences-from-rp2040js). demo/micropython_run.py has zero
|
|
75
|
+
# runtime dependencies, so no `uv sync` is needed here.
|
|
76
|
+
- name: Test "Hello World" example ${{ matrix.python_runtime }}
|
|
77
|
+
run: timeout 10m uv run --python ${{ matrix.python_runtime }} --no-dev -- python demo/micropython_run.py --image ~/pico/pico-examples/build/hello_world/usb/hello_usb.uf2 --expect-text "Hello, world!"
|
|
78
|
+
env:
|
|
79
|
+
PYTHON_JIT: ${{ matrix.python_runtime == 'cpython-3.14' && '1' || '' }}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: Pre-commit
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
workflow_call:
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: pre-commit-${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
pre-commit:
|
|
15
|
+
name: pre-commit run --all-files
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v7
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.10"
|
|
26
|
+
|
|
27
|
+
- name: Install pre-commit
|
|
28
|
+
run: uv tool install pre-commit
|
|
29
|
+
|
|
30
|
+
- name: Run pre-commit
|
|
31
|
+
run: |
|
|
32
|
+
pre-commit run --all-files --show-diff-on-failure
|
|
33
|
+
|
|
34
|
+
- name: Run tests with coverage
|
|
35
|
+
run: uv run --group dev pytest --cov=rp2040py --cov-report=xml
|
|
36
|
+
|
|
37
|
+
- name: Upload coverage to Codecov
|
|
38
|
+
if: github.actor != 'dependabot[bot]'
|
|
39
|
+
uses: codecov/codecov-action@v5
|
|
40
|
+
with:
|
|
41
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
42
|
+
files: ./coverage.xml
|
|
43
|
+
fail_ci_if_error: false
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
name: Upload Python Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
tag:
|
|
10
|
+
description: "Tag to build and publish (e.g. v0.11.0b1)"
|
|
11
|
+
required: true
|
|
12
|
+
type: string
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
deploy:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
|
|
21
|
+
# Specifying a GitHub environment is optional, but strongly encouraged
|
|
22
|
+
environment: pypi
|
|
23
|
+
permissions:
|
|
24
|
+
# job-level permissions replace (not merge with) the workflow-level block above,
|
|
25
|
+
# so everything this job needs must be listed here explicitly.
|
|
26
|
+
contents: write # required to create the GitHub Release
|
|
27
|
+
# IMPORTANT: this permission is mandatory for trusted publishing
|
|
28
|
+
id-token: write
|
|
29
|
+
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v7
|
|
32
|
+
with:
|
|
33
|
+
ref: ${{ inputs.tag || github.ref_name }}
|
|
34
|
+
|
|
35
|
+
- name: Install uv
|
|
36
|
+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9
|
|
37
|
+
|
|
38
|
+
- name: Build package
|
|
39
|
+
run: uv build
|
|
40
|
+
|
|
41
|
+
- name: Resolve tag and version
|
|
42
|
+
id: meta
|
|
43
|
+
run: |
|
|
44
|
+
TAG="${{ inputs.tag || github.ref_name }}"
|
|
45
|
+
VERSION="${TAG#v}"
|
|
46
|
+
if [[ "$VERSION" =~ (alpha|beta|pre|rc) ]]; then
|
|
47
|
+
PRERELEASE=true
|
|
48
|
+
else
|
|
49
|
+
PRERELEASE=false
|
|
50
|
+
fi
|
|
51
|
+
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
|
52
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
53
|
+
echo "prerelease=$PRERELEASE" >> $GITHUB_OUTPUT
|
|
54
|
+
|
|
55
|
+
- name: Extract changelog section
|
|
56
|
+
id: changelog
|
|
57
|
+
run: |
|
|
58
|
+
VERSION=${{ steps.meta.outputs.version }}
|
|
59
|
+
BODY=$(awk "/^## \[${VERSION}\]/{found=1; next} /^## \[/{found=0} found" CHANGELOG.md | sed '/^[[:space:]]*$/d' | head -50)
|
|
60
|
+
if [ -z "$BODY" ]; then
|
|
61
|
+
BODY="See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details."
|
|
62
|
+
fi
|
|
63
|
+
echo "body<<EOF" >> $GITHUB_OUTPUT
|
|
64
|
+
echo "$BODY" >> $GITHUB_OUTPUT
|
|
65
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
66
|
+
|
|
67
|
+
- name: Create GitHub Release
|
|
68
|
+
uses: softprops/action-gh-release@v3
|
|
69
|
+
with:
|
|
70
|
+
tag_name: ${{ steps.meta.outputs.tag }}
|
|
71
|
+
name: ${{ steps.meta.outputs.tag }}
|
|
72
|
+
body: ${{ steps.changelog.outputs.body }}
|
|
73
|
+
prerelease: ${{ steps.meta.outputs.prerelease }}
|
|
74
|
+
|
|
75
|
+
- name: Publish package to PyPI
|
|
76
|
+
run: uv publish --check-url https://pypi.org/simple/
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
|
|
27
|
+
# PyInstaller
|
|
28
|
+
*.manifest
|
|
29
|
+
*.spec
|
|
30
|
+
|
|
31
|
+
# Installer logs
|
|
32
|
+
pip-log.txt
|
|
33
|
+
pip-delete-this-directory.txt
|
|
34
|
+
|
|
35
|
+
# Unit test / coverage reports
|
|
36
|
+
htmlcov/
|
|
37
|
+
.tox/
|
|
38
|
+
.nox/
|
|
39
|
+
.coverage
|
|
40
|
+
.coverage.*
|
|
41
|
+
.cache
|
|
42
|
+
nosetests.xml
|
|
43
|
+
coverage.xml
|
|
44
|
+
*.cover
|
|
45
|
+
*.py,cover
|
|
46
|
+
.hypothesis/
|
|
47
|
+
.pytest_cache/
|
|
48
|
+
|
|
49
|
+
# Translations
|
|
50
|
+
*.mo
|
|
51
|
+
*.pot
|
|
52
|
+
|
|
53
|
+
# Environments
|
|
54
|
+
.env
|
|
55
|
+
.venv
|
|
56
|
+
env/
|
|
57
|
+
venv/
|
|
58
|
+
ENV/
|
|
59
|
+
env.bak/
|
|
60
|
+
venv.bak/
|
|
61
|
+
|
|
62
|
+
# IDEs
|
|
63
|
+
.idea/
|
|
64
|
+
.vscode/
|
|
65
|
+
*.swp
|
|
66
|
+
*.swo
|
|
67
|
+
*~
|
|
68
|
+
|
|
69
|
+
# mypy
|
|
70
|
+
.mypy_cache/
|
|
71
|
+
.dmypy.json
|
|
72
|
+
dmypy.json
|
|
73
|
+
|
|
74
|
+
# ruff
|
|
75
|
+
.ruff_cache/
|
|
76
|
+
|
|
77
|
+
# pyright
|
|
78
|
+
pyrightconfig.json
|
|
79
|
+
|
|
80
|
+
# claude
|
|
81
|
+
.claude/
|
|
82
|
+
|
|
83
|
+
# OS
|
|
84
|
+
.DS_Store
|
|
85
|
+
Thumbs.db
|
|
86
|
+
|
|
87
|
+
**/target
|
|
88
|
+
**/mips*.tar
|
|
89
|
+
**/mips*--glibc*
|
|
90
|
+
**/mips*--musl*
|
|
91
|
+
**/lib.rs:*
|
|
92
|
+
|
|
93
|
+
# images
|
|
94
|
+
**/*.img
|
|
95
|
+
**/*.uf2
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
default_install_hook_types: [pre-commit]
|
|
2
|
+
default_language_version:
|
|
3
|
+
python: python3
|
|
4
|
+
|
|
5
|
+
repos:
|
|
6
|
+
- repo: local
|
|
7
|
+
hooks:
|
|
8
|
+
- id: uv-lock
|
|
9
|
+
name: uv lock
|
|
10
|
+
entry: uv
|
|
11
|
+
args: ["lock", "--upgrade"]
|
|
12
|
+
language: system
|
|
13
|
+
pass_filenames: false
|
|
14
|
+
|
|
15
|
+
- id: uv-sync
|
|
16
|
+
name: uv sync before hooks
|
|
17
|
+
entry: uv
|
|
18
|
+
args: ["sync"]
|
|
19
|
+
language: system
|
|
20
|
+
pass_filenames: false
|
|
21
|
+
|
|
22
|
+
- id: uv-mypy
|
|
23
|
+
name: mypy
|
|
24
|
+
entry: uv
|
|
25
|
+
args: ["run", "mypy"]
|
|
26
|
+
language: system
|
|
27
|
+
pass_filenames: false
|
|
28
|
+
|
|
29
|
+
- id: uv-ruff-check
|
|
30
|
+
name: ruff lint & fix
|
|
31
|
+
entry: uv
|
|
32
|
+
args: ["run", "ruff", "check", "--fix"]
|
|
33
|
+
language: system
|
|
34
|
+
pass_filenames: false
|
|
35
|
+
|
|
36
|
+
- id: uv-ruff-format
|
|
37
|
+
name: ruff format
|
|
38
|
+
entry: uv
|
|
39
|
+
args: ["run", "ruff", "format"]
|
|
40
|
+
language: system
|
|
41
|
+
pass_filenames: false
|
|
42
|
+
|
|
43
|
+
- id: uv-pytest
|
|
44
|
+
name: uv run pytest
|
|
45
|
+
entry: uv
|
|
46
|
+
args: ["run", "pytest"]
|
|
47
|
+
language: system
|
|
48
|
+
pass_filenames: false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.10
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.0b1] - 2026-07-30
|
|
11
|
+
|
|
12
|
+
Initial beta release: a complete port of [rp2040js](https://github.com/wokwi/rp2040js) to Python,
|
|
13
|
+
capable of booting real firmware (native `.hex`/`.uf2` images, MicroPython, CircuitPython) end to
|
|
14
|
+
end.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- Full RP2040 emulator core: Cortex-M0+ CPU, all peripherals (DMA, PIO, USB, UART, SPI, I2C, ADC,
|
|
18
|
+
PWM, timers, GPIO, interpolators, etc.), GDB server, and the `demo/`/`tests/` runner scripts
|
|
19
|
+
needed to actually boot firmware in the emulator.
|
|
20
|
+
- CI workflows (`ci-micropython.yml`, `ci-pico-sdk.yml`) that boot real firmware end to end across
|
|
21
|
+
a `python_runtime` matrix (CPython 3.10, CPython 3.14 with `PYTHON_JIT=1`, PyPy 3.10), plus
|
|
22
|
+
`pre-commit.yml` for lint/type/test checks and coverage reporting.
|
|
23
|
+
- `demo/benchmark.py`, a reproducible synthetic and real-firmware-boot benchmark.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
- `tests/mklittlefs.py` now pins the littlefs on-disk format to v2.0 (`disk_version=0x00020000`)
|
|
27
|
+
regardless of the installed `littlefs-python` version, so generated filesystem images stay
|
|
28
|
+
mountable by MicroPython releases across the full range tested in CI, not just the newest ones.
|
|
29
|
+
|
|
30
|
+
### Performance
|
|
31
|
+
- `CortexM0Core.execute_instruction()` now dispatches through a precomputed O(1) table instead of
|
|
32
|
+
a linear `if`/`elif` scan, alongside several smaller hot-path optimizations (see
|
|
33
|
+
[docs/PORTING.md](docs/PORTING.md#known-differences-from-rp2040js) for the full breakdown and
|
|
34
|
+
measurements). Combined effect versus the initial port: real MicroPython + littlefs boot time
|
|
35
|
+
dropped from minutes to seconds under CPython, and to single-digit seconds under PyPy.
|
|
36
|
+
|
|
37
|
+
[Unreleased]: https://github.com/o-murphy/rp2040py/compare/v0.1.0b1...HEAD
|
|
38
|
+
[0.1.0b1]: https://github.com/o-murphy/rp2040py/releases/tag/v0.1.0b1
|
rp2040py-0.1.0b1/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Uri Shaked
|
|
4
|
+
Copyright (c) 2026 Dmytro Yaroshenko
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|