1
- # 1. Guide to uasyncio V3
1
+ # 1. Guide to uasyncio
2
2
3
- This release of ` uasyncio ` is pre-installed on all platforms except severely
4
- constrained ones such as the 1MB ESP8266. This rewrite of ` uasyncio ` supports
5
- CPython 3.8 syntax. A design aim is that it should be be a compatible subset of
6
- ` asyncio ` . The current version is 3.0.0.
3
+ MicroPython's ` uasyncio ` is pre-installed on all platforms except severely
4
+ constrained ones such as the 1MB ESP8266. It supports CPython 3.8 syntax and
5
+ aims to be a compatible subset of ` asyncio ` . The current version is 3.0.0.
7
6
8
- These notes and the tutorial should be read in conjunction with
9
- [ the official docs] ( http://docs.micropython.org/en/latest/library/uasyncio.html )
7
+ ## 1.1 Documents
10
8
11
- ## 1.1 Resources for V3
9
+ [ uasyncio official docs ] ( http://docs.micropython.org/en/latest/library/uasyncio.html )
12
10
13
- This repo contains the following:
11
+ [ Tutorial] ( ./docs/TUTORIAL.md ) Intended for users with all levels of experience
12
+ (or none) of asynchronous programming.
14
13
15
- ### [ V3 Tutorial] ( ./docs/TUTORIAL.md )
14
+ [ Drivers] ( https://github.com/peterhinch/micropython-async/blob/master/v3/docs/DRIVERS.md )
15
+ describes device drivers for switches, pushbuttons, ESP32 touch buttons, ADC's
16
+ and incremental encoders.
16
17
17
- Intended for users with all levels of experience with asynchronous programming.
18
+ [ Interrupts] ( https://github.com/peterhinch/micropython-async/blob/master/v3/docs/INTERRUPTS.md )
19
+ is a guide to interfacing interrupts to ` uasyncio ` .
18
20
19
- ### Test/demo scripts
21
+ [ Event-based programming] ( ./docs/EVENTS.md ) is a guide to a way of writing
22
+ applications and device drivers which largely does away with callbacks. Assumes
23
+ some knowledge of ` uasyncio ` .
20
24
21
- Documented in the tutorial.
25
+ ## 1.2 Debugging tools
22
26
23
- ### Synchronisation primitives
27
+ [ aiorepl] ( https://github.com/micropython/micropython-lib/tree/master/micropython/aiorepl )
28
+ This official tool enables an application to launch a REPL which is active
29
+ while the application is running. From this you can modify and query the
30
+ application and run ` uasyncio ` scripts concurrently with the running
31
+ application.
24
32
25
- Documented in the tutorial. Comprises:
26
- * CPython primitives not yet officially supported.
27
- * Two additional primitives ` Barrier ` and ` Message ` .
28
- * Classes for interfacing switches and pushbuttons.
29
- * A software retriggerable monostable timer class, similar to a watchdog.
33
+ [ monitor] ( https://github.com/peterhinch/micropython-monitor ) enables a running
34
+ ` uasyncio ` application to be monitored using a Pi Pico, ideally with a scope or
35
+ logic analyser. Normally requires only one GPIO pin on the target.
30
36
31
- ### A scheduler
37
+ ![ Image] ( https://github.com/peterhinch/micropython-monitor/raw/master/images/monitor.jpg )
38
+
39
+ ## 1.3 Resources in this repo
40
+
41
+ ### 1.3.1 Test/demo scripts
42
+
43
+ Documented in the [ tutorial] ( ./docs/TUTORIAL.md ) .
44
+
45
+ ### 1.3.2 Synchronisation primitives
46
+
47
+ Documented in the [ tutorial] ( ./docs/TUTORIAL.md ) . Comprises:
48
+ * Unsupported CPython primitives including ` barrier ` , ` queue ` and others.
49
+ * An additional primitive ` Message ` .
50
+ * A software retriggerable monostable timer class ` Delay_ms ` , similar to a
51
+ watchdog.
52
+ * Two primitives enabling waiting on groups of ` Event ` instances.
53
+
54
+ ### 1.3.3 Asynchronous device drivers
55
+
56
+ These are documented
57
+ [ here] ( https://github.com/peterhinch/micropython-async/blob/master/v3/docs/DRIVERS.md ) :
58
+ * Classes for interfacing switches, pushbuttons and ESP32 touch buttons.
59
+ * Drivers for ADC's
60
+ * Drivers for incremental encoders.
61
+
62
+ ### 1.3.4 A scheduler
32
63
33
64
This [ lightweight scheduler] ( ./docs/SCHEDULE.md ) enables tasks to be scheduled
34
65
at future times. These can be assigned in a flexible way: a task might run at
35
66
4.10am on Monday and Friday if there's no "r" in the month.
36
67
37
- ### Asynchronous device drivers
68
+ ### 1.3.5 Asynchronous interfaces
38
69
39
70
These device drivers are intended as examples of asynchronous code which are
40
71
useful in their own right:
@@ -43,27 +74,12 @@ useful in their own right:
43
74
* [ HTU21D] ( ./docs/HTU21D.md ) Temperature and humidity sensor.
44
75
* [ I2C] ( ./docs/I2C.md ) Use Pyboard I2C slave mode to implement a UART-like
45
76
asynchronous stream interface. Uses: communication with ESP8266, or (with
46
- coding) interface a Pyboard to I2C masters.
77
+ coding) to interface a Pyboard to I2C masters.
47
78
* [ NEC IR] ( ./docs/NEC_IR.md ) A receiver for signals from IR remote controls
48
79
using the popular NEC protocol.
49
80
* [ HD44780] ( ./docs/hd44780.md ) Driver for common character based LCD displays
50
81
based on the Hitachi HD44780 controller.
51
82
52
- ### Event-based programming
53
-
54
- [ A guide] ( ./docs/EVENTS.md ) to a writing applications and device drivers which
55
- largely does away with callbacks.
56
-
57
- ### A monitor
58
-
59
- This [ monitor] ( https://github.com/peterhinch/micropython-monitor ) enables a
60
- running ` uasyncio ` application to be monitored using a Pi Pico, ideally with a
61
- scope or logic analyser. If designing hardware it is suggested to provide
62
- access to a UART tx pin, or alternatively to three GPIO pins, to enable this to
63
- be used if required.
64
-
65
- ![ Image] ( https://github.com/peterhinch/micropython-monitor/raw/master/images/monitor.jpg )
66
-
67
83
# 2. V3 Overview
68
84
69
85
These notes are intended for users familiar with ` asyncio ` under CPython.
0 commit comments