1
-
2
-
3
1
# LVGL binding for Micropython
4
2
______________________________
5
- <br >
6
-
7
- ### *** ATTENTION***
8
- _____________
9
-
10
- ** THIS IS NOT THE OFFICIAL LVGL BINDING FOR MICROPYTHON. WHILE IT IS LOOSLEY BASED
11
- ON THAT BINDING AND THERE IS CODE FROM THAT BINDING PRESENT THIS LIBRARY IS DIFFERENT!!**
12
-
13
- ** THIS LIBRARY IS IN ALPHA TESTING, IT IS NOT GOING TO BE STABLE AND
14
- IT WILL HAVE BUGS IN IT. I APPRECIATE HELP WITH BUG TESTING AND FIXING ISSUES.
15
- PR's ARE ALWAYS WELCOME.**
16
-
17
- ** IF YOU ARE WANTING TO HELP WITH BUG TESTING IT IS MORE EFFICIENT IF THE CODE I
18
- SUPPLY TO RUN WHEN TETSING IS USED UNALTERED. THE REASON FOR THIS IS A LOT OF
19
- THE TIME I AM TESTING FOR SPECIFIC OUTPUT AND IF THE CODE GETS CHANGED THAT
20
- OUTPUT ENDS UP GETTING CHANGED. I DO TEND TO BREAK THINGS A LOT AND YOU HAVE TO
21
- BE WILLING TO WORK WITH ME ON THIS. WHILE I AM NOT A GREENHORN TO PROGRAMMING
22
- C/CPP IS NOT A LANGUAGE I AM PROFICIENT IN.**
23
-
24
- <br >
25
-
26
- *** NOTE*** : ** UPDATED ESP BUILD, PLEASE READ TO GET NEW INFORMATION**
27
3
28
4
29
5
I have tried to make this as simple as possible for paople to use.
@@ -54,9 +30,7 @@ installed (gcc, clang, msvc) and the necessary support libs.
54
30
55
31
### * Requirements*
56
32
_________________
57
-
58
33
compiling for ESP32
59
-
60
34
* Ubuntu (Linux): you can install all of these using ` apt-get install `
61
35
* build-essential
62
36
* cmake
@@ -72,7 +46,6 @@ compiling for ESP32
72
46
73
47
74
48
Compiling for RP2
75
-
76
49
* Ubuntu (Linux): you can install all of these using ` apt-get install `
77
50
* build-essential
78
51
* cmake
@@ -94,7 +67,6 @@ Compiling for RP2
94
67
95
68
96
69
Compiling for STM32:
97
-
98
70
* Ubuntu (Linux): you can install all of these using ` apt-get install `
99
71
* gcc-arm-none-eabi
100
72
* libnewlib-arm-none-eabi
@@ -149,15 +121,13 @@ Compiling for Ubuntu (Linux): you can install all of these using `apt-get instal
149
121
150
122
151
123
Compiling for macOS
152
-
153
124
* ` command xcode-select–install `
154
125
* ` brew install libffi `
155
126
* ` brew install ninja `
156
127
* ` brew install make `
157
128
158
129
159
130
Compiling for Windows
160
-
161
131
* not supported yet
162
132
163
133
<br >
@@ -234,55 +204,22 @@ ____________________
234
204
235
205
### * ESP32 specific options*
236
206
____________________________
207
+ * --skip-partition-resize: do not resize the firmware partition
208
+ * --partition-size: set a custom firmware partition size
209
+ * --octal-flash ¹: This is only available for the 16mb flash and the 32mb flash
210
+ * --flash-size ² ³: This is how much flash storage is available.
211
+
212
+ Allowed Values are:
237
213
238
- I have recently reworked the build system to allow for easier modifications to
239
- to the partitions on the ESP32. Previously I had only given the ability to adjust
240
- only the application partition size. With the most recent round of changes
241
- The user is now able to alter ANY of the partition sizes. The command line switches
242
- will vary vased on what board is being used. For the most part a lot of the
243
- boards will use the same switches.
244
-
245
-
246
- All boards have the following switches.
247
-
248
- * --nvs-size={size}: This is used with the ESP32's persistant memory.
249
- This is where config values get stored.
250
- * --ota: just add this switch if you want your board to have the ability to do OTA updates.
251
- This will consume more of the flash because there needs to be 2 application partitions
252
- that are large enough to hold the firmware
253
- * --skip-partition-resize: Supply this switch if you do not want the program to
254
- automatically resize the application partition. This is useful in a production
255
- environment and you want to use OTA updates for the firmware. You would set the
256
- application size to be more than what is needed so if a new firmware is released and it happens
257
- to be larger in size you will be able to fit it. If the partition is too small for the new firmware
258
- it becomes a real large headache because you will have to connect the ESP via USB to update the
259
- firmware.
260
- * --partition-size={size}: This is where you set the application partition size should you so choose to.
261
- The esp32 is going to automatically adjust the size to match the firmware so in most cases you will not
262
- need to use this unless you are using OTA and decide to set the partition size to be larger.
263
-
264
- board specific:
265
-
266
- * ESP32_GENERIC* :
267
- * --octal-flash: Only available with 16mb and 32mb flash on the S3, you still
268
- need to supply ` SPIRAM_OCT ` as the board variant
269
- * --flash-size: This is how much flash storage is available.
270
- Allowed Values are 2, 4, 8, 16 and 32. The default value varries based on the
271
- board being used
272
- * ARDUINO_NANO_ESP32:
273
- * always has ota enabled
274
- * --ffat-size={size}: adjusts the size of the ffat partition
275
- * --factory-size={size}: adjusts the sie of the factory partition
276
- * SIL_WESP32:
277
- * always has ota enabled.
278
-
279
-
280
- All boards except when OTA is enabled:
281
- * --phyinit-size={size}: adjusts the size of the phy_init partition
282
-
283
- All partition sizes should be an even multiple of 4096, if it is not the size
284
- will be rounded up to the closest 4096.
214
+ * ESP32-S3: 4, 8, 16 and 32 (default is 8)
215
+ * ESP32-S2: 2 and 4 (default is 4)
216
+ * ESP32: 4, 8 and 16 (default is 4)
217
+ , The default is 8.
218
+
285
219
220
+ ¹ Available for the ESP32-S3 when ` BOARD_VARIANT ` is set to ` SPIRAM_OCT ` <br >
221
+ ² Available for the ESP32, ESP32-S2 and ESP32-S3<br >
222
+ ³ Available only when ` BOARD_VARIANT ` is set to ` SPIRAM ` or ` SPIRAM_OCT ` <br >
286
223
287
224
<br >
288
225
@@ -497,6 +434,12 @@ build without submodules or mpy_cross
497
434
498
435
I always recommend building with the clean command, this will ensure you get a good fresh build.
499
436
437
+ NOTE:
438
+ There is a bug in the ESP32 build. The first time around it will fail saying that
439
+ one of the sumbodules is not available. Run the build again with the submodules
440
+ argument in there and then it will build fine. For the life of me I cam not able to locate
441
+ where the issue is stemming from. I will find it eventually.
442
+
500
443
<br >
501
444
502
445
I will provide directions on how to use the driver framework and also the drivers that are included
@@ -517,9 +460,9 @@ Couple of notes:
517
460
518
461
* I recommend making 2 frame buffers as seen in the code example below. This will give you
519
462
better performance.
520
- * *** DO NOT* ** enable LV_USE_DRAW_SDL, I have not written code to allow for it's use (yet).
463
+ * ** DO NOT** enable LV_USE_DRAW_SDL, I have not written code to allow for it's use (yet).
521
464
* I recommend running ` lv.task_handler ` once every 5 milliseconds, shorter than that and you
522
- will have a lot of CPU time comsumed. Longer than that and your mouse response is not
465
+ will have a lot of CPU time comsumed. Linger than that and your mouse response is not
523
466
going to be great.
524
467
525
468
@@ -657,7 +600,6 @@ and also the calibration storage.
657
600
import ft6x36 # NOQA
658
601
import time # NOQA
659
602
660
- display.set_power(True)
661
603
display.init()
662
604
663
605
i2c_bus = i2c.I2CBus(scl=_SCL, sda=_SDA, freq=_TP_FREQ, use_locks=False)
@@ -694,28 +636,4 @@ regardless of what `indev.is_calibrate` returns. This makes it possible to redo
694
636
the calibration by either using a pin that you can check the state of or through
695
637
a button in your UI that you provide to the user.
696
638
697
-
698
- For the ESP32 I have written an NVS connection. One existed in the ` esp32 ` module
699
- but it was limited in it's scope. It was only able to set ` int32_t ` 's byte arrays
700
- and strings. The module I wrote (` nvs ` ) include the following data types.
701
-
702
- * ` int8_t `
703
- * ` uint8_t `
704
- * ` int16_t `
705
- * ` uint16_t `
706
- * ` int32_t `
707
- * ` uint32_t `
708
- * ` int64_t `
709
- * ` uint64_t `
710
- * ` string `
711
- * ` arrays `
712
- * ` float `
713
-
714
- It also allows for enumerating all of the keys and datatypes that are currently stored.
715
- There are 2 functions for dealing with the data that is stored. One is ` get ` and the
716
- other is ` set ` . YOu need to specify what kind of data you are dealing with. This is done
717
- using one of the ` nvs.TYPE_* ` constants. There is a stub file available in the
718
- ` esp32_stubs ` folder.
719
-
720
-
721
- Have fun!!
639
+ Thank again and enjoy!!
0 commit comments