Skip to content

Commit 59a708e

Browse files
committed
Merge branch 'feat/mmap_fs_support' into 'master'
feat(esp_mamp_assets): Enable parse bin form filesystem Closes AEG-2832 See merge request ae_group/esp-iot-solution!1402
2 parents 1eb9f02 + db5636c commit 59a708e

File tree

13 files changed

+900
-92
lines changed

13 files changed

+900
-92
lines changed

components/display/lcd/esp_lcd_axs15231b/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.0.1"
1+
version: "1.0.1~1"
22
description: ESP LCD & Touch AXS15231B
33
url: https://github.com/espressif/esp-iot-solution/tree/master/components/display/lcd/esp_lcd_axs15231b
44
issues: https://github.com/espressif/esp-iot-solution/issues

components/display/tools/esp_lv_decoder/idf_component.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "0.3.0"
1+
version: "0.3.0~1"
22
targets:
33
- esp32
44
- esp32s2
@@ -18,7 +18,7 @@ dependencies:
1818
espressif/libpng:
1919
version: "1.*"
2020
espressif/esp_new_jpeg:
21-
version: 0.5.*
21+
version: 0.*
2222
lvgl/lvgl:
2323
version: ">=8,<10"
2424
examples:

components/display/tools/esp_mmap_assets/README.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ This module is primarily used for packaging assets (such as images, fonts, etc.)
2121
5. **LVGL-Specific Binary Format Support**:
2222
- Supports image conversion to binary files required by LVGL, ensuring compatibility with the LVGL graphics library and optimizing performance for display rendering.
2323

24+
6. **Multiple Access Modes**:
25+
- **Partition Mode**: Access assets from ESP32 partition (default)
26+
- **Memory Mapping Mode**: Direct memory access for maximum performance
27+
- **File System Mode**: Access assets from file system for development and testing
28+
2429
## Add to Project
2530

2631
Packages from this repository are uploaded to [Espressif's component service](https://components.espressif.com/). You can add them to your project via `idf.py add-dependency`, e.g.
@@ -177,6 +182,8 @@ set(one_value_args
177182
```
178183

179184
### Initialization
185+
186+
#### Partition Mode (Default)
180187
```c
181188
mmap_assets_handle_t asset_handle;
182189

@@ -192,19 +199,69 @@ set(one_value_args
192199
.max_files = MMAP_MY_FOLDER_FILES, //Get it from the compiled .h
193200
.checksum = MMAP_MY_FOLDER_CHECKSUM, //Get it from the compiled .h
194201
.flags = {
195-
.mmap_enable = true,
202+
.mmap_enable = false, // Use partition mode
203+
.use_fs = false, // Not using file system
204+
.app_bin_check = true,
205+
},
206+
};
207+
208+
ESP_ERROR_CHECK(mmap_assets_new(&config, &asset_handle));
209+
```
210+
211+
#### Memory Mapping Mode
212+
```c
213+
const mmap_assets_config_t config = {
214+
.partition_label = "my_spiffs_partition",
215+
.max_files = MMAP_MY_FOLDER_FILES,
216+
.checksum = MMAP_MY_FOLDER_CHECKSUM,
217+
.flags = {
218+
.mmap_enable = true, // Enable memory mapping
219+
.use_fs = false, // Not using file system
220+
.app_bin_check = true,
221+
},
222+
};
223+
224+
ESP_ERROR_CHECK(mmap_assets_new(&config, &asset_handle));
225+
```
226+
227+
#### File System Mode
228+
```c
229+
const mmap_assets_config_t config = {
230+
.partition_label = "/spiffs/assets.bin", // File path instead of partition name
231+
.max_files = MMAP_MY_FOLDER_FILES,
232+
.checksum = MMAP_MY_FOLDER_CHECKSUM,
233+
.flags = {
234+
.mmap_enable = false, // Disable memory mapping
235+
.use_fs = true, // Use file system
196236
.app_bin_check = true,
197237
},
198238
};
199239

200240
ESP_ERROR_CHECK(mmap_assets_new(&config, &asset_handle));
241+
```
201242
243+
#### Accessing Assets
244+
```c
202245
const char *name = mmap_assets_get_name(asset_handle, 0);
203246
const void *mem = mmap_assets_get_mem(asset_handle, 0);
204247
int size = mmap_assets_get_size(asset_handle, 0);
205248
int width = mmap_assets_get_width(asset_handle, 0);
206249
int height = mmap_assets_get_height(asset_handle, 0);
207250
208251
ESP_LOGI(TAG, "Asset - Name:[%s], Memory:[%p], Size:[%d bytes], Width:[%d px], Height:[%d px]", name, mem, size, width, height);
209-
210252
```
253+
254+
### Access Mode Comparison
255+
256+
| Mode | Performance | Memory Usage | Use Case |
257+
|------|-------------|--------------|----------|
258+
| **Partition** | Good | Low | Production deployment |
259+
| **Memory Mapping** | Best | Medium | High-performance applications |
260+
| **File System** | Good | Low | Development and testing |
261+
262+
### Thread Safety
263+
264+
All access modes are thread-safe:
265+
- **Partition Mode**: ESP-IDF handles thread safety internally
266+
- **Memory Mapping Mode**: Direct memory access (inherently thread-safe)
267+
- **File System Mode**: Protected by internal mutex for file operations

0 commit comments

Comments
 (0)