Example of using the LVGL (8.3.4) with the MbedOS (6.16 - bare metal) on the Disco-F746NG board
Dependencies: BSP_DISCO_F746NG
Revision 6:778736ecceb0, committed 21 months ago
- Comitter:
- JohnnyK
- Date:
- Sat Feb 04 21:01:46 2023 +0000
- Parent:
- 5:071136c3eefa
- Commit message:
- Update MbedOS to 6.16, update LVGL to 8.3.4 and update Notebook URL
Changed in this revision
diff -r 071136c3eefa -r 778736ecceb0 hal_stm_lvgl/tft/tft.c --- a/hal_stm_lvgl/tft/tft.c Tue Jun 15 19:35:57 2021 +0000 +++ b/hal_stm_lvgl/tft/tft.c Sat Feb 04 21:01:46 2023 +0000 @@ -2,7 +2,7 @@ * @file tft.c * */ - + /********************* * INCLUDES *********************/ @@ -10,31 +10,29 @@ #include "lvgl/lvgl.h" #include <string.h> #include <stdlib.h> - + #include "tft.h" #include "stm32f7xx.h" #include "stm32746g_discovery.h" #include "stm32746g_discovery_sdram.h" #include "stm32746g_discovery_ts.h" #include "../Components/rk043fn48h/rk043fn48h.h" - + /********************* * DEFINES *********************/ - + #if LV_COLOR_DEPTH != 16 && LV_COLOR_DEPTH != 24 && LV_COLOR_DEPTH != 32 #error LV_COLOR_DEPTH must be 16, 24, or 32 #endif -#define LV_USE_GPU 0 - /** * @brief LCD status structure definition */ #define LCD_OK ((uint8_t)0x00) #define LCD_ERROR ((uint8_t)0x01) #define LCD_TIMEOUT ((uint8_t)0x02) - + /** * @brief LCD special pins */ @@ -43,65 +41,56 @@ #define LCD_DISP_GPIO_PORT GPIOI #define LCD_DISP_GPIO_CLK_ENABLE() __HAL_RCC_GPIOI_CLK_ENABLE() #define LCD_DISP_GPIO_CLK_DISABLE() __HAL_RCC_GPIOI_CLK_DISABLE() - + /* Backlight control pin */ #define LCD_BL_CTRL_PIN GPIO_PIN_3 #define LCD_BL_CTRL_GPIO_PORT GPIOK #define LCD_BL_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOK_CLK_ENABLE() #define LCD_BL_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOK_CLK_DISABLE() - + #define CPY_BUF_DMA_STREAM DMA2_Stream0 #define CPY_BUF_DMA_CHANNEL DMA_CHANNEL_0 #define CPY_BUF_DMA_STREAM_IRQ DMA2_Stream0_IRQn #define CPY_BUF_DMA_STREAM_IRQHANDLER DMA2_Stream0_IRQHandler - + /********************** * TYPEDEFS **********************/ - + /********************** * STATIC PROTOTYPES **********************/ - + /*These 3 functions are needed by LittlevGL*/ static void ex_disp_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t * color_p); -#if LV_USE_GPU -static void gpu_mem_blend(lv_disp_drv_t *disp_drv, lv_color_t * dest, const lv_color_t * src, uint32_t length, lv_opa_t opa); -static void gpu_mem_fill(lv_disp_drv_t *disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width, const lv_area_t * fill_area, lv_color_t color); -#endif - +static void ex_disp_clean_dcache(lv_disp_drv_t *drv); + static uint8_t LCD_Init(void); static void LCD_LayerRgb565Init(uint32_t FB_Address); static void LCD_DisplayOn(void); - + static void DMA_Config(void); static void DMA_TransferComplete(DMA_HandleTypeDef *han); static void DMA_TransferError(DMA_HandleTypeDef *han); - -#if LV_USE_GPU -static void DMA2D_Config(void); -#endif - + /********************** * STATIC VARIABLES **********************/ -#if LV_USE_GPU -static DMA2D_HandleTypeDef Dma2dHandle; -#endif static LTDC_HandleTypeDef hLtdcHandler; - +static lv_disp_drv_t disp_drv; + #if LV_COLOR_DEPTH == 16 typedef uint16_t uintpixel_t; #elif LV_COLOR_DEPTH == 24 || LV_COLOR_DEPTH == 32 typedef uint32_t uintpixel_t; #endif - + /* You can try to change buffer to internal ram by uncommenting line below and commenting * SDRAM one. */ //static uintpixel_t my_fb[TFT_HOR_RES * TFT_VER_RES]; - -static __IO uintpixel_t * my_fb = (__IO uintpixel_t*) (SDRAM_DEVICE_ADDR); - + +static __IO uintpixel_t * my_fb = (__IO uintpixel_t*) (0x60000000); + static DMA_HandleTypeDef DmaHandle; static int32_t x1_flush; static int32_t y1_flush; @@ -109,108 +98,104 @@ static int32_t y2_fill; static int32_t y_fill_act; static const lv_color_t * buf_to_flush; -static lv_disp_drv_t disp_drv; - + static lv_disp_t *our_disp = NULL; /********************** * MACROS **********************/ - + /** * Initialize your display here */ - + void tft_init(void) { - /* There is only one display on STM32 */ - if(our_disp != NULL) - abort(); + /* There is only one display on STM32 */ + if(our_disp != NULL) + abort(); /* LCD Initialization */ LCD_Init(); - + /* LCD Initialization */ LCD_LayerRgb565Init((uint32_t)my_fb); - + /* Enable the LCD */ LCD_DisplayOn(); - + DMA_Config(); - -#if LV_USE_GPU != 0 - DMA2D_Config(); -#endif + /*----------------------------- - * Create a buffer for drawing - *----------------------------*/ - + * Create a buffer for drawing + *----------------------------*/ + /* LittlevGL requires a buffer where it draws the objects. The buffer's has to be greater than 1 display row*/ - - static lv_disp_draw_buf_t buf; - static lv_color_t buf1_1[TFT_HOR_RES * 68]; - static lv_color_t buf1_2[TFT_HOR_RES * 68]; - lv_disp_draw_buf_init(&buf, buf1_1, buf1_2, TFT_HOR_RES * 68); /*Initialize the display buffer*/ - - - /*----------------------------------- - * Register the display in LittlevGL - *----------------------------------*/ - - /*Descriptor of a display driver*/ - lv_disp_drv_init(&disp_drv); /*Basic initialization*/ - - /*Set up the functions to access to your display*/ - - /*Set the resolution of the display*/ - disp_drv.hor_res = TFT_HOR_RES; - disp_drv.ver_res = TFT_VER_RES; - - /*Used to copy the buffer's content to the display*/ - disp_drv.flush_cb = ex_disp_flush; - - /*Set a display buffer*/ - disp_drv.draw_buf = &buf; - - - /*Finally register the driver*/ - our_disp = lv_disp_drv_register(&disp_drv); + + static lv_disp_draw_buf_t disp_buf_1; + static lv_color_t buf1_1[TFT_HOR_RES * 68]; + static lv_color_t buf1_2[TFT_HOR_RES * 68]; + lv_disp_draw_buf_init(&disp_buf_1, buf1_1, buf1_2, TFT_HOR_RES * 68); /*Initialize the display buffer*/ + + + /*----------------------------------- + * Register the display in LittlevGL + *----------------------------------*/ + + lv_disp_drv_init(&disp_drv); /*Basic initialization*/ + + /*Set up the functions to access to your display*/ + + /*Set the resolution of the display*/ + disp_drv.hor_res = 480; + disp_drv.ver_res = 272; + + /*Used to copy the buffer's content to the display*/ + disp_drv.flush_cb = ex_disp_flush; + disp_drv.clean_dcache_cb = ex_disp_clean_dcache; + + /*Set a display buffer*/ + disp_drv.draw_buf = &disp_buf_1; + + + /*Finally register the driver*/ + our_disp = lv_disp_drv_register(&disp_drv); } - + /********************** * STATIC FUNCTIONS **********************/ - + /* Flush the content of the internal buffer the specific area on the display * You can use DMA or any hardware acceleration to do this operation in the background but * 'lv_flush_ready()' has to be called when finished * This function is required only when LV_VDB_SIZE != 0 in lv_conf.h*/ static void ex_disp_flush(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t * color_p) { - int32_t x1 = area->x1; - int32_t x2 = area->x2; - int32_t y1 = area->y1; - int32_t y2 = area->y2; + int32_t x1 = area->x1; + int32_t x2 = area->x2; + int32_t y1 = area->y1; + int32_t y2 = area->y2; /*Return if the area is out the screen*/ - + if(x2 < 0) return; if(y2 < 0) return; if(x1 > TFT_HOR_RES - 1) return; if(y1 > TFT_VER_RES - 1) return; - + /*Truncate the area to the screen*/ int32_t act_x1 = x1 < 0 ? 0 : x1; int32_t act_y1 = y1 < 0 ? 0 : y1; int32_t act_x2 = x2 > TFT_HOR_RES - 1 ? TFT_HOR_RES - 1 : x2; int32_t act_y2 = y2 > TFT_VER_RES - 1 ? TFT_VER_RES - 1 : y2; - + x1_flush = act_x1; y1_flush = act_y1; x2_flush = act_x2; y2_fill = act_y2; y_fill_act = act_y1; buf_to_flush = color_p; - - SCB_CleanInvalidateDCache(); - SCB_InvalidateICache(); + + SCB_CleanInvalidateDCache(); + SCB_InvalidateICache(); /*##-7- Start the DMA transfer using the interrupt mode #*/ /* Configure the source, destination and buffer size DMA fields and Start DMA Stream transfer */ /* Enable All the DMA interrupts */ @@ -223,23 +208,26 @@ length); if(err != HAL_OK) { - while(1); /*Halt on error*/ + while(1); /*Halt on error*/ } } - - + +static void ex_disp_clean_dcache(lv_disp_drv_t *drv) +{ + SCB_CleanInvalidateDCache(); +} + + /** * @brief Configure LCD pins, and peripheral clocks. */ static void LCD_MspInit(void) { GPIO_InitTypeDef gpio_init_structure; - + /* Enable the LTDC and DMA2D clocks */ __HAL_RCC_LTDC_CLK_ENABLE(); -#if LV_USE_GPU != 0 __HAL_RCC_DMA2D_CLK_ENABLE(); -#endif /* Enable GPIOs clock */ __HAL_RCC_GPIOE_CLK_ENABLE(); __HAL_RCC_GPIOG_CLK_ENABLE(); @@ -248,7 +236,7 @@ __HAL_RCC_GPIOK_CLK_ENABLE(); LCD_DISP_GPIO_CLK_ENABLE(); LCD_BL_CTRL_GPIO_CLK_ENABLE(); - + /*** LTDC Pins configuration ***/ /* GPIOE configuration */ gpio_init_structure.Pin = GPIO_PIN_4; @@ -257,20 +245,20 @@ gpio_init_structure.Speed = GPIO_SPEED_FAST; gpio_init_structure.Alternate = GPIO_AF14_LTDC; HAL_GPIO_Init(GPIOE, &gpio_init_structure); - + /* GPIOG configuration */ gpio_init_structure.Pin = GPIO_PIN_12; gpio_init_structure.Mode = GPIO_MODE_AF_PP; gpio_init_structure.Alternate = GPIO_AF9_LTDC; HAL_GPIO_Init(GPIOG, &gpio_init_structure); - + /* GPIOI LTDC alternate configuration */ gpio_init_structure.Pin = GPIO_PIN_9 | GPIO_PIN_10 | \ GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15; gpio_init_structure.Mode = GPIO_MODE_AF_PP; gpio_init_structure.Alternate = GPIO_AF14_LTDC; HAL_GPIO_Init(GPIOI, &gpio_init_structure); - + /* GPIOJ configuration */ gpio_init_structure.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | \ GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7 | \ @@ -279,32 +267,32 @@ gpio_init_structure.Mode = GPIO_MODE_AF_PP; gpio_init_structure.Alternate = GPIO_AF14_LTDC; HAL_GPIO_Init(GPIOJ, &gpio_init_structure); - + /* GPIOK configuration */ gpio_init_structure.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_4 | \ GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7; gpio_init_structure.Mode = GPIO_MODE_AF_PP; gpio_init_structure.Alternate = GPIO_AF14_LTDC; HAL_GPIO_Init(GPIOK, &gpio_init_structure); - + /* LCD_DISP GPIO configuration */ gpio_init_structure.Pin = LCD_DISP_PIN; /* LCD_DISP pin has to be manually controlled */ gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP; HAL_GPIO_Init(LCD_DISP_GPIO_PORT, &gpio_init_structure); - + /* LCD_BL_CTRL GPIO configuration */ gpio_init_structure.Pin = LCD_BL_CTRL_PIN; /* LCD_BL_CTRL pin has to be manually controlled */ gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP; HAL_GPIO_Init(LCD_BL_CTRL_GPIO_PORT, &gpio_init_structure); } - + /** * @brief Configure LTDC PLL. */ static void LCD_ClockConfig(void) { static RCC_PeriphCLKInitTypeDef periph_clk_init_struct; - + /* RK043FN48H LCD clock configuration */ /* PLLSAI_VCO Input = HSE_VALUE/PLL_M = 1 Mhz */ /* PLLSAI_VCO Output = PLLSAI_VCO Input * PLLSAIN = 192 Mhz */ @@ -316,7 +304,7 @@ periph_clk_init_struct.PLLSAIDivR = RCC_PLLSAIDIVR_4; HAL_RCCEx_PeriphCLKConfig(&periph_clk_init_struct); } - + /** * @brief Initializes the LCD. * @retval LCD state @@ -324,7 +312,7 @@ static uint8_t LCD_Init(void) { /* Select the used LCD */ - + /* The RK043FN48H LCD 480x272 is selected */ /* Timing Configuration */ hLtdcHandler.Init.HorizontalSync = (RK043FN48H_HSYNC - 1); @@ -335,60 +323,61 @@ hLtdcHandler.Init.AccumulatedActiveW = (RK043FN48H_WIDTH + RK043FN48H_HSYNC + RK043FN48H_HBP - 1); hLtdcHandler.Init.TotalHeigh = (RK043FN48H_HEIGHT + RK043FN48H_VSYNC + RK043FN48H_VBP + RK043FN48H_VFP - 1); hLtdcHandler.Init.TotalWidth = (RK043FN48H_WIDTH + RK043FN48H_HSYNC + RK043FN48H_HBP + RK043FN48H_HFP - 1); - + /* LCD clock configuration */ LCD_ClockConfig(); - + /* Initialize the LCD pixel width and pixel height */ hLtdcHandler.LayerCfg->ImageWidth = RK043FN48H_WIDTH; hLtdcHandler.LayerCfg->ImageHeight = RK043FN48H_HEIGHT; - + /* Background value */ hLtdcHandler.Init.Backcolor.Blue = 0; hLtdcHandler.Init.Backcolor.Green = 0; hLtdcHandler.Init.Backcolor.Red = 0; - + /* Polarity */ hLtdcHandler.Init.HSPolarity = LTDC_HSPOLARITY_AL; hLtdcHandler.Init.VSPolarity = LTDC_VSPOLARITY_AL; hLtdcHandler.Init.DEPolarity = LTDC_DEPOLARITY_AL; hLtdcHandler.Init.PCPolarity = LTDC_PCPOLARITY_IPC; hLtdcHandler.Instance = LTDC; - + if(HAL_LTDC_GetState(&hLtdcHandler) == HAL_LTDC_STATE_RESET) { /* Initialize the LCD Msp: this __weak function can be rewritten by the application */ LCD_MspInit(); } HAL_LTDC_Init(&hLtdcHandler); - + /* Assert display enable LCD_DISP pin */ HAL_GPIO_WritePin(LCD_DISP_GPIO_PORT, LCD_DISP_PIN, GPIO_PIN_SET); - + /* Assert backlight LCD_BL_CTRL pin */ HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, GPIO_PIN_SET); - + BSP_SDRAM_Init(); - + HAL_EnableFMCMemorySwapping(); + uint32_t i; for(i = 0; i < (TFT_HOR_RES * TFT_VER_RES) ; i++) { my_fb[i] = 0; } - + return LCD_OK; } - + static void LCD_LayerRgb565Init(uint32_t FB_Address) { LTDC_LayerCfgTypeDef layer_cfg; - + /* Layer Init */ layer_cfg.WindowX0 = 0; layer_cfg.WindowX1 = TFT_HOR_RES; layer_cfg.WindowY0 = 0; layer_cfg.WindowY1 = TFT_VER_RES; - + #if LV_COLOR_DEPTH == 16 layer_cfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565; #elif LV_COLOR_DEPTH == 24 || LV_COLOR_DEPTH == 32 @@ -406,10 +395,10 @@ layer_cfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_PAxCA; layer_cfg.ImageWidth = TFT_HOR_RES; layer_cfg.ImageHeight = TFT_VER_RES; - + HAL_LTDC_ConfigLayer(&hLtdcHandler, &layer_cfg, 0); } - + static void LCD_DisplayOn(void) { /* Display On */ @@ -417,12 +406,12 @@ HAL_GPIO_WritePin(LCD_DISP_GPIO_PORT, LCD_DISP_PIN, GPIO_PIN_SET); /* Assert LCD_DISP pin */ HAL_GPIO_WritePin(LCD_BL_CTRL_GPIO_PORT, LCD_BL_CTRL_PIN, GPIO_PIN_SET); /* Assert LCD_BL_CTRL pin */ } - + static void DMA_Config(void) { /*## -1- Enable DMA2 clock #################################################*/ __HAL_RCC_DMA2_CLK_ENABLE(); - + /*##-2- Select the DMA functional Parameters ###############################*/ DmaHandle.Init.Channel = CPY_BUF_DMA_CHANNEL; /* DMA_CHANNEL_0 */ DmaHandle.Init.Direction = DMA_MEMORY_TO_MEMORY; /* M2M transfer mode */ @@ -436,10 +425,10 @@ DmaHandle.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_1QUARTERFULL; /* FIFO threshold: 1/4 full */ DmaHandle.Init.MemBurst = DMA_MBURST_SINGLE; /* Memory burst */ DmaHandle.Init.PeriphBurst = DMA_PBURST_SINGLE; /* Peripheral burst */ - + /*##-3- Select the DMA instance to be used for the transfer : DMA2_Stream0 #*/ DmaHandle.Instance = CPY_BUF_DMA_STREAM; - + /*##-4- Initialize the DMA stream ##########################################*/ if(HAL_DMA_Init(&DmaHandle) != HAL_OK) { @@ -447,16 +436,16 @@ { } } - + /*##-5- Select Callbacks functions called after Transfer complete and Transfer error */ HAL_DMA_RegisterCallback(&DmaHandle, HAL_DMA_XFER_CPLT_CB_ID, DMA_TransferComplete); HAL_DMA_RegisterCallback(&DmaHandle, HAL_DMA_XFER_ERROR_CB_ID, DMA_TransferError); - + /*##-6- Configure NVIC for DMA transfer complete/error interrupts ##########*/ HAL_NVIC_SetPriority(CPY_BUF_DMA_STREAM_IRQ, 0, 0); HAL_NVIC_EnableIRQ(CPY_BUF_DMA_STREAM_IRQ); } - + /** * @brief DMA conversion complete callback * @note This function is executed when the transfer complete interrupt @@ -466,13 +455,13 @@ static void DMA_TransferComplete(DMA_HandleTypeDef *han) { y_fill_act ++; - + if(y_fill_act > y2_fill) { - SCB_CleanInvalidateDCache(); - SCB_InvalidateICache(); + SCB_CleanInvalidateDCache(); + SCB_InvalidateICache(); lv_disp_flush_ready(&disp_drv); } else { - uint32_t length = (x2_flush - x1_flush + 1); + uint32_t length = (x2_flush - x1_flush + 1); buf_to_flush += x2_flush - x1_flush + 1; /*##-7- Start the DMA transfer using the interrupt mode ####################*/ /* Configure the source, destination and buffer size DMA fields and Start DMA Stream transfer */ @@ -483,11 +472,11 @@ if(HAL_DMA_Start_IT(han,(uint32_t)buf_to_flush, (uint32_t)&my_fb[y_fill_act * TFT_HOR_RES + x1_flush], length) != HAL_OK) { - while(1); /*Halt on error*/ + while(1); /*Halt on error*/ } } } - + /** * @brief DMA conversion error callback * @note This function is executed when the transfer error interrupt @@ -496,9 +485,9 @@ */ static void DMA_TransferError(DMA_HandleTypeDef *han) { - + } - + /** * @brief This function handles DMA Stream interrupt request. * @param None @@ -508,101 +497,4 @@ { /* Check the interrupt and clear flag */ HAL_DMA_IRQHandler(&DmaHandle); -} - - -#if LV_USE_GPU != 0 - -static void Error_Handler(void) -{ - while(1) - { - } -} -/** - * @brief DMA2D Transfer completed callback - * @param hdma2d: DMA2D handle. - * @note This example shows a simple way to report end of DMA2D transfer, and - * you can add your own implementation. - * @retval None - */ -static void DMA2D_TransferComplete(DMA2D_HandleTypeDef *hdma2d) -{ - -} - -/** - * @brief DMA2D error callbacks - * @param hdma2d: DMA2D handle - * @note This example shows a simple way to report DMA2D transfer error, and you can - * add your own implementation. - * @retval None - */ -static void DMA2D_TransferError(DMA2D_HandleTypeDef *hdma2d) -{ - -} - -/** - * @brief DMA2D configuration. - * @note This function Configure the DMA2D peripheral : - * 1) Configure the Transfer mode as memory to memory with blending. - * 2) Configure the output color mode as RGB565 pixel format. - * 3) Configure the foreground - * - first image loaded from FLASH memory - * - constant alpha value (decreased to see the background) - * - color mode as RGB565 pixel format - * 4) Configure the background - * - second image loaded from FLASH memory - * - color mode as RGB565 pixel format - * @retval None - */ -static void DMA2D_Config(void) -{ - /* Configure the DMA2D Mode, Color Mode and output offset */ - Dma2dHandle.Init.Mode = DMA2D_M2M_BLEND; -#if LV_COLOR_DEPTH == 16 - Dma2dHandle.Init.ColorMode = DMA2D_RGB565; -#elif LV_COLOR_DEPTH == 24 || LV_COLOR_DEPTH == 32 - Dma2dHandle.Init.ColorMode = DMA2D_ARGB8888; -#endif - Dma2dHandle.Init.OutputOffset = 0x0; - - /* DMA2D Callbacks Configuration */ - Dma2dHandle.XferCpltCallback = DMA2D_TransferComplete; - Dma2dHandle.XferErrorCallback = DMA2D_TransferError; - - /* Foreground Configuration */ - Dma2dHandle.LayerCfg[1].AlphaMode = DMA2D_REPLACE_ALPHA; - Dma2dHandle.LayerCfg[1].InputAlpha = 0xFF; -#if LV_COLOR_DEPTH == 16 - Dma2dHandle.LayerCfg[1].InputColorMode = DMA2D_INPUT_RGB565; -#elif LV_COLOR_DEPTH == 24 || LV_COLOR_DEPTH == 32 - Dma2dHandle.LayerCfg[1].InputColorMode = DMA2D_INPUT_ARGB8888; -#endif - - Dma2dHandle.LayerCfg[1].InputOffset = 0x0; - - /* Background Configuration */ - Dma2dHandle.LayerCfg[0].AlphaMode = DMA2D_REPLACE_ALPHA; - Dma2dHandle.LayerCfg[0].InputAlpha = 0xFF; -#if LV_COLOR_DEPTH == 16 - Dma2dHandle.LayerCfg[0].InputColorMode = DMA2D_INPUT_RGB565; -#elif LV_COLOR_DEPTH == 24 || LV_COLOR_DEPTH == 32 - Dma2dHandle.LayerCfg[0].InputColorMode = DMA2D_INPUT_ARGB8888; -#endif - Dma2dHandle.LayerCfg[0].InputOffset = 0x0; - - Dma2dHandle.Instance = DMA2D; - - /* DMA2D Initialization */ - if(HAL_DMA2D_Init(&Dma2dHandle) != HAL_OK) - { - /* Initialization Error */ - Error_Handler(); - } - - HAL_DMA2D_ConfigLayer(&Dma2dHandle, 0); - HAL_DMA2D_ConfigLayer(&Dma2dHandle, 1); -} -#endif \ No newline at end of file +} \ No newline at end of file
diff -r 071136c3eefa -r 778736ecceb0 hal_stm_lvgl/tft/tft.h --- a/hal_stm_lvgl/tft/tft.h Tue Jun 15 19:35:57 2021 +0000 +++ b/hal_stm_lvgl/tft/tft.h Sat Feb 04 21:01:46 2023 +0000 @@ -2,11 +2,11 @@ * @file tft.h * */ - #ifdef __cplusplus extern "C" { #endif + #ifndef DISP_H #define DISP_H @@ -14,7 +14,8 @@ * INCLUDES *********************/ #include <stdint.h> -#include "lvgl/lvgl.h" +#include "lvgl/src/misc/lv_color.h" +#include "lvgl/src/misc/lv_area.h" /********************* * DEFINES
diff -r 071136c3eefa -r 778736ecceb0 hal_stm_lvgl/touchpad/touchpad.c --- a/hal_stm_lvgl/touchpad/touchpad.c Tue Jun 15 19:35:57 2021 +0000 +++ b/hal_stm_lvgl/touchpad/touchpad.c Sat Feb 04 21:01:46 2023 +0000 @@ -1,87 +1,86 @@ -/** - * @file indev.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "hal_stm_lvgl/tft/tft.h" -#include "lvgl/lvgl.h" - -#include "stm32f7xx.h" -#include "stm32746g_discovery.h" -#include "stm32746g_discovery_ts.h" - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void touchpad_read(lv_indev_drv_t *drv, lv_indev_data_t *data); - -/********************** - * STATIC VARIABLES - **********************/ -static TS_StateTypeDef TS_State; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -/** - * Initialize your input devices here - */ -void touchpad_init(void) -{ - BSP_TS_Init(TFT_HOR_RES, TFT_VER_RES); - - static lv_indev_drv_t indev_drv; /*Descriptor of an input device driver*/ - lv_indev_drv_init(&indev_drv); /*Basic initialization*/ - indev_drv.type = LV_INDEV_TYPE_POINTER; /*The touchpad is pointer type device*/ - indev_drv.read_cb = touchpad_read; - - lv_indev_drv_register(&indev_drv); -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -/** - * Read an input device - * @param indev_id id of the input device to read - * @param x put the x coordinate here - * @param y put the y coordinate here - * @return true: the device is pressed, false: released - */ -static void touchpad_read(lv_indev_drv_t *indev, lv_indev_data_t *data) -{ - /* Read your touchpad */ - static int16_t last_x = 0; - static int16_t last_y = 0; - //BSP_LED_Toggle(LED1); - - BSP_TS_GetState(&TS_State); - if(TS_State.touchDetected) { - data->point.x = TS_State.touchX[0]; - data->point.y = TS_State.touchY[0]; - last_x = data->point.x; - last_y = data->point.y; - data->state = LV_INDEV_STATE_PR; - } else { - data->point.x = last_x; - data->point.y = last_y; - data->state = LV_INDEV_STATE_REL; - } -} +/** + * @file indev.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "hal_stm_lvgl/tft/tft.h" +#include "lvgl/src/hal/lv_hal.h" + +#include "stm32746g_discovery.h" +#include "stm32746g_discovery_ts.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ +static void touchpad_read(lv_indev_drv_t *drv, lv_indev_data_t *data); + +/********************** + * STATIC VARIABLES + **********************/ +static TS_StateTypeDef TS_State; + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ + +/** + * Initialize your input devices here + */ +void touchpad_init(void) +{ + BSP_TS_Init(TFT_HOR_RES, TFT_VER_RES); + + static lv_indev_drv_t indev_drv; /*Descriptor of an input device driver*/ + lv_indev_drv_init(&indev_drv); /*Basic initialization*/ + indev_drv.type = LV_INDEV_TYPE_POINTER; /*The touchpad is pointer type device*/ + indev_drv.read_cb = touchpad_read; + + lv_indev_drv_register(&indev_drv); +} + +/********************** + * STATIC FUNCTIONS + **********************/ + +/** + * Read an input device + * @param indev_id id of the input device to read + * @param x put the x coordinate here + * @param y put the y coordinate here + * @return true: the device is pressed, false: released + */ +static void touchpad_read(lv_indev_drv_t *indev, lv_indev_data_t *data) +{ + /* Read your touchpad */ + static int16_t last_x = 0; + static int16_t last_y = 0; + //BSP_LED_Toggle(LED1); + + BSP_TS_GetState(&TS_State); + if(TS_State.touchDetected) { + data->point.x = TS_State.touchX[0]; + data->point.y = TS_State.touchY[0]; + last_x = data->point.x; + last_y = data->point.y; + data->state = LV_INDEV_STATE_PRESSED; + } else { + data->point.x = last_x; + data->point.y = last_y; + data->state = LV_INDEV_STATE_RELEASED; + } +} \ No newline at end of file
diff -r 071136c3eefa -r 778736ecceb0 lv_conf.h --- a/lv_conf.h Tue Jun 15 19:35:57 2021 +0000 +++ b/lv_conf.h Sat Feb 04 21:01:46 2023 +0000 @@ -1,82 +1,99 @@ /** * @file lv_conf.h - * Configuration file for v8.0.0 + * Configuration file for v8.3.4 */ /* - * COPY THIS FILE AS `lv_conf.h` NEXT TO the `lvgl` FOLDER + * Copy this file as `lv_conf.h` + * 1. simply next to the `lvgl` folder + * 2. or any other places and + * - define `LV_CONF_INCLUDE_SIMPLE` + * - add the path as include path */ +/* clang-format off */ #if 1 /*Set it to "1" to enable content*/ #ifndef LV_CONF_H #define LV_CONF_H -/*clang-format off*/ #include <stdint.h> - /*==================== COLOR SETTINGS *====================*/ /*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ -#define LV_COLOR_DEPTH 16 +#define LV_COLOR_DEPTH 16 -/*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ -#define LV_COLOR_16_SWAP 0 +/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/ +#define LV_COLOR_16_SWAP 0 -/*Enable more complex drawing routines to manage screens transparency. - *Can be used if the UI is above an other layer, e.g. an OSD menu or video player. - *Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to non LV_OPA_COVER value*/ -#define LV_COLOR_SCREEN_TRANSP 0 +/*Enable features to draw on transparent background. + *It's required if opa, and transform_* style properties are used. + *Can be also used if the UI is above another layer, e.g. an OSD menu or video player.*/ +#define LV_COLOR_SCREEN_TRANSP 0 -/*Images pixels with this color will not be drawn if they are chroma keyed)*/ -#define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/ +/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. + * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ +#define LV_COLOR_MIX_ROUND_OFS 0 + +/*Images pixels with this color will not be drawn if they are chroma keyed)*/ +#define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/ /*========================= MEMORY SETTINGS *=========================*/ /*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/ -#define LV_MEM_CUSTOM 0 +#define LV_MEM_CUSTOM 0 #if LV_MEM_CUSTOM == 0 -/*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ -# define LV_MEM_SIZE (32U * 1024U) /*[bytes]*/ + /*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ + #define LV_MEM_SIZE (48U * 1024U) /*[bytes]*/ -/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ -# define LV_MEM_ADR 0 /*0: unused*/ + /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ + #define LV_MEM_ADR 0 /*0: unused*/ + /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/ + #if LV_MEM_ADR == 0 + #undef LV_MEM_POOL_INCLUDE + #undef LV_MEM_POOL_ALLOC + #endif + #else /*LV_MEM_CUSTOM*/ -# define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/ -# define LV_MEM_CUSTOM_ALLOC malloc -# define LV_MEM_CUSTOM_FREE free -# define LV_MEM_CUSTOM_REALLOC realloc + #define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/ + #define LV_MEM_CUSTOM_ALLOC malloc + #define LV_MEM_CUSTOM_FREE free + #define LV_MEM_CUSTOM_REALLOC realloc #endif /*LV_MEM_CUSTOM*/ +/*Number of the intermediate memory buffer used during rendering and other internal processing mechanisms. + *You will see an error log message if there wasn't enough buffers. */ +#define LV_MEM_BUF_MAX_NUM 16 + /*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/ -#define LV_MEMCPY_MEMSET_STD 0 +#define LV_MEMCPY_MEMSET_STD 0 /*==================== HAL SETTINGS *====================*/ -/*Default display refresh period. LVG will redraw changed ares with this period time*/ -#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/ +/*Default display refresh period. LVG will redraw changed areas with this period time*/ +#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/ /*Input device read period in milliseconds*/ -#define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/ +#define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/ /*Use a custom tick source that tells the elapsed time in milliseconds. *It removes the need to manually update the tick with `lv_tick_inc()`)*/ -#define LV_TICK_CUSTOM 0 +#define LV_TICK_CUSTOM 0 #if LV_TICK_CUSTOM -#define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/ -#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ + #define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/ + #define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ #endif /*LV_TICK_CUSTOM*/ /*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. *(Not so important, you can adjust it to modify default sizes and spaces)*/ -#define LV_DPI_DEF 130 /*[px/inch]*/ +#define LV_DPI_DEF 130 /*[px/inch]*/ /*======================= * FEATURE CONFIGURATION @@ -91,77 +108,142 @@ #define LV_DRAW_COMPLEX 1 #if LV_DRAW_COMPLEX != 0 -/*Allow buffering some shadow calculation. - *LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` - *Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/ -#define LV_SHADOW_CACHE_SIZE 0 + /*Allow buffering some shadow calculation. + *LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` + *Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/ + #define LV_SHADOW_CACHE_SIZE 0 + + /* Set number of maximally cached circle data. + * The circumference of 1/4 circle are saved for anti-aliasing + * radius * 4 bytes are used per circle (the most often used radiuses are saved) + * 0: to disable caching */ + #define LV_CIRCLE_CACHE_SIZE 4 #endif /*LV_DRAW_COMPLEX*/ +/** + * "Simple layers" are used when a widget has `style_opa < 255` to buffer the widget into a layer + * and blend it as an image with the given opacity. + * Note that `bg_opa`, `text_opa` etc don't require buffering into layer) + * The widget can be buffered in smaller chunks to avoid using large buffers. + * + * - LV_LAYER_SIMPLE_BUF_SIZE: [bytes] the optimal target buffer size. LVGL will try to allocate it + * - LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE: [bytes] used if `LV_LAYER_SIMPLE_BUF_SIZE` couldn't be allocated. + * + * Both buffer sizes are in bytes. + * "Transformed layers" (where transform_angle/zoom properties are used) use larger buffers + * and can't be drawn in chunks. So these settings affects only widgets with opacity. + */ +#define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024) +#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE (3 * 1024) + /*Default image cache size. Image caching keeps the images opened. *If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added) *With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. *However the opened images might consume additional RAM. *0: to disable caching*/ -#define LV_IMG_CACHE_DEF_SIZE 0 +#define LV_IMG_CACHE_DEF_SIZE 0 + +/*Number of stops allowed per gradient. Increase this to allow more stops. + *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ +#define LV_GRADIENT_MAX_STOPS 2 + +/*Default gradient buffer size. + *When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again. + *LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes. + *If the cache is too small the map will be allocated only while it's required for the drawing. + *0 mean no caching.*/ +#define LV_GRAD_CACHE_DEF_SIZE 0 -/*Maximum buffer size to allocate for rotation. Only used if software rotation is enabled in the display driver.*/ -#define LV_DISP_ROT_MAX_BUF (10*1024) +/*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display) + *LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface + *The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */ +#define LV_DITHER_GRADIENT 0 +#if LV_DITHER_GRADIENT + /*Add support for error diffusion dithering. + *Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing. + *The increase in memory consumption is (24 bits * object's width)*/ + #define LV_DITHER_ERROR_DIFFUSION 0 +#endif + +/*Maximum buffer size to allocate for rotation. + *Only used if software rotation is enabled in the display driver.*/ +#define LV_DISP_ROT_MAX_BUF (10*1024) + /*------------- * GPU *-----------*/ +/*Use Arm's 2D acceleration library Arm-2D */ +#define LV_USE_GPU_ARM2D 0 + /*Use STM32's DMA2D (aka Chrom Art) GPU*/ -#define LV_USE_GPU_STM32_DMA2D 0 +#define LV_USE_GPU_STM32_DMA2D 0 #if LV_USE_GPU_STM32_DMA2D -/*Must be defined to include path of CMSIS header of target processor -e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ -#define LV_GPU_DMA2D_CMSIS_INCLUDE "stm32f746xx.h" + /*Must be defined to include path of CMSIS header of target processor + e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ + #define LV_GPU_DMA2D_CMSIS_INCLUDE +#endif + +/*Use SWM341's DMA2D GPU*/ +#define LV_USE_GPU_SWM341_DMA2D 0 +#if LV_USE_GPU_SWM341_DMA2D + #define LV_GPU_SWM341_DMA2D_INCLUDE "SWM341.h" #endif /*Use NXP's PXP GPU iMX RTxxx platforms*/ -#define LV_USE_GPU_NXP_PXP 0 +#define LV_USE_GPU_NXP_PXP 0 #if LV_USE_GPU_NXP_PXP -/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) - * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol FSL_RTOS_FREE_RTOS - * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected. - *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() - */ -#define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 + /*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) + * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol SDK_OS_FREE_RTOS + * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected. + *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() + */ + #define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 #endif /*Use NXP's VG-Lite GPU iMX RTxxx platforms*/ -#define LV_USE_GPU_NXP_VG_LITE 0 +#define LV_USE_GPU_NXP_VG_LITE 0 + +/*Use SDL renderer API*/ +#define LV_USE_GPU_SDL 0 +#if LV_USE_GPU_SDL + #define LV_GPU_SDL_INCLUDE_PATH <SDL2/SDL.h> + /*Texture cache size, 8MB by default*/ + #define LV_GPU_SDL_LRU_SIZE (1024 * 1024 * 8) + /*Custom blend mode for mask drawing, disable if you need to link with older SDL2 lib*/ + #define LV_GPU_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6)) +#endif /*------------- * Logging *-----------*/ /*Enable the log module*/ -#define LV_USE_LOG 0 +#define LV_USE_LOG 0 #if LV_USE_LOG -/*How important log should be added: - *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information - *LV_LOG_LEVEL_INFO Log important events - *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem - *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail - *LV_LOG_LEVEL_USER Only logs added by the user - *LV_LOG_LEVEL_NONE Do not log anything*/ -# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN + /*How important log should be added: + *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information + *LV_LOG_LEVEL_INFO Log important events + *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem + *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail + *LV_LOG_LEVEL_USER Only logs added by the user + *LV_LOG_LEVEL_NONE Do not log anything*/ + #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN -/*1: Print the log with 'printf'; - *0: User need to register a callback with `lv_log_register_print_cb()`*/ -# define LV_LOG_PRINTF 0 + /*1: Print the log with 'printf'; + *0: User need to register a callback with `lv_log_register_print_cb()`*/ + #define LV_LOG_PRINTF 0 -/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ -# define LV_LOG_TRACE_MEM 1 -# define LV_LOG_TRACE_TIMER 1 -# define LV_LOG_TRACE_INDEV 1 -# define LV_LOG_TRACE_DISP_REFR 1 -# define LV_LOG_TRACE_EVENT 1 -# define LV_LOG_TRACE_OBJ_CREATE 1 -# define LV_LOG_TRACE_LAYOUT 1 -# define LV_LOG_TRACE_ANIM 1 + /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ + #define LV_LOG_TRACE_MEM 1 + #define LV_LOG_TRACE_TIMER 1 + #define LV_LOG_TRACE_INDEV 1 + #define LV_LOG_TRACE_DISP_REFR 1 + #define LV_LOG_TRACE_EVENT 1 + #define LV_LOG_TRACE_OBJ_CREATE 1 + #define LV_LOG_TRACE_LAYOUT 1 + #define LV_LOG_TRACE_ANIM 1 #endif /*LV_USE_LOG*/ @@ -178,40 +260,46 @@ #define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ /*Add a custom handler when assert happens e.g. to restart the MCU*/ -#define LV_ASSERT_HANDLER_INCLUDE <stdint.h> -#define LV_ASSERT_HANDLER while(1); /*Halt by default*/ +#define LV_ASSERT_HANDLER_INCLUDE <stdint.h> +#define LV_ASSERT_HANDLER while(1); /*Halt by default*/ /*------------- * Others *-----------*/ -/*1: Show CPU usage and FPS count in the right bottom corner*/ -#define LV_USE_PERF_MONITOR 1 +/*1: Show CPU usage and FPS count*/ +#define LV_USE_PERF_MONITOR 0 +#if LV_USE_PERF_MONITOR + #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT +#endif -/*1: Show the used memory and the memory fragmentation in the left bottom corner +/*1: Show the used memory and the memory fragmentation * Requires LV_MEM_CUSTOM = 0*/ -#define LV_USE_MEM_MONITOR 0 +#define LV_USE_MEM_MONITOR 0 +#if LV_USE_MEM_MONITOR + #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT +#endif /*1: Draw random colored rectangles over the redrawn areas*/ -#define LV_USE_REFR_DEBUG 0 +#define LV_USE_REFR_DEBUG 0 /*Change the built in (v)snprintf functions*/ -#define LV_SPRINTF_CUSTOM 0 +#define LV_SPRINTF_CUSTOM 0 #if LV_SPRINTF_CUSTOM -# define LV_SPRINTF_INCLUDE <stdio.h> -# define lv_snprintf snprintf -# define lv_vsnprintf vsnprintf + #define LV_SPRINTF_INCLUDE <stdio.h> + #define lv_snprintf snprintf + #define lv_vsnprintf vsnprintf #else /*LV_SPRINTF_CUSTOM*/ -# define LV_SPRINTF_USE_FLOAT 0 + #define LV_SPRINTF_USE_FLOAT 0 #endif /*LV_SPRINTF_CUSTOM*/ -#define LV_USE_USER_DATA 1 +#define LV_USE_USER_DATA 1 /*Garbage Collector settings - *Used if lvgl is binded to higher level language and the memory is managed by that language*/ + *Used if lvgl is bound to higher level language and the memory is managed by that language*/ #define LV_ENABLE_GC 0 #if LV_ENABLE_GC != 0 -# define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ + #define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ #endif /*LV_ENABLE_GC*/ /*===================== @@ -219,7 +307,7 @@ *====================*/ /*For big endian systems set to 1*/ -#define LV_BIG_ENDIAN_SYSTEM 0 +#define LV_BIG_ENDIAN_SYSTEM 0 /*Define a custom attribute to `lv_tick_inc` function*/ #define LV_ATTRIBUTE_TICK_INC @@ -231,7 +319,7 @@ #define LV_ATTRIBUTE_FLUSH_READY /*Required alignment size for buffers*/ -#define LV_ATTRIBUTE_MEM_ALIGN_SIZE +#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 /*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). * E.g. __attribute__((aligned(4)))*/ @@ -240,7 +328,7 @@ /*Attribute to mark large constant arrays for example font's bitmaps*/ #define LV_ATTRIBUTE_LARGE_CONST -/*Complier prefix for a big array declaration in RAM*/ +/*Compiler prefix for a big array declaration in RAM*/ #define LV_ATTRIBUTE_LARGE_RAM_ARRAY /*Place performance critical functions into a faster memory (e.g RAM)*/ @@ -254,7 +342,7 @@ #define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ /*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/ -#define LV_USE_LARGE_COORD 0 +#define LV_USE_LARGE_COORD 0 /*================== * FONT USAGE @@ -262,37 +350,37 @@ /*Montserrat fonts with ASCII range and some symbols using bpp = 4 *https://fonts.google.com/specimen/Montserrat*/ -#define LV_FONT_MONTSERRAT_8 0 -#define LV_FONT_MONTSERRAT_10 0 -#define LV_FONT_MONTSERRAT_12 0 -#define LV_FONT_MONTSERRAT_14 1 -#define LV_FONT_MONTSERRAT_16 0 -#define LV_FONT_MONTSERRAT_18 0 -#define LV_FONT_MONTSERRAT_20 0 -#define LV_FONT_MONTSERRAT_22 0 -#define LV_FONT_MONTSERRAT_24 0 -#define LV_FONT_MONTSERRAT_26 0 -#define LV_FONT_MONTSERRAT_28 0 -#define LV_FONT_MONTSERRAT_30 0 -#define LV_FONT_MONTSERRAT_32 0 -#define LV_FONT_MONTSERRAT_34 0 -#define LV_FONT_MONTSERRAT_36 0 -#define LV_FONT_MONTSERRAT_38 0 -#define LV_FONT_MONTSERRAT_40 0 -#define LV_FONT_MONTSERRAT_42 0 -#define LV_FONT_MONTSERRAT_44 0 -#define LV_FONT_MONTSERRAT_46 0 -#define LV_FONT_MONTSERRAT_48 0 +#define LV_FONT_MONTSERRAT_8 0 +#define LV_FONT_MONTSERRAT_10 0 +#define LV_FONT_MONTSERRAT_12 0 +#define LV_FONT_MONTSERRAT_14 1 +#define LV_FONT_MONTSERRAT_16 0 +#define LV_FONT_MONTSERRAT_18 0 +#define LV_FONT_MONTSERRAT_20 0 +#define LV_FONT_MONTSERRAT_22 0 +#define LV_FONT_MONTSERRAT_24 0 +#define LV_FONT_MONTSERRAT_26 0 +#define LV_FONT_MONTSERRAT_28 0 +#define LV_FONT_MONTSERRAT_30 0 +#define LV_FONT_MONTSERRAT_32 0 +#define LV_FONT_MONTSERRAT_34 0 +#define LV_FONT_MONTSERRAT_36 0 +#define LV_FONT_MONTSERRAT_38 0 +#define LV_FONT_MONTSERRAT_40 0 +#define LV_FONT_MONTSERRAT_42 0 +#define LV_FONT_MONTSERRAT_44 0 +#define LV_FONT_MONTSERRAT_46 0 +#define LV_FONT_MONTSERRAT_48 0 /*Demonstrate special features*/ #define LV_FONT_MONTSERRAT_12_SUBPX 0 #define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/ -#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Perisan letters and all their forms*/ +#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/ #define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/ /*Pixel perfect monospace fonts*/ -#define LV_FONT_UNSCII_8 0 -#define LV_FONT_UNSCII_16 0 +#define LV_FONT_UNSCII_8 0 +#define LV_FONT_UNSCII_16 0 /*Optionally declare custom fonts here. *You can use these fonts as default font too and they will be available globally. @@ -305,18 +393,21 @@ /*Enable handling large font and/or fonts with a lot of characters. *The limit depends on the font size, font face and bpp. *Compiler error will be triggered if a font needs it.*/ -#define LV_FONT_FMT_TXT_LARGE 0 +#define LV_FONT_FMT_TXT_LARGE 0 /*Enables/disables support for compressed fonts.*/ -#define LV_USE_FONT_COMPRESSED 0 +#define LV_USE_FONT_COMPRESSED 0 /*Enable subpixel rendering*/ -#define LV_USE_FONT_SUBPX 0 +#define LV_USE_FONT_SUBPX 0 #if LV_USE_FONT_SUBPX -/*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ -#define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/ + /*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ + #define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/ #endif +/*Enable drawing placeholders when glyph dsc is not found*/ +#define LV_USE_FONT_PLACEHOLDER 1 + /*================= * TEXT SETTINGS *=================*/ @@ -329,16 +420,16 @@ */ #define LV_TXT_ENC LV_TXT_ENC_UTF8 - /*Can break (wrap) texts on these chars*/ -#define LV_TXT_BREAK_CHARS " ,.;:-_" +/*Can break (wrap) texts on these chars*/ +#define LV_TXT_BREAK_CHARS " ,.;:-_" /*If a word is at least this long, will break wherever "prettiest" *To disable, set to a value <= 0*/ -#define LV_TXT_LINE_BREAK_LONG_LEN 0 +#define LV_TXT_LINE_BREAK_LONG_LEN 0 /*Minimum number of characters in a long word to put on a line before a break. *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ -#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 +#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 /*Minimum number of characters in a long word to put on a line after a break. *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ @@ -348,15 +439,15 @@ #define LV_TXT_COLOR_CMD "#" /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. - *The direction will be processed according to the Unicode Bidirectioanl Algorithm: + *The direction will be processed according to the Unicode Bidirectional Algorithm: *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ -#define LV_USE_BIDI 0 +#define LV_USE_BIDI 0 #if LV_USE_BIDI -/*Set the default direction. Supported values: - *`LV_BASE_DIR_LTR` Left-to-Right - *`LV_BASE_DIR_RTL` Right-to-Left - *`LV_BASE_DIR_AUTO` detect texts base direction*/ -#define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO + /*Set the default direction. Supported values: + *`LV_BASE_DIR_LTR` Left-to-Right + *`LV_BASE_DIR_RTL` Right-to-Left + *`LV_BASE_DIR_AUTO` detect texts base direction*/ + #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO #endif /*Enable Arabic/Persian processing @@ -369,48 +460,45 @@ /*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ -#define LV_USE_ARC 1 +#define LV_USE_ARC 1 -#define LV_USE_ANIMIMG 1 - -#define LV_USE_BAR 1 +#define LV_USE_BAR 1 -#define LV_USE_BTN 1 +#define LV_USE_BTN 1 -#define LV_USE_BTNMATRIX 1 +#define LV_USE_BTNMATRIX 1 -#define LV_USE_CANVAS 1 +#define LV_USE_CANVAS 1 -#define LV_USE_CHECKBOX 1 +#define LV_USE_CHECKBOX 1 - -#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ +#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ -#define LV_USE_IMG 1 /*Requires: lv_label*/ +#define LV_USE_IMG 1 /*Requires: lv_label*/ -#define LV_USE_LABEL 1 +#define LV_USE_LABEL 1 #if LV_USE_LABEL -# define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ -# define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ + #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ + #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ #endif -#define LV_USE_LINE 1 +#define LV_USE_LINE 1 -#define LV_USE_ROLLER 1 /*Requires: lv_label*/ +#define LV_USE_ROLLER 1 /*Requires: lv_label*/ #if LV_USE_ROLLER -# define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/ + #define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/ #endif -#define LV_USE_SLIDER 1 /*Requires: lv_bar*/ +#define LV_USE_SLIDER 1 /*Requires: lv_bar*/ -#define LV_USE_SWITCH 1 +#define LV_USE_SWITCH 1 -#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ +#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ #if LV_USE_TEXTAREA != 0 -# define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ + #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ #endif -#define LV_USE_TABLE 1 +#define LV_USE_TABLE 1 /*================== * EXTRA COMPONENTS @@ -419,94 +507,253 @@ /*----------- * Widgets *----------*/ -#define LV_USE_CALENDAR 1 +#define LV_USE_ANIMIMG 1 + +#define LV_USE_CALENDAR 1 #if LV_USE_CALENDAR -# define LV_CALENDAR_WEEK_STARTS_MONDAY 0 -# if LV_CALENDAR_WEEK_STARTS_MONDAY -# define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} -# else -# define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} -# endif + #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 + #if LV_CALENDAR_WEEK_STARTS_MONDAY + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} + #else + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} + #endif -# define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} -# define LV_USE_CALENDAR_HEADER_ARROW 1 -# define LV_USE_CALENDAR_HEADER_DROPDOWN 1 + #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} + #define LV_USE_CALENDAR_HEADER_ARROW 1 + #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 #endif /*LV_USE_CALENDAR*/ -#define LV_USE_CHART 1 +#define LV_USE_CHART 1 -#define LV_USE_COLORWHEEL 1 +#define LV_USE_COLORWHEEL 1 -#define LV_USE_IMGBTN 1 +#define LV_USE_IMGBTN 1 -#define LV_USE_KEYBOARD 1 +#define LV_USE_KEYBOARD 1 -#define LV_USE_LED 1 +#define LV_USE_LED 1 -#define LV_USE_LIST 1 +#define LV_USE_LIST 1 -#define LV_USE_METER 1 +#define LV_USE_MENU 1 -#define LV_USE_MSGBOX 1 +#define LV_USE_METER 1 -#define LV_USE_SPINBOX 1 - -#define LV_USE_SPINNER 1 +#define LV_USE_MSGBOX 1 -#define LV_USE_TABVIEW 1 - -#define LV_USE_TILEVIEW 1 +#define LV_USE_SPAN 1 +#if LV_USE_SPAN + /*A line text can contain maximum num of span descriptor */ + #define LV_SPAN_SNIPPET_STACK_SIZE 64 +#endif -#define LV_USE_WIN 1 +#define LV_USE_SPINBOX 1 + +#define LV_USE_SPINNER 1 -#define LV_USE_SPAN 1 -#if LV_USE_SPAN -/*A line text can contain maximum num of span descriptor */ -# define LV_SPAN_SNIPPET_STACK_SIZE 64 -#endif +#define LV_USE_TABVIEW 1 + +#define LV_USE_TILEVIEW 1 + +#define LV_USE_WIN 1 /*----------- * Themes *----------*/ + /*A simple, impressive and very complete theme*/ -#define LV_USE_THEME_DEFAULT 1 +#define LV_USE_THEME_DEFAULT 1 #if LV_USE_THEME_DEFAULT -/*0: Light mode; 1: Dark mode*/ -# define LV_THEME_DEFAULT_DARK 0 + /*0: Light mode; 1: Dark mode*/ + #define LV_THEME_DEFAULT_DARK 0 -/*1: Enable grow on press*/ -# define LV_THEME_DEFAULT_GROW 1 + /*1: Enable grow on press*/ + #define LV_THEME_DEFAULT_GROW 1 -/*Default transition time in [ms]*/ -# define LV_THEME_DEFAULT_TRANSITON_TIME 80 + /*Default transition time in [ms]*/ + #define LV_THEME_DEFAULT_TRANSITION_TIME 80 #endif /*LV_USE_THEME_DEFAULT*/ -/*An very simple them that is a good starting point for a custom theme*/ - #define LV_USE_THEME_BASIC 1 +/*A very simple theme that is a good starting point for a custom theme*/ +#define LV_USE_THEME_BASIC 1 /*A theme designed for monochrome displays*/ -#define LV_USE_THEME_MONO 1 +#define LV_USE_THEME_MONO 1 /*----------- * Layouts *----------*/ /*A layout similar to Flexbox in CSS.*/ -#define LV_USE_FLEX 1 +#define LV_USE_FLEX 1 /*A layout similar to Grid in CSS.*/ -#define LV_USE_GRID 1 +#define LV_USE_GRID 1 + +/*--------------------- + * 3rd party libraries + *--------------------*/ + +/*File system interfaces for common APIs */ + +/*API for fopen, fread, etc*/ +#define LV_USE_FS_STDIO 0 +#if LV_USE_FS_STDIO + #define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for open, read, etc*/ +#define LV_USE_FS_POSIX 0 +#if LV_USE_FS_POSIX + #define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for CreateFile, ReadFile, etc*/ +#define LV_USE_FS_WIN32 0 +#if LV_USE_FS_WIN32 + #define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/ +#define LV_USE_FS_FATFS 0 +#if LV_USE_FS_FATFS + #define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*PNG decoder library*/ +#define LV_USE_PNG 0 + +/*BMP decoder library*/ +#define LV_USE_BMP 0 + +/* JPG + split JPG decoder library. + * Split JPG is a custom format optimized for embedded systems. */ +#define LV_USE_SJPG 0 + +/*GIF decoder library*/ +#define LV_USE_GIF 0 + +/*QR code library*/ +#define LV_USE_QRCODE 0 + +/*FreeType library*/ +#define LV_USE_FREETYPE 0 +#if LV_USE_FREETYPE + /*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/ + #define LV_FREETYPE_CACHE_SIZE (16 * 1024) + #if LV_FREETYPE_CACHE_SIZE >= 0 + /* 1: bitmap cache use the sbit cache, 0:bitmap cache use the image cache. */ + /* sbit cache:it is much more memory efficient for small bitmaps(font size < 256) */ + /* if font size >= 256, must be configured as image cache */ + #define LV_FREETYPE_SBIT_CACHE 0 + /* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */ + /* (0:use system defaults) */ + #define LV_FREETYPE_CACHE_FT_FACES 0 + #define LV_FREETYPE_CACHE_FT_SIZES 0 + #endif +#endif + +/*Rlottie library*/ +#define LV_USE_RLOTTIE 0 + +/*FFmpeg library for image decoding and playing videos + *Supports all major image formats so do not enable other image decoder with it*/ +#define LV_USE_FFMPEG 0 +#if LV_USE_FFMPEG + /*Dump input information to stderr*/ + #define LV_FFMPEG_DUMP_FORMAT 0 +#endif + +/*----------- + * Others + *----------*/ + +/*1: Enable API to take snapshot for object*/ +#define LV_USE_SNAPSHOT 0 + +/*1: Enable Monkey test*/ +#define LV_USE_MONKEY 0 + +/*1: Enable grid navigation*/ +#define LV_USE_GRIDNAV 0 + +/*1: Enable lv_obj fragment*/ +#define LV_USE_FRAGMENT 0 + +/*1: Support using images as font in label or span widgets */ +#define LV_USE_IMGFONT 0 + +/*1: Enable a published subscriber based messaging system */ +#define LV_USE_MSG 0 + +/*1: Enable Pinyin input method*/ +/*Requires: lv_keyboard*/ +#define LV_USE_IME_PINYIN 0 +#if LV_USE_IME_PINYIN + /*1: Use default thesaurus*/ + /*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/ + #define LV_IME_PINYIN_USE_DEFAULT_DICT 1 + /*Set the maximum number of candidate panels that can be displayed*/ + /*This needs to be adjusted according to the size of the screen*/ + #define LV_IME_PINYIN_CAND_TEXT_NUM 6 + + /*Use 9 key input(k9)*/ + #define LV_IME_PINYIN_USE_K9_MODE 1 + #if LV_IME_PINYIN_USE_K9_MODE == 1 + #define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3 + #endif // LV_IME_PINYIN_USE_K9_MODE +#endif /*================== * EXAMPLES *==================*/ /*Enable the examples to be built with the library*/ -#define LV_BUILD_EXAMPLES 1 +#define LV_BUILD_EXAMPLES 1 + +/*=================== + * DEMO USAGE + ====================*/ + +/*Show some widget. It might be required to increase `LV_MEM_SIZE` */ +#define LV_USE_DEMO_WIDGETS 1 +#if LV_USE_DEMO_WIDGETS +#define LV_DEMO_WIDGETS_SLIDESHOW 0 +#endif + +/*Demonstrate the usage of encoder and keyboard*/ +#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0 + +/*Benchmark your system*/ +#define LV_USE_DEMO_BENCHMARK 0 +#if LV_USE_DEMO_BENCHMARK +/*Use RGB565A8 images with 16 bit color depth instead of ARGB8565*/ +#define LV_DEMO_BENCHMARK_RGB565A8 0 +#endif + +/*Stress test for LVGL*/ +#define LV_USE_DEMO_STRESS 0 + +/*Music player demo*/ +#define LV_USE_DEMO_MUSIC 0 +#if LV_USE_DEMO_MUSIC + #define LV_DEMO_MUSIC_SQUARE 0 + #define LV_DEMO_MUSIC_LANDSCAPE 0 + #define LV_DEMO_MUSIC_ROUND 0 + #define LV_DEMO_MUSIC_LARGE 0 + #define LV_DEMO_MUSIC_AUTO_PLAY 0 +#endif /*--END OF LV_CONF_H--*/ #endif /*LV_CONF_H*/ -#endif /*End of "Content enable"*/ \ No newline at end of file +#endif /*End of "Content enable"*/
diff -r 071136c3eefa -r 778736ecceb0 lv_demo_conf.h --- a/lv_demo_conf.h Tue Jun 15 19:35:57 2021 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/** - * @file lv_demo_conf.h - * Configuration file for v8.0.0 - * - */ -/* - * COPY THIS FILE AS lv_demo_conf.h - */ - -#if 1 /*Set it to "1" to enable the content*/ - -#ifndef LV_EX_CONF_H -#define LV_EX_CONF_H - - -/******************* - * GENERAL SETTING - *******************/ -#define LV_EX_PRINTF 0 /*Enable printf-ing data in demoes and examples*/ -#define LV_EX_KEYBOARD 0 /*Add PC keyboard support to some examples (`lv_drivers` repository is required)*/ -#define LV_EX_MOUSEWHEEL 0 /*Add 'encoder' (mouse wheel) support to some examples (`lv_drivers` repository is required)*/ - -/********************* - * DEMO USAGE - *********************/ - -/*Show some widget*/ -#define LV_USE_DEMO_WIDGETS 1 -#if LV_USE_DEMO_WIDGETS -#define LV_DEMO_WIDGETS_SLIDESHOW 0 -#endif - -/*Printer demo, optimized for 800x480*/ -#define LV_USE_DEMO_PRINTER 0 - -/*Demonstrate the usage of encoder and keyboard*/ -#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0 - -/*Benchmark your system*/ -#define LV_USE_DEMO_BENCHMARK 0 - -/*Stress test for LVGL*/ -#define LV_USE_DEMO_STRESS 0 - -/*Music player demo*/ -#define LV_USE_DEMO_MUSIC 0 -#if LV_USE_DEMO_MUSIC -# define LV_DEMO_MUSIC_LANDSCAPE 0 -# define LV_DEMO_MUSIC_LARGE 0 -#define LV_DEMO_MUSIC_AUTO_PLAY 0 -#endif - -#endif /*LV_EX_CONF_H*/ - -#endif /*End of "Content enable"*/ -
diff -r 071136c3eefa -r 778736ecceb0 lv_demos.lib --- a/lv_demos.lib Tue Jun 15 19:35:57 2021 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://github.com/lvgl/lv_demos/#bb10f237f93865b74873ef77ff5482cd7b895771
diff -r 071136c3eefa -r 778736ecceb0 lvgl.lib --- a/lvgl.lib Tue Jun 15 19:35:57 2021 +0000 +++ b/lvgl.lib Sat Feb 04 21:01:46 2023 +0000 @@ -1,1 +1,1 @@ -https://github.com/lvgl/lvgl/#6d5ac702ad20ac3092c224ca36e412b0d6cec321 +https://github.com/lvgl/lvgl/#2c0162b457e32da50268127575c0c2b95ab29bc1 \ No newline at end of file
diff -r 071136c3eefa -r 778736ecceb0 main.cpp --- a/main.cpp Tue Jun 15 19:35:57 2021 +0000 +++ b/main.cpp Sat Feb 04 21:01:46 2023 +0000 @@ -1,12 +1,12 @@ /** - * Notebook page https://os.mbed.com/users/JohnnyK/notebook/how-start-with-the-littlevgl/ + * Notebook page https://os.mbed.com/users/JohnnyK/notebook/how-start-with-the-LVGL/ */ #include "mbed.h" -#include "lvgl/lvgl.h" +#include "lvgl.h" +#include "demos/lv_demos.h" /*Comment/uncomment will switch between LVGL demos and Hello word example*/ #include "hal_stm_lvgl/tft/tft.h" #include "hal_stm_lvgl/touchpad/touchpad.h" -#include "lv_demo.h" /*Comment/uncomment will switch between LVGL demo and Hello word example*/ #define LVGL_TICK 10 //Time tick value for lvgl in ms (1-10msa) #define TICKER_TIME 10ms //modified to miliseconds @@ -22,7 +22,7 @@ lv_tick_inc(LVGL_TICK); } -#ifndef LV_DEMO_H +#ifndef LV_DEMOS_H static void event_handler(lv_event_t* event) { lv_event_code_t code = lv_event_get_code(event); @@ -43,7 +43,7 @@ touchpad_init(); //Initialize touchpad ticker.attach(callback(&lv_ticker_func),TICKER_TIME); //Attach callback to ticker -#ifdef LV_DEMO_H +#ifdef LV_DEMOS_H printf("Demo\n"); lv_demo_widgets(); #else
diff -r 071136c3eefa -r 778736ecceb0 mbed-os.lib --- a/mbed-os.lib Tue Jun 15 19:35:57 2021 +0000 +++ b/mbed-os.lib Sat Feb 04 21:01:46 2023 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#14e5d307bb6cdccb554b591ab2602d8d47e0b2d0 +https://github.com/ARMmbed/mbed-os/#54e8693ef4ff7e025018094f290a1d5cf380941f \ No newline at end of file