@@ -6,12 +6,20 @@ This is an initial port of MicroPython to Zephyr RTOS
66
77The port integrates well with Zephyr build system, using the latest
88features which will be available in 1.6.0, and thus requires Zephyr
9- master to build against. All boards supported by Zephyr should be
10- supported (but not all were tested).
9+ master to build against. All boards supported by Zephyr (with standard
10+ level of feature support, like UART console) should work with
11+ MicroPython (but not all were tested).
1112
12- At this time, only basic interactive prompt (REPL) over UART connection
13- is supported. Over time, bindings for various Zephyr subsystems may
14- be added.
13+ Features supported at this time:
14+
15+ * REPL (interactive prompt) over Zephyr UART console.
16+ * ` utime ` module for time measurements and delays.
17+ * ` machine.Pin ` class for GPIO control.
18+ * "Frozen modules" support to allow to bundle Python modules together
19+ with firmware. Including complete applications, including with
20+ run-on-boot capability.
21+
22+ Over time, bindings for various Zephyr subsystems may be added.
1523
1624
1725Building
@@ -36,10 +44,33 @@ supported boards.
3644Running
3745-------
3846
39- To run the resulting application in QEMU (for BOARDs like qemu_x86,
47+ To run the resulting firmware in QEMU (for BOARDs like qemu_x86,
4048qemu_cortex_m3):
4149
4250 make qemu
4351
44- For deploying/flashing the application on a real board, follow Zephyr
52+ For deploying/flashing a firmware on a real board, follow Zephyr
4553documentation for a given board.
54+
55+
56+ Quick example
57+ -------------
58+
59+ To blink an LED:
60+
61+ import time
62+ from machine import Pin
63+
64+ LED = Pin(("GPIO_1", 21), Pin.OUT)
65+ while True:
66+ LED.value(1)
67+ time.sleep(0.5)
68+ LED.value(0)
69+ time.sleep(0.5)
70+
71+ The above code uses an LED location for a FRDM-K64F board (port B, pin 21;
72+ following Zephyr conventions port are identified by "GPIO_x", where * x*
73+ starts from 0). You will need to adjust it for another board (using board's
74+ reference materials). To execute the above sample, copy it to clipboard, in
75+ MicroPython REPL enter "paste mode" using Ctrl+E, paste clipboard, press
76+ Ctrl+D to finish paste mode and start execution.
0 commit comments