13
13
0.1 [ Installing uasyncio on bare metal] ( ./TUTORIAL.md#01-installing-uasyncio-on-bare-metal )
14
14
1 . [ Cooperative scheduling] ( ./TUTORIAL.md#1-cooperative-scheduling )
15
15
1.1 [ Modules] ( ./TUTORIAL.md#11-modules )
16
+ 1.1.1 [ Primitives] ( ./TUTORIAL.md#111-primitives )
17
+ 1.1.2 [ Demo programs] ( ./TUTORIAL.md#112-demo-programs )
18
+ 1.1.3 [ Device drivers] ( ./TUTORIAL.md#113-device-drivers )
16
19
2 . [ uasyncio] ( ./TUTORIAL.md#2-uasyncio )
17
20
2.1 [ Program structure] ( ./TUTORIAL.md#21-program-structure )
18
21
2.2 [ Coroutines and Tasks] ( ./TUTORIAL.md#22-coroutines-and-tasks )
@@ -124,7 +127,7 @@ pitfalls associated with truly asynchronous threads of execution.
124
127
125
128
## 1.1 Modules
126
129
127
- ### Primitives
130
+ ### 1.1.1 Primitives
128
131
129
132
The directory ` primitives ` contains a Python package containing the following:
130
133
* Synchronisation primitives: "micro" versions of CPython's classes.
@@ -137,7 +140,7 @@ The directory `primitives` contains a Python package containing the following:
137
140
To install this Python package copy the ` primitives ` directory tree and its
138
141
contents to your hardware's filesystem.
139
142
140
- ### Demo Programs
143
+ ### 1.1.2 Demo programs
141
144
142
145
The directory ` as_demos ` contains various demo programs implemented as a Python
143
146
package. Copy the directory and its contents to the target hardware.
@@ -146,28 +149,29 @@ The first two are the most immediately rewarding as they produce visible
146
149
results by accessing Pyboard hardware. With all demos, issue ctrl-d between
147
150
runs to soft reset the hardware.
148
151
149
- 1 . [ aledflash.py] ( ./as_demos/aledflash.py ) Flashes three Pyboard LEDs
152
+ 1 . [ aledflash.py] ( .. /as_demos/aledflash.py ) Flashes three Pyboard LEDs
150
153
asynchronously for 10s. Requires any Pyboard.
151
- 2 . [ apoll.py] ( ./as_demos/apoll.py ) A device driver for the Pyboard
154
+ 2 . [ apoll.py] ( .. /as_demos/apoll.py ) A device driver for the Pyboard
152
155
accelerometer. Demonstrates the use of a task to poll a device. Runs for 20s.
153
156
Requires a Pyboard V1.x.
154
- 3 . [ roundrobin.py] ( ./as_demos/roundrobin.py ) Demo of round-robin scheduling.
157
+ 3 . [ roundrobin.py] ( .. /as_demos/roundrobin.py ) Demo of round-robin scheduling.
155
158
Also a benchmark of scheduling performance. Runs for 5s on any target.
156
- 4 . [ auart.py] ( ./as_demos/auart.py ) Demo of streaming I/O via a Pyboard UART.
159
+ 4 . [ auart.py] ( .. /as_demos/auart.py ) Demo of streaming I/O via a Pyboard UART.
157
160
Requires a link between X1 and X2.
158
- 5 . [ auart_hd.py] ( ./as_demos/auart_hd.py ) Use of the Pyboard UART to communicate
161
+ 5 . [ auart_hd.py] ( .. /as_demos/auart_hd.py ) Use of the Pyboard UART to communicate
159
162
with a device using a half-duplex protocol e.g. devices such as those using
160
163
the 'AT' modem command set. Link X1-X4, X2-X3.
161
- 6 . [ gather.py] ( ./as_demos/gether .py ) Use of ` gather ` . Any target.
162
- 7 . [ iorw.py] ( ./as_demos/iorw.py ) Demo of a read/write device driver using the
164
+ 6 . [ gather.py] ( .. /as_demos/gather .py ) Use of ` gather ` . Any target.
165
+ 7 . [ iorw.py] ( .. /as_demos/iorw.py ) Demo of a read/write device driver using the
163
166
stream I/O mechanism. Requires a Pyboard.
167
+ 8 . [ rate.py] ( ../as_demos/rate.py ) Benchmark for uasyncio. Any target.
164
168
165
169
Demos are run using this pattern:
166
170
``` python
167
171
import as_demos.aledflash
168
172
```
169
173
170
- ### Device drivers
174
+ ### 1.1.3 Device drivers
171
175
172
176
These are installed by copying the ` as_drivers ` directory and contents to the
173
177
target. They have their own documentation as follows:
@@ -177,8 +181,13 @@ target. They have their own documentation as follows:
177
181
altitude and time/date information.
178
182
2 . [ HTU21D] ( ./HTU21D.md ) An I2C temperature and humidity sensor. A task
179
183
periodically queries the sensor maintaining constantly available values.
180
- 3 . [ NEC IR] ( ./NEC_IR ) A decoder for NEC IR remote controls. A callback occurs
184
+ 3 . [ NEC IR] ( ./NEC_IR.md ) A decoder for NEC IR remote controls. A callback occurs
181
185
whenever a valid signal is received.
186
+ 4 . [ HD44780] ( ./hd44780.md ) Driver for common character based LCD displays
187
+ based on the Hitachi HD44780 controller
188
+ 5 . [ I2C] ( ./I2C.md ) Use Pyboard I2C slave mode to implement a UART-like
189
+ asynchronous stream interface. Uses: communication with ESP8266,
190
+ or (with coding) interface a Pyboard to I2C masters.
182
191
183
192
###### [ Contents] ( ./TUTORIAL.md#contents )
184
193
0 commit comments