update spi lcd ui test

This commit is contained in:
不吃油炸鸡
2025-08-12 18:43:38 +08:00
parent b1b734b32d
commit 6a63839496
3 changed files with 8 additions and 2 deletions

View File

@@ -92,7 +92,7 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle)
hdma_spi2_tx.Init.PeriphInc = DMA_PINC_DISABLE; hdma_spi2_tx.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_spi2_tx.Init.MemInc = DMA_MINC_ENABLE; hdma_spi2_tx.Init.MemInc = DMA_MINC_ENABLE;
hdma_spi2_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; hdma_spi2_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
hdma_spi2_tx.Init.MemDataAlignment = DMA_PDATAALIGN_HALFWORD; hdma_spi2_tx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
hdma_spi2_tx.Init.Mode = DMA_NORMAL; hdma_spi2_tx.Init.Mode = DMA_NORMAL;
hdma_spi2_tx.Init.Priority = DMA_PRIORITY_LOW; hdma_spi2_tx.Init.Priority = DMA_PRIORITY_LOW;
hdma_spi2_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; hdma_spi2_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;

View File

@@ -107,7 +107,9 @@ void lv_port_disp_init(void)
static void disp_init(void) static void disp_init(void)
{ {
/*You code here*/ /*You code here*/
LCD_Init();
LCD_Fill(0,0, LCD_W, LCD_H, BLACK);
LCD_Set_Light(50);
} }
volatile bool disp_flush_enabled = true; volatile bool disp_flush_enabled = true;

View File

@@ -5,6 +5,8 @@
///////////////////// VARIABLES //////////////////// ///////////////////// VARIABLES ////////////////////
// pages
///////////////////// TEST LVGL SETTINGS //////////////////// ///////////////////// TEST LVGL SETTINGS ////////////////////
#if LV_COLOR_DEPTH != 16 #if LV_COLOR_DEPTH != 16
@@ -29,12 +31,14 @@ void ui_init(void)
true, LV_FONT_DEFAULT); true, LV_FONT_DEFAULT);
lv_disp_set_theme(dispp, theme); lv_disp_set_theme(dispp, theme);
PageManager_init(); PageManager_init();
// PageManager_register(&xxxpage); // PageManager_register(&xxxpage);
// test // test
lv_obj_t * test_page = lv_obj_create(NULL); lv_obj_t * test_page = lv_obj_create(NULL);
lv_obj_t * btn1 = lv_button_create(test_page); lv_obj_t * btn1 = lv_button_create(test_page);
lv_obj_align(btn1, LV_ALIGN_CENTER, 0, 0); lv_obj_align(btn1, LV_ALIGN_CENTER, 0, 0);
lv_disp_load_scr(test_page); lv_disp_load_scr(test_page);
//timer //timer
lv_timer_t * ui_MainTimer = lv_timer_create(main_timer, 1000, NULL); lv_timer_t * ui_MainTimer = lv_timer_create(main_timer, 1000, NULL);
} }