fix(lcd-backlight): Update to ESP IDF v5
This commit is contained in:
parent
8592cb9d29
commit
341b522b7b
2 changed files with 5 additions and 3 deletions
|
@ -88,7 +88,7 @@ endif()
|
||||||
|
|
||||||
idf_component_register(SRCS ${SOURCES}
|
idf_component_register(SRCS ${SOURCES}
|
||||||
INCLUDE_DIRS ${LVGL_INCLUDE_DIRS}
|
INCLUDE_DIRS ${LVGL_INCLUDE_DIRS}
|
||||||
REQUIRES lvgl)
|
REQUIRES lvgl driver esp_common log freertos esp_rom soc)
|
||||||
|
|
||||||
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_LVGL_H_INCLUDE_SIMPLE")
|
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_LVGL_H_INCLUDE_SIMPLE")
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,12 @@
|
||||||
*********************/
|
*********************/
|
||||||
#include "esp_lcd_backlight.h"
|
#include "esp_lcd_backlight.h"
|
||||||
#include "driver/ledc.h"
|
#include "driver/ledc.h"
|
||||||
#include "driver/gpio.h"
|
#include "rom/gpio.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "soc/ledc_periph.h" // to invert LEDC output on IDF version < v4.3
|
#include "soc/ledc_periph.h" // to invert LEDC output on IDF version < v4.3
|
||||||
|
|
||||||
|
#define SIG_GPIO_OUT_IDX 128
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool pwm_control; // true: LEDC is used, false: GPIO is used
|
bool pwm_control; // true: LEDC is used, false: GPIO is used
|
||||||
int index; // Either GPIO or LEDC channel
|
int index; // Either GPIO or LEDC channel
|
||||||
|
@ -49,7 +51,7 @@ disp_backlight_h disp_backlight_new(const disp_backlight_config_t *config)
|
||||||
};
|
};
|
||||||
const ledc_timer_config_t LCD_backlight_timer = {
|
const ledc_timer_config_t LCD_backlight_timer = {
|
||||||
.speed_mode = LEDC_LOW_SPEED_MODE,
|
.speed_mode = LEDC_LOW_SPEED_MODE,
|
||||||
.bit_num = LEDC_TIMER_10_BIT,
|
.duty_resolution = LEDC_TIMER_10_BIT,
|
||||||
.timer_num = config->timer_idx,
|
.timer_num = config->timer_idx,
|
||||||
.freq_hz = 5000,
|
.freq_hz = 5000,
|
||||||
.clk_cfg = LEDC_AUTO_CLK};
|
.clk_cfg = LEDC_AUTO_CLK};
|
||||||
|
|
Loading…
Reference in a new issue