|
9 | 9 | - [SDK \& Dependencies](#sdk--dependencies) |
10 | 10 | - [Adding to Project](#adding-to-project) |
11 | 11 | - [Configuration Guide](#configuration-guide) |
| 12 | + - [Using `esp_panel_board_custom_conf.h` with ESP\_IDF](#using-esp_panel_board_custom_confh-with-esp_idf) |
12 | 13 | - [Example Description](#example-description) |
13 | 14 | - [FAQ](#faq) |
14 | 15 | - [Solution for screen drift issue when using ESP32-S3 to drive RGB LCD in ESP-IDF](#solution-for-screen-drift-issue-when-using-esp32-s3-to-drive-rgb-lcd-in-esp-idf) |
@@ -71,6 +72,36 @@ Additionally, since ESP32_Display_Panel depends on the `esp-lib-utils` component |
71 | 72 | > * Run `idf.py save-defconfig` to save the current project's `menuconfig` configuration and generate a *sdkconfig.defaults* default configuration file in the project directory. |
72 | 73 | > * To discard the current project's menuconfig configuration and load default settings, first delete the *sdkconfig* file in the project directory, then run `idf.py reconfigure`. |
73 | 74 |
|
| 75 | +## Using `esp_panel_board_custom_conf.h` with ESP_IDF |
| 76 | +
|
| 77 | +It can be justified to not use `menuconfig` to set up a custom board with the `esp_panel_board_custom_conf.h` file instead, for example to be able to easily define macros that will execute between the board components initialisation steps, or to tinker with advanced vendor commands. |
| 78 | +
|
| 79 | +Because of the component-centric philosophy of ESP-IDF, it is not as simple as dropping the configuration file in the `main` folder and including it in your main app source file. |
| 80 | +
|
| 81 | +Instead, you need to follow these steps : |
| 82 | +
|
| 83 | +1. Run the command `idf.py menuconfig` and make sure that the option *Enable to skip `esp_panel_board_*.h`* is **unchecked**. If you don't see this option, make sure you have added the library as a component to your project first ! |
| 84 | +2. Copy your `esp_panel_board_custom_conf.h` file to a folder *inside your project folder*. For those instructions, we will assume that the file is correctly configured and copied inside a folder located at `/main/conf/` like so : |
| 85 | +``` |
| 86 | +Project Folder - | |
| 87 | + | - CMakeLists.txt |
| 88 | + | - main - | |
| 89 | + | | - main.c |
| 90 | + | | - conf - | |
| 91 | + | | | - esp_panel_board_custom_conf.h |
| 92 | + | | | ... |
| 93 | + | | ... |
| 94 | + | ... |
| 95 | +``` |
| 96 | +3. Edith the **project** `CMakeLists.txt` by adding the following line *before* the `project` instruction, like so : |
| 97 | +``` |
| 98 | +... |
| 99 | +include_directories(${CMAKE_CURRENT_LIST_DIR}/main/conf) |
| 100 | +project(... |
| 101 | +``` |
| 102 | +
|
| 103 | +This will have the effect of loading the macros way before compilation, making it similar to use as under the PlatformIO IDE or Arduino framework. |
| 104 | +
|
74 | 105 | ## Example Description |
75 | 106 |
|
76 | 107 | * [lvgl_v8_port](../../examples/esp_idf/lvgl_v8_port/): This example demonstrates how to port `LVGL v8`. And it runs LVGL's internal demos include `Music Player`, `Widgets`, `Stress` and `Benchmark`. |
|
0 commit comments