/* * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2025-11-25 Administrator the first version */ #include #include #include #include "lvgl.h" #define DBG_TAG "gui" #define DBG_LVL DBG_LOG #include #define LCD_BL_PIN GET_PIN(D,12) #define LCD_RST_PIN GET_PIN(D,11) void lv_user_gui_init(void) { // rt_pin_mode(LCD_BL_PIN, PIN_MODE_OUTPUT); // rt_pin_write( LCD_BL_PIN, PIN_HIGH); // rt_pin_mIN, ode(LCD_RST_PIN, PIN_MODE_OUTPUT); // rt_pin_write( LCD_RST_PPIN_LOW); // 检查 LTDC 是否全局使能 if (LTDC->GCR & LTDC_GCR_LTDCEN) { LOG_D("LTDC is ENABLED"); } else { LOG_E("LTDC is NOT enabled!"); } // 检查图层 0 是否使能 if (LTDC_Layer1->CR & LTDC_LxCR_LEN) { LOG_D("Layer 0 is ENABLED"); } else { LOG_E("Layer 0 is NOT enabled!"); } if (__HAL_RCC_LTDC_IS_CLK_ENABLED()) { LOG_D("LTDC clock is enabled"); } else { LOG_E("LTDC clock is DISABLED! <-- This is likely the root cause"); } // lv_obj_t *label = lv_label_create(lv_scr_act()); // lv_label_set_text(label, "Hello LVGL on RT-Thread!"); // lv_obj_align(label, LV_ALIGN_CENTER, 0, 0); } //INIT_APP_EXPORT(lv_user_gui_init);