File tree Expand file tree Collapse file tree 14 files changed +193
-18
lines changed
board/board_static_config
platformio/lvgl_v8_port/src Expand file tree Collapse file tree 14 files changed +193
-18
lines changed Original file line number Diff line number Diff line change 1
1
# ChangeLog
2
2
3
- ## v1.0.2 - 2025-03-24
3
+ ## v1.0.2 - 2025-04-23
4
+
5
+ ### Enhancements:
6
+
7
+ * feat(backlight): add PWM parameters configuration (#188 )
4
8
5
9
### Bugfixes:
6
10
Original file line number Diff line number Diff line change 476
476
#define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number
477
477
#define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high
478
478
479
+ #if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC
480
+ /**
481
+ * @brief PWM parameters configuration
482
+ */
483
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency.
484
+ // Different backlight driver chips may have different
485
+ // frequency limits, please refer to the datasheet of
486
+ // the specific chip.
487
+ // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188
488
+
489
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution.
490
+ // The frequency and duty resolution of the LEDC timer
491
+ // need to be properly matched, please refer to:
492
+ // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions
493
+ #endif
494
+
479
495
#elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM
480
496
481
497
/**
735
751
* 3. Patch version mismatch: No impact on functionality
736
752
*/
737
753
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1
738
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0
739
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2
754
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
755
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
740
756
741
757
#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM
742
758
Original file line number Diff line number Diff line change 476
476
#define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number
477
477
#define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high
478
478
479
+ #if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC
480
+ /**
481
+ * @brief PWM parameters configuration
482
+ */
483
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency.
484
+ // Different backlight driver chips may have different
485
+ // frequency limits, please refer to the datasheet of
486
+ // the specific chip.
487
+ // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188
488
+
489
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution.
490
+ // The frequency and duty resolution of the LEDC timer
491
+ // need to be properly matched, please refer to:
492
+ // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions
493
+ #endif
494
+
479
495
#elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM
480
496
481
497
/**
735
751
* 3. Patch version mismatch: No impact on functionality
736
752
*/
737
753
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1
738
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0
739
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2
754
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
755
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
740
756
741
757
#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM
742
758
Original file line number Diff line number Diff line change 476
476
#define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number
477
477
#define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high
478
478
479
+ #if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC
480
+ /**
481
+ * @brief PWM parameters configuration
482
+ */
483
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency.
484
+ // Different backlight driver chips may have different
485
+ // frequency limits, please refer to the datasheet of
486
+ // the specific chip.
487
+ // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188
488
+
489
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution.
490
+ // The frequency and duty resolution of the LEDC timer
491
+ // need to be properly matched, please refer to:
492
+ // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions
493
+ #endif
494
+
479
495
#elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM
480
496
481
497
/**
735
751
* 3. Patch version mismatch: No impact on functionality
736
752
*/
737
753
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1
738
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0
739
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2
754
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
755
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
740
756
741
757
#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM
742
758
Original file line number Diff line number Diff line change 476
476
#define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number
477
477
#define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high
478
478
479
+ #if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC
480
+ /**
481
+ * @brief PWM parameters configuration
482
+ */
483
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency.
484
+ // Different backlight driver chips may have different
485
+ // frequency limits, please refer to the datasheet of
486
+ // the specific chip.
487
+ // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188
488
+
489
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution.
490
+ // The frequency and duty resolution of the LEDC timer
491
+ // need to be properly matched, please refer to:
492
+ // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions
493
+ #endif
494
+
479
495
#elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM
480
496
481
497
/**
735
751
* 3. Patch version mismatch: No impact on functionality
736
752
*/
737
753
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1
738
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0
739
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2
754
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
755
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
740
756
741
757
#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM
742
758
Original file line number Diff line number Diff line change 476
476
#define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number
477
477
#define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high
478
478
479
+ #if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC
480
+ /**
481
+ * @brief PWM parameters configuration
482
+ */
483
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency.
484
+ // Different backlight driver chips may have different
485
+ // frequency limits, please refer to the datasheet of
486
+ // the specific chip.
487
+ // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188
488
+
489
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution.
490
+ // The frequency and duty resolution of the LEDC timer
491
+ // need to be properly matched, please refer to:
492
+ // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions
493
+ #endif
494
+
479
495
#elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM
480
496
481
497
/**
735
751
* 3. Patch version mismatch: No impact on functionality
736
752
*/
737
753
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1
738
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0
739
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2
754
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
755
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
740
756
741
757
#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM
742
758
Original file line number Diff line number Diff line change 476
476
#define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number
477
477
#define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high
478
478
479
+ #if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC
480
+ /**
481
+ * @brief PWM parameters configuration
482
+ */
483
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency.
484
+ // Different backlight driver chips may have different
485
+ // frequency limits, please refer to the datasheet of
486
+ // the specific chip.
487
+ // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188
488
+
489
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution.
490
+ // The frequency and duty resolution of the LEDC timer
491
+ // need to be properly matched, please refer to:
492
+ // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions
493
+ #endif
494
+
479
495
#elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM
480
496
481
497
/**
735
751
* 3. Patch version mismatch: No impact on functionality
736
752
*/
737
753
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1
738
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0
739
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2
754
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
755
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
740
756
741
757
#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM
742
758
Original file line number Diff line number Diff line change 476
476
#define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number
477
477
#define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high
478
478
479
+ #if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC
480
+ /**
481
+ * @brief PWM parameters configuration
482
+ */
483
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (5000) // LEDC timer frequency.
484
+ // Different backlight driver chips may have different
485
+ // frequency limits, please refer to the datasheet of
486
+ // the specific chip.
487
+ // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188
488
+
489
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution.
490
+ // The frequency and duty resolution of the LEDC timer
491
+ // need to be properly matched, please refer to:
492
+ // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions
493
+ #endif
494
+
479
495
#elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_CUSTOM
480
496
481
497
/**
735
751
* 3. Patch version mismatch: No impact on functionality
736
752
*/
737
753
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1
738
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0
739
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 2
754
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
755
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
740
756
741
757
#endif // ESP_PANEL_BOARD_DEFAULT_USE_CUSTOM
742
758
Original file line number Diff line number Diff line change @@ -57,6 +57,23 @@ if ESP_PANEL_BOARD_USE_BACKLIGHT
57
57
Active level for backlight control.
58
58
endmenu
59
59
60
+ menu "PWM parameters"
61
+ depends on ESP_PANEL_BOARD_BACKLIGHT_TYPE_PWM_LEDC
62
+
63
+ config ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ
64
+ int "Frequency"
65
+ default 5000
66
+ help
67
+ Frequency for PWM control.
68
+
69
+ config ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION
70
+ int "Duty resolution"
71
+ default 10
72
+ range 1 20
73
+ help
74
+ Duty resolution for PWM control.
75
+ endmenu
76
+
60
77
config ESP_PANEL_BOARD_BACKLIGHT_IDLE_OFF
61
78
bool "Idle off"
62
79
default n
Original file line number Diff line number Diff line change 42
42
#error "Missing configuration: ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL"
43
43
#endif
44
44
#endif
45
+
46
+ #if (ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC )
47
+ #ifndef ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ
48
+ #ifdef CONFIG_ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ
49
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ CONFIG_ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ
50
+ #else
51
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ 5000 // Keep the backward compatibility
52
+ #endif
53
+ #endif
54
+ #endif
55
+
56
+ #if (ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC )
57
+ #ifndef ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION
58
+ #ifdef CONFIG_ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION
59
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION CONFIG_ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION
60
+ #else
61
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION 10 // Keep the backward compatibility
62
+ #endif
63
+ #endif
64
+ #endif
45
65
#endif
46
66
47
67
#ifndef ESP_PANEL_BOARD_BACKLIGHT_IDLE_OFF
Original file line number Diff line number Diff line change @@ -293,6 +293,10 @@ const BoardConfig ESP_PANEL_BOARD_DEFAULT_CONFIG = {
293
293
},
294
294
#elif ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC
295
295
.config = BacklightPWM_LEDC::Config{
296
+ .ledc_timer = BacklightPWM_LEDC::LEDC_TimerPartialConfig{
297
+ .freq_hz = ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ,
298
+ .duty_resolution = ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION,
299
+ },
296
300
.ledc_channel = BacklightPWM_LEDC::LEDC_ChannelPartialConfig{
297
301
.io_num = ESP_PANEL_BOARD_BACKLIGHT_IO,
298
302
.on_level = ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL,
Original file line number Diff line number Diff line change 345
345
#define ESP_PANEL_BOARD_BACKLIGHT_IO (38) // Output GPIO pin number
346
346
#define ESP_PANEL_BOARD_BACKLIGHT_ON_LEVEL (1) // Active level, 0: low, 1: high
347
347
348
+
349
+ #if ESP_PANEL_BOARD_BACKLIGHT_TYPE == ESP_PANEL_BACKLIGHT_TYPE_PWM_LEDC
350
+ /**
351
+ * @brief PWM parameters configuration
352
+ */
353
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_FREQ_HZ (1000) // LEDC timer frequency.
354
+ // Different backlight driver chips may have different
355
+ // frequency limits, please refer to the datasheet of
356
+ // the specific chip.
357
+ // https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/188
358
+
359
+ #define ESP_PANEL_BOARD_BACKLIGHT_PWM_DUTY_RESOLUTION (10) // LEDC timer duty resolution.
360
+ // The frequency and duty resolution of the LEDC timer
361
+ // need to be properly matched, please refer to:
362
+ // https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/ledc.html#supported-range-of-frequency-and-duty-resolutions
363
+ #endif
364
+
348
365
#endif // ESP_PANEL_BOARD_BACKLIGHT_TYPE
349
366
350
367
/**
381
398
* 3. Patch version mismatch: No impact on functionality
382
399
*/
383
400
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1
384
- #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0
401
+ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
385
402
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
386
403
387
404
// *INDENT-ON*
Original file line number Diff line number Diff line change 17
17
18
18
/* File `esp_panel_board_custom_conf.h` */
19
19
#define ESP_PANEL_BOARD_CUSTOM_VERSION_MAJOR 1
20
- #define ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR 0
21
- #define ESP_PANEL_BOARD_CUSTOM_VERSION_PATCH 2
20
+ #define ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR 1
21
+ #define ESP_PANEL_BOARD_CUSTOM_VERSION_PATCH 0
22
22
23
23
/* File `esp_panel_board_supported_conf.h` */
24
24
#define ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR 1
Original file line number Diff line number Diff line change 7
7
8
8
exclude_dirs = [
9
9
'./build' ,
10
+ './examples/platformio/lvgl_v8_port/.pio'
10
11
]
11
12
internal_version_file = 'src/esp_panel_versions.h'
12
13
include_files = [
You can’t perform that action at this time.
0 commit comments