1
+ TODO
2
+ Installation
3
+ lbt skips screens sometimes
4
+
1
5
# micropython-lcd160gui
2
6
3
- V0.13 20th Oct 2020 Support Jim Mussared's fast text rendering.
7
+ V0.20 20th Oct 2020 Refactor as a Python package. Support Jim Mussared's fast
8
+ text rendering. The refactor is a breaking change: applications will need to
9
+ change import statements. The aim is to remove the need for cross compilation.
10
+ Unused widgets no longer consume RAM. This also facilitates adding new widgets.
11
+
4
12
V0.12 21st Sep 2020 Updated for (and requires) uasyncio V3.
5
- V0.11 21st Feb 2017 This doc updated May 2019.
6
13
7
14
Provides a simple touch driven event based GUI interface for the Pyboard when
8
15
used with the official LCD160CR colour display. It is based on the official
9
- driver and uses uasyncio for scheduling. The V1.1 display enables a Pyboard D
16
+ driver and uses ` uasyncio ` for scheduling. The V1.1 display enables a Pyboard D
10
17
to be plugged in. The GUI has been tested in this configuration.
11
18
12
19
It is targeted at hardware control and display applications. GUI objects are
@@ -51,8 +58,9 @@ The Plot module: Cartesian and polar graphs.
51
58
1 . [ Pre requisites] ( ./README.md#1-pre-requisites )
52
59
1.1 [ Pre installation] ( ./README.md#11-pre-installation )
53
60
1.2 [ Library Documentation] ( ./README.md#12-library-documentation )
54
- 1.3 [ Dependencies and Python files] ( ./README.md#13-dependencies-and-python-files )
55
- 1.4 [ A performance boost] ( ./README.md#14-a-performance-boost )
61
+ 1.3 [ Installation] ( ./README.md#13-installation )
62
+ 1.4 [ Dependencies and Python files] ( ./README.md#14-dependencies-and-python-files )
63
+ 1.5 [ A performance boost] ( ./README.md#15-a-performance-boost )
56
64
2 . [ Concepts] ( ./README.md#2-concepts )
57
65
2.1 [ Terminology] ( ./README.md#21-terminology )
58
66
2.2 [ Coordinates] ( ./README.md#22-coordinates )
@@ -91,12 +99,6 @@ The Plot module: Cartesian and polar graphs.
91
99
Before running the GUI the hardware should be tested by working through the
92
100
[ tutorial] ( https://docs.micropython.org/en/latest/pyboard/pyboard/tutorial/lcd160cr_skin.html ) .
93
101
94
- Owing to the size of the library and depending on the size of your application
95
- it may be necessary to freeze modules as bytecode. Users should therefore be
96
- familiar with building Micropython from source, and installing Python modules
97
- as persistent bytecode. Instructions on doing this may be found
98
- [ here] ( http://forum.micropython.org/viewtopic.php?f=6&t=1776 ) .
99
-
100
102
Familiarity with callbacks and event driven programming will assist in
101
103
developing applications. No knowledge of ` uasyncio ` is required for application
102
104
development as the API is callback-based, but the GUI is compatible with
@@ -112,10 +114,10 @@ Other references:
112
114
[ Proposed standard font format] ( https://github.com/peterhinch/micropython-font-to-py )
113
115
[ uasyncio libraries and notes] ( https://github.com/peterhinch/micropython-async )
114
116
115
- ## 1.3 Dependencies and Python files
117
+ ## 1.3 Installation
116
118
117
- Version 3 of uasyncio is included in firmware V1.13 and later. This is a
118
- requirement.
119
+ This comprises copying files and directories to the root directory on the
120
+ target (typically ` /flash ` or ` /sd ` ). The demos and their associated font
119
121
120
122
Clone the repo [ uasyncio libraries and notes] ( https://github.com/peterhinch/micropython-async )
121
123
to your PC and navigate to the V3 directory. Copy the directory ` primitives `
@@ -124,19 +126,38 @@ these files are required:
124
126
1 . ` __init__.py `
125
127
2 . ` delay_ms.py `
126
128
127
- Core files:
128
- 1 . ` lcd160_gui.py ` The micro GUI library.
129
- 2 . ` lcd_local.py ` Local hardware definition. This file should be edited to
129
+ Copy the following files to the root directory on the target (` /flash ` or
130
+ ` /sd ` ):
131
+ ` lcd160cr.py ` , ` lcd160_gui.py ` , ` lcd_local.py ` , ` constants.py ` , ` lplot.py `
132
+ (optional)
133
+ Copy the following directories with their contents to the root:
134
+ ` widgets ` , ` demos ` (optional), ` framebuf_utils ` (optional, see below).
135
+
136
+ ## 1.4 Dependencies and Python files
137
+
138
+ Version 3 of uasyncio is included in firmware V1.13 and later. This is a
139
+ requirement.
140
+
141
+ Files in top level directory:
142
+ 1 . ` lcd_local.py ` Local hardware definition. This file should be edited to
130
143
match your hardware. On Pyboard D select the "X" connection.
144
+ 2 . ` font6.py ` Font files used in demos. These may be frozen as bytecode to
145
+ conserve RAM.
146
+ 3 . ` font10.py `
147
+ 4 . ` font14.py `
148
+
149
+ The fonts are generated from the free font FreeSans.ttf. See
150
+ [ External fonts] ( ./README.md#81-external-fonts ) .
151
+
152
+ Core files in ` core ` directory:
153
+ 1 . ` lcd160cr.py ` Official driver. Check for a newer version in the source tree
154
+ (` drivers/display ` ).
155
+ 2 . ` lcd160_gui.py ` The micro GUI library.
131
156
3 . ` constants.py ` Constants such as colors and shapes (import using
132
- ` from constants import * ` ).
157
+ ` from core.constants import * ` ).
158
+ 4 . ` lplot.py ` Optional graph plotting extension.
133
159
134
- Optional files used by test programs:
135
- 1 . ` font6.py ` Font file.
136
- 2 . ` font10.py ` Ditto.
137
- 3 . ` font14.py ` Ditto. These are generated from the free font FreeSans.ttf.
138
-
139
- Test/demo programs:
160
+ Test/demo programs in ` demos ` directory:
140
161
1 . ` lvst.py ` A test program for vertical linear sliders. Also demos an
141
162
asynchronous coroutine and linked sliders.
142
163
2 . ` lhst.py ` Tests horizontal slider controls, meter and LED. Demos
@@ -148,17 +169,22 @@ Test/demo programs:
148
169
5 . ` ldd.py ` Dropdown list and Listbox controls.
149
170
6 . ` ldb.py ` Modal dialog boxes.
150
171
7 . ` ldb_if.py ` As above but using an internal font.
172
+ 8 . ` lpt.py ` Demo of plot module.
173
+ 9 . ` lptg.py ` Plot with ` TSequence ` real time data acquisition.
174
+
175
+ Synchronisation primitives in ` primitives ` directory. This directory has a
176
+ minimum subset
177
+
178
+ The organisation as a Python package means that cross compilation of
179
+ ` lcd160_gui.py ` is no longer required on a Pyboard 1.1. To conserve RAM it is
180
+ recommended that font files are implemented as frozen bytecode. To further
181
+ reduce RAM this may be applied to other Python files.
151
182
152
- By the standards of the Pyboard this is a large library. The ` lcd160_gui.py `
153
- program is too large to be compiled on-board (unless using a Pyboard D) and
154
- must be cross-compiled. The test programs have been run with a standard
155
- firmware build. If memory problems are encountered Python code (including font
156
- files) may be implemented as frozen bytecode.
183
+ It is wise to issue ctrl-D to soft reset the Pyboard before importing a module
184
+ which uses the library. The test programs require a ctrl-D before import.
157
185
158
- It is also wise to issue ctrl-D to soft reset the Pyboard before importing a
159
- module which uses the library. The test programs require a ctrl-D before import.
160
186
161
- ## 1.4 A performance boost
187
+ ## 1.5 A performance boost
162
188
163
189
This will only make a significant difference to applications which render
164
190
substantial amounts of text using Python fonts.
0 commit comments