You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/envs/use_with_micropython.md
+56-44Lines changed: 56 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,6 @@
1
1
# Using with micropython
2
2
3
-
This is an example of how to integrate this library into micropython. It's written for an ESP32-S3, however
4
-
it should be easy to adapt to different supported ESP-Chips. Please note, that you'll need at least 4mb of flash.
5
-
3
+
This is an example of how to integrate this library into micropython. It's written for an ESP32-S3, however it should be easy to adapt to different supported ESP-Chips. Please note, that you'll need at least 4mb of flash.
6
4
7
5
## Step-by-Step instructions
8
6
@@ -25,33 +23,36 @@ it should be easy to adapt to different supported ESP-Chips. Please note, that y
25
23
```
26
24
27
25
2. Ensure, you can build a working firmware
28
-
26
+
29
27
```bash
30
28
make BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT -C ports/esp32
This may fail if your chip has a small flash size, in this case you have to increase the size of the
76
-
application partition. E.g. for a 4mb flash chip edit micropython/ports/esp32/partitions-4MiB.csv and change the last
77
-
two lines from:
78
77
79
-
```csv
80
-
factory, app, factory, 0x10000, 0x1F0000,
81
-
vfs, data, fat, 0x200000, 0x200000,
78
+
This may fail if your chip has a small flash size, in this case you have to increase the size of the application partition. E.g. for a 4mb flash chip edit *micropython/ports/esp32/partitions-4MiB.csv* and change the last two lines from:
79
+
80
+
```csv
81
+
factory, app, factory, 0x10000, 0x1F0000,
82
+
vfs, data, fat, 0x200000, 0x200000,
82
83
```
83
-
to
84
-
```csv
85
-
factory, app, factory, 0x10000, 0x2F0000,
86
-
vfs, data, fat, 0x300000, 0x100000,
84
+
85
+
to
86
+
87
+
```csv
88
+
factory, app, factory, 0x10000, 0x2F0000,
89
+
vfs, data, fat, 0x300000, 0x100000,
87
90
```
88
91
89
92
7. Test the module
90
-
Connect to your board and run:
93
+
94
+
Connect to your board and run:
95
+
91
96
```python
92
-
from esp_panel import Board
93
-
board = Board()
94
-
board.init()
97
+
from esp_panel import Board
98
+
board = Board()
99
+
board.init()
95
100
```
96
-
board.init() should return False, as we yet have to define a board.
101
+
102
+
`board.init()` should return False, as we yet have to define a board.
Edit ESP32_Display_Panel/esp_panel_drivers_conf.h and ensure, the drivers referenced in your board config are being
155
-
build. Warning: ESP_PANEL_DRIVERS_BUS_USE_ALL does not seem to work. Set to 0 and manually include the bus driver
156
-
you need. Same goes for ESP_PANEL_DRIVERS_BUS_COMPILE_UNUSED_DRIVERS.
157
166
158
-
10. Repeat Step 6 to rebuild micropython
167
+
Edit *ESP32_Display_Panel/esp_panel_drivers_conf.h* and ensure, the drivers referenced in your board config are being
168
+
build. **Warning**: `ESP_PANEL_DRIVERS_BUS_USE_ALL` does not seem to work. Set to 0 and manually include the bus driver
169
+
you need. Same goes for `ESP_PANEL_DRIVERS_BUS_COMPILE_UNUSED_DRIVERS`.
170
+
171
+
10. Repeat **Step 6** to rebuild micropython
159
172
160
173
11. Test your display
174
+
161
175
Connect to your board and run:
176
+
162
177
```python
163
178
from esp_panel import Board
164
179
board = Board()
165
180
board.init()
166
181
board.begin()
167
182
board.color_bar_test()
168
183
```
169
-
184
+
170
185
12. Profit! :)
171
186
172
-
To include touch support, see ESP32_Display_Panel/examples/arduino/board/board_dynamic_config/board_external_config.cpp
173
-
for an example touch definition.
174
-
187
+
To include touch support, see *ESP32_Display_Panel/examples/arduino/board/board_dynamic_config/board_external_config.cpp* for an example touch definition.
175
188
176
189
## Known Pitfalls
177
190
178
-
1. When board.init() returns false, likely your driver-definition in esp_panel_drivers_conf.h does not match.
179
-
2. board.begin() crashes, if you rely on ESP_PANEL_DRIVERS_BUS_USE_ALL
180
-
3. If you edit ESP32_Display_Panel/esp_panel_drivers_conf.h, also modify ESP32_Display_Panel/mpy_support/esp_panel_mp_board.cpp
181
-
(like add or remove an empty line). Otherwise, changes to esp_panel_drivers_conf.h will not be recognized.
191
+
1. When `board.init()` returns false, likely your driver-definition in *esp_panel_drivers_conf.h* does not match.
192
+
2. `board.begin()` crashes, if you rely on `ESP_PANEL_DRIVERS_BUS_USE_ALL`
193
+
3. If you edit *ESP32_Display_Panel/esp_panel_drivers_conf.h*, also modify *ESP32_Display_Panel/mpy_support/esp_panel_mp_board.cpp* (like add or remove an empty line). Otherwise, changes to *esp_panel_drivers_conf.h* will not be recognized.
0 commit comments