{"id":14976,"date":"2023-07-14T09:45:46","date_gmt":"2023-07-14T04:15:46","guid":{"rendered":"https:\/\/fastbitlab.com\/?p=14976"},"modified":"2023-10-20T17:25:18","modified_gmt":"2023-10-20T11:55:18","slug":"ltdc-layer-testing-on-hardware-set-background-color","status":"publish","type":"post","link":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/","title":{"rendered":"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 41| LTDC layer testing on hardware"},"content":{"rendered":"<div class=\"boldgrid-section color4-background-color color-4-text-contrast bg-background-color\">\n<div class=\"container\">\n<div class=\"row\">\n<div class=\"col-lg-1 col-md-12 col-sm-12 col-xs-12\"><\/div>\n<div class=\"col-lg-10 col-md-12 col-xs-12 col-sm-12\">\n<p class=\"\">&nbsp;<\/p>\n<h1 class=\"\" style=\"text-align: center; font-size: 35px; line-height: 50px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><strong><span style=\"color: #000080;\">LTDC layer testing on hardware<\/span><\/strong><\/h1>\n<div class=\"row bg-editor-hr-wrap\">\n<div class=\"col-lg-12 col-md-12 col-xs-12 col-sm-12\">\n<div>\n<div class=\"bg-hr bg-hr-16 color2-color\" style=\"border-style: solid; border-width: 0px 0px 2px; box-shadow: #cecece 0px 0px 0px 0px inset;\"><\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">The term &#8220;LTDC layer&#8221; typically refers to the Layered Timing Controller (LTDC) in embedded systems, particularly in microcontrollers and display driver circuits. LTDC is responsible for managing the timing and control signals for driving an LCD (Liquid Crystal Display) or TFT (Thin-Film Transistor) display.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">The LTDC layer acts as an interface between the microcontroller and the display panel. It receives pixel data from the microcontroller and converts it into the necessary control signals for the display. These control signals include horizontal and vertical synchronization signals, pixel clocks, data enable signals, and control signals for backlight control, if applicable.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">The LTDC layer typically provides features such as resolution scaling, pixel formatting, color space conversion, and blending of multiple layers. It allows the microcontroller to control the display parameters, such as refresh rate, color depth, and display orientation.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">By utilizing the LTDC layer, developers can efficiently drive and control displays in embedded systems, providing graphical user interfaces, animations, and other visual content. The layer facilitates the seamless integration of displays into various applications, including automotive dashboards, medical devices, industrial control systems, and more.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Now, we will set a background color for our frame buffer. The frame buffer is located in the bsp_lcd_ex.c file and its size is determined by FB_SIZE. <\/span><span style=\"font-weight: 400;\">So, based on the pixel format you have chosen in the bsp_lcd.h.&nbsp;<\/span><\/span><\/p>\n<p class=\"\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #993366;\"><strong>uint8_t bsp_fb[FB_SIZE];<\/strong><\/span><\/p>\n<pre class=\"color-5-text-contrast color5-background-color\" style=\"font-size: 12px; box-shadow: #cecece 0px 0px 0px 0px inset;\"><span style=\"color: #993366;\">#include<\/span> \"bsp_lcd.h\"\r\n\r\n<span style=\"color: #993366;\">#if<\/span> BSP_LCD_PIXEL_FMT == BSP_LCD_PIXEL_FMT_RGB565\r\n<span style=\"color: #993366;\">   #define<\/span> FB_SIZE (BSP_FB_WIDTH * BSP_FB_HEIGHT * 2)\r\n<span style=\"color: #993366;\">#elif<\/span> BSP_LCD_PIXEL_FMT == BSP_LCD_PIXEL_FMT_RGB666\r\n<span style=\"color: #993366;\">   #define<\/span> FB_SIZE ((BSP_FB_WIDTH * BSP_FB_HEIGHT * 2) + ((BSP_FB_WIDTH * BSP_FB_HEIGHT *2)\/8U)+1U)\r\n<span style=\"color: #993366;\">#elif<\/span> BSP_LCD_PIXEL_FMT == BSP_LCD_PIXEL_FMT_RGB888\r\n<span style=\"color: #993366;\">   #define<\/span> FB_SIZE (BSP_FB_WIDTH * BSP_FB_HEIGHT * 3)\r\n<span style=\"color: #993366;\">#else<\/span>\r\n<span style=\"color: #993366;\">    #error<\/span><span style=\"color: #3366ff;\">\"Select pixel format\"<\/span>\r\n<span style=\"color: #993366;\">#endif<\/span>\r\n\r\n<strong><span style=\"color: #993366;\">uint8_t<\/span> bsp_fb[<span style=\"color: #99ccff;\">FB_SIZE<\/span>];<\/strong>\r\n\r\n<\/pre>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 20px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"text-decoration: underline; color: #000080;\"><b>Set the background color:<\/b><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">The background color is usually defined in the frame buffer as a pixel value. Each pixel is represented by a certain number of bits, where each bit determines the color of a specific component (e.g., red, green, blue, and alpha). The number of bits per component and the organization of the frame buffer depend on your display configuration and pixel format.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Look at below, which displays a function called set_fb_background_color. To utilize this function, you need to provide an RGB888 value as input. The function internally performs a conversion to RGB565 based on the pixel format. Currently, only this particular conversion is supported. However, you have the option to implement additional conversions if needed. To set the desired color, simply invoke this function with the appropriate color parameter.<\/span><\/p>\n<pre class=\"color-5-text-contrast color5-background-color\" style=\"font-size: 12px; box-shadow: #cecece 0px 0px 0px 0px inset;\"><span style=\"color: #993366;\">void<\/span> bsp_lcd_set_fb_background_color(<span style=\"color: #993366;\">uint32_t<\/span> rgb888)\r\n{\r\n<span style=\"color: #993366;\">#if<\/span>(BSP_LCD_PIXEL_FMT == BSP_LCD_PIXEL_FMT_RGB565)\r\n&nbsp; &nbsp; &nbsp;write_to_fb_rgb565((<span style=\"color: #993366;\">uint16_t*<\/span>)bsp_fb,(FB_SIZE\/2U),Convert_RGB888_to_RGB565(rgb888));\r\n<span style=\"color: #993366;\">#elif<\/span>(BSP_LCD_PIXEL_FMT == BSP_LCD_PIXEL_FMT_RGB666)\r\n&nbsp; &nbsp; &nbsp;write_to_fb_rgb666(Convert_RGB888_to_RGB666(rgb888));\r\n<span style=\"color: #993366;\">#elif<\/span>(BSP_LCD_PIXEL_FMT == BSP_LCD_PIXEL_FMT_RGB888)\r\n&nbsp; &nbsp; &nbsp;write_to_fb_rgb888(rgb888);\r\n<span style=\"color: #993366;\">#else<\/span>\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style=\"color: #993366;\">#error<\/span><span style=\"color: #3366ff;\">\"Select pixel format\"<\/span>\r\n<span style=\"color: #993366;\">#endif<\/span>\r\n}<\/pre>\n<p class=\"\" style=\"font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #993366;\"><b>void bsp_lcd_set_fb_background_color(uint32_t rgb888)<\/b><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">This is the function declaration for setting the background color of the frame buffer. It takes an input <\/span><span style=\"font-weight: 400;\">rgb888<\/span><span style=\"font-weight: 400;\"> which represents the desired color in RGB888 format (8 bits per color channel).<\/span><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #993366;\"><b>#if(BSP_LCD_PIXEL_FMT == BSP_LCD_PIXEL_FMT_RGB565)<\/b><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #993366;\"><b>write_to_fb_rgb565((uint16_t*)bsp_fb,(FB_SIZE\/2U, Convert_RGB888_to_RGB565(rgb888));<\/b><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #993366;\"><b>#elif(BSP_LCD_PIXEL_FMT == BSP_LCD_PIXEL_FMT_RGB666)<\/b><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #993366;\"><b>write_to_fb_rgb666(Convert_RGB888_to_RGB666(rgb888));<\/b><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #993366;\"><b>#elif(BSP_LCD_PIXEL_FMT == BSP_LCD_PIXEL_FMT_rgb888)<\/b><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #993366;\"><b>write_to_fb_rgb888(rgb888));<\/b><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">This code snippet uses preprocessor directives (<\/span><span style=\"font-weight: 400;\">#if<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">#elif<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">#else<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">#endif<\/span><span style=\"font-weight: 400;\">) to conditionally execute different code based on the selected pixel format (<\/span><span style=\"font-weight: 400;\">BSP_LCD_PIXEL_FMT<\/span><span style=\"font-weight: 400;\">). It assumes three possible pixel formats: RGB565, RGB666, and rgb888.<\/span><\/span><\/p>\n<ul class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">If the pixel format is RGB565, the function <\/span><span style=\"font-weight: 400;\">write_to_fb_rgb565<\/span><span style=\"font-weight: 400;\"> is called with the frame buffer <\/span><span style=\"font-weight: 400;\">bsp_fb<\/span><span style=\"font-weight: 400;\">, the size of the frame buffer divided by 2 (<\/span><span style=\"font-weight: 400;\">(FB_SIZE\/2U)<\/span><span style=\"font-weight: 400;\">), and the converted RGB565 color obtained from <\/span><span style=\"font-weight: 400;\">Convert_RGB888_to_RGB565(rgb888)<\/span><span style=\"font-weight: 400;\">.<\/span><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">If the pixel format is RGB666, the function <\/span><span style=\"font-weight: 400;\">write_to_fb_rgb666<\/span><span style=\"font-weight: 400;\"> is called with the converted RGB666 color obtained from <\/span><span style=\"font-weight: 400;\">Convert_RGB888_to_RGB666(rgb888)<\/span><span style=\"font-weight: 400;\">.<\/span><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">If the pixel format is rgb888, the function <\/span><span style=\"font-weight: 400;\">write_to_fb_rgb888<\/span><span style=\"font-weight: 400;\"> is called with the RGB888 color <\/span><span style=\"font-weight: 400;\">rgb888<\/span><span style=\"font-weight: 400;\">.<\/span><\/span><\/li>\n<\/ul>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #993366;\"><b>else<\/b><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #993366;\"><b>#error\u201dSelect pixel format\u201d<\/b><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #993366;\"><b>#endif<\/b><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">If none of the defined pixel formats match the selected format, a preprocessor error directive is triggered, indicating that the pixel format needs to be selected properly.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">To set the background color, you would call this function with the desired color represented in RGB888 format. The function will handle the conversion based on the selected pixel format and write the appropriate color value to the frame buffer.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">In the file bsp_lcd.h, you provide the prototype of the function bsp_lcd_set_fb_background_color.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">In the main.c file, define hexadecimal values for various colors (as shown below). Then, call the <span style=\"color: #993366;\"><strong>bsp_lcd_set_fb_background_color<\/strong><\/span> function using any of those colors. Here, I&#8217;ll use the color green. This function sets the color of the layer since the frame buffer address is associated with Layer 1.<\/span><\/p>\n<pre class=\"color-5-text-contrast color5-background-color\" style=\"font-size: 12px; box-shadow: #cecece 0px 0px 0px 0px inset;\"><strong><span style=\"color: #993366;\">#define <\/span><span style=\"color: #ffffff;\">VIOLET RGB888(148,0,211)<\/span><\/strong>\r\n<strong><span style=\"color: #993366;\">#define<\/span> <span style=\"color: #ffffff;\">INDIGO RGB888(75,0,130)<\/span><\/strong>\r\n<strong><span style=\"color: #993366;\">#define<\/span> BLUE RGB888(0,0,255)<\/strong>\r\n<strong><span style=\"color: #993366;\">#define<\/span> GREEN RGB888(0,255,0)<\/strong>\r\n<strong><span style=\"color: #993366;\">#define<\/span> YELLOW RGB888(255,255,0)<\/strong>\r\n<strong><span style=\"color: #993366;\">#define<\/span> <span style=\"color: #ffffff;\">ORANGE <\/span>RGB888(255,127,0)<\/strong>\r\n<strong><span style=\"color: #993366;\">#define<\/span> RED RGB888(255,0,0)<\/strong>\r\n<strong><span style=\"color: #993366;\">#define<\/span> <span style=\"color: #ffffff;\">WHITE RGB888(255,255,255)<\/span><\/strong>\r\n\r\n\r\n<span style=\"color: #993366;\">void<\/span> SystemClock_Setup(<span style=\"color: #993366;\">void<\/span>);\r\n<span style=\"color: #993366;\">void<\/span> LTDC_Pin_Init(<span style=\"color: #993366;\">void<\/span>);\r\n<span style=\"color: #993366;\">void<\/span> LTDC_Init(<span style=\"color: #993366;\">void<\/span>);\r\n<span style=\"color: #993366;\">void<\/span> LTDC_Layer_Init(LTDC_Layer_TypeDef *pLayer);\r\n<span style=\"color: #993366;\">int<\/span> main(<span style=\"color: #993366;\">void<\/span>)\r\n{\r\n&nbsp; &nbsp; &nbsp; &nbsp;SystemClock_Setup();\r\n&nbsp; &nbsp; &nbsp; &nbsp;BSP_LCD_Init();\r\n&nbsp; &nbsp; &nbsp; &nbsp;LTDC_Pin_Init();\r\n&nbsp; &nbsp; &nbsp; &nbsp;LTDC_Init();\r\n&nbsp; &nbsp; &nbsp; &nbsp;LTDC_Layer_Init(LTDC_Layer1);\r\n&nbsp; &nbsp; &nbsp;<span style=\"color: #ffff00;\"> &nbsp;<strong>bsp_lcd_set_fb_background_color(GREEN);<\/strong><\/span>\r\n\r\n<span style=\"color: #008000;\">\/*loop forever*\/<\/span>\r\n\r\n<span style=\"color: #993366;\">for(;;);<\/span><\/pre>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">After executing the code, you will observe that the display module does display the color green, as shown in Figure 1.<\/span><\/p>\n<figure id=\"attachment_14982\" aria-describedby=\"caption-attachment-14982\" style=\"width: 713px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-14982 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/07\/Figure-4.png\" alt=\"Figure 4. Green color displayed\" width=\"713\" height=\"376\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4.png 1455w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4-300x158.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4-1024x540.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4-768x405.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4-600x316.png 600w\" sizes=\"(max-width: 713px) 100vw, 713px\" \/><figcaption id=\"caption-attachment-14982\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 1. Green color displayed<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Now, let&#8217;s experiment by reducing the layer size. In the &#8220;Configure Layer Position&#8221; (windowing) step, we will modify the code. Open the main.c file and locate the section for the start calculation. Here, you need to use BSP_LTDC_LAYER_H_START for horizontal start calculation and BSP_LTDC_LAYER_V_START for vertical start calculation.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Similarly, you should use BSP_LTDC_LAYER_WIDTH for horizontal stop calculation. And for the vertical stop calculation, you need to use <span style=\"color: #993366;\"><strong>BSP_LTDC_LAYER_HEIGHT<\/strong><\/span>.<\/span><\/p>\n<pre class=\"color-5-text-contrast color5-background-color\" style=\"font-size: 12px; box-shadow: #cecece 0px 0px 0px 0px;\"><span style=\"color: #008000;\">\/\/Configure layer position (Windowing)<\/span>\r\n<span style=\"color: #993366;\">uint32_t<\/span> AHBP = REG_READ_VAL(pLTDC-&gt;<span style=\"color: #3366ff;\">BPCR<\/span>,0xFFFU,LTDC_BPCR_AHBP_Pos);\r\n<span style=\"color: #993366;\">uint32_t<\/span> WHSTART = AHBP+BSP_LTDC_LAYER_H_START +1;\r\nREG_SET_VAL(tmp,WHSTART,0xFFFU,LTDC_LxWHPCR_WHSTPOS_Pos);\r\n\r\n<span style=\"color: #993366;\">uint32_t<\/span> WHSTOP = AHBP+BSP_LTDC_LAYER_H_START+BSP_LTDC_LAYER_WIDTH+1;\r\n<span style=\"color: #993366;\">uint32_t<\/span> AAW = REG_READ_VAL(pLTDC-&gt;<span style=\"color: #3366ff;\">AWCR<\/span>,0xFFFU,LTDC_AWCR_AAW_Pos);\r\nWHSTOP = (WHSTOP &gt; AAW)?AAW:WHSTOP;\r\nREG_SET_VAL(tmp,WHSTOP,0xFFFU,LTDC_LxWHPCR_WHSPPOS_Pos);\r\n\r\nREG_WRITE(pLayer-&gt;WHPCR,tmp);\r\n\r\ntmp = 0;\r\n<span style=\"color: #993366;\">uint32_t<\/span> AVBP = REG_READ_VAL(pLTDC-&gt;<span style=\"color: #3366ff;\">BPCR<\/span>,0x7FFU,LTDC_BPCR_AVBP_Pos);\r\n<span style=\"color: #993366;\">uint32_t<\/span> WVSTART = AVBP+BSP_LTDC_LAYER_V_START+1;\r\nREG_SET_VAL(tmp,WVSTART,0x7FFU,LTDC_LxWVPCR_WVSTPOS_Pos);\r\n\r\n<span style=\"color: #993366;\">uint32_t<\/span> AAH = REG_READ_VAL(pLTDC-&gt;<span style=\"color: #3366ff;\">AWCR<\/span>,0x7FFU,LTDC_AWCR_AAH_Pos);\r\n<strong><span style=\"color: #993366;\">uint32_t<\/span> WVSTOP = AVBP+BSP_LTDC_LAYER_V_START+<span style=\"color: #ffff00;\">BSP_LTDC_LAYER_HEIGHT<\/span>+1;<\/strong>\r\nWVSTOP = (WVSTOP &gt; AAH)?AAH:WVSTOP;\r\nREG_SET_VAL(tmp,WVSTOP,0x7FFU,LTDC_LxWVPCR_WVSPPOS_Pos);\r\n\r\nREG_WRITE(pLayer-&gt;WVPCR,tmp);<\/pre>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">After executing this code, you will notice that the inactive area of the layer appears black, but you can modify this behavior. This can be achieved by configuring the default color of the layer.<\/span><\/p>\n<figure id=\"attachment_14984\" aria-describedby=\"caption-attachment-14984\" style=\"width: 715px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-14984\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/07\/Figure-6.png\" alt=\"LTDC layer testing on hardware\" width=\"715\" height=\"366\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-6.png 1553w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-6-300x154.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-6-1024x524.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-6-768x393.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-6-600x307.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-6-1536x786.png 1536w\" sizes=\"(max-width: 715px) 100vw, 715px\" \/><figcaption id=\"caption-attachment-14984\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 2. Output<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">To accomplish this, you need to make changes in the code section titled &#8216;Configure the default color of the layer.&#8217; This modification will affect the inactive area of the layer. Specifically, you will use the command&nbsp;<\/span><\/p>\n<pre class=\"color-5-text-contrast color5-background-color\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 12px; line-height: 30px; box-shadow: #cecece 0px 0px 0px 0px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\"><span style=\"font-weight: 400; color: #ffff99;\">REG_WRITE(player-&gt;DCCR, YELLOW);<\/span><\/pre>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Here the register is DCCR and the value is Yellow.<\/span><\/p>\n<figure id=\"attachment_14985\" aria-describedby=\"caption-attachment-14985\" style=\"width: 738px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-14985\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/07\/Figure-7.png\" alt=\"LTDC layer testing on hardware\" width=\"738\" height=\"369\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7.png 1833w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-300x150.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1024x512.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-768x384.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-600x300.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1536x768.png 1536w\" sizes=\"(max-width: 738px) 100vw, 738px\" \/><figcaption id=\"caption-attachment-14985\" class=\"wp-caption-text\">Figure 7. Configure the default color of the layer<\/figcaption><\/figure>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Once the necessary changes have been made, relaunch the program. <\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">As a result, you will observe that the inactive area of the layer now displays the color Yellow, while the active area of the layer continues to utilize the frame buffer values. <\/span><\/p>\n<figure id=\"attachment_14986\" aria-describedby=\"caption-attachment-14986\" style=\"width: 779px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-14986\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/07\/Figure-8.png\" alt=\"LTDC layer testing on hardware\" width=\"779\" height=\"388\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-8.png 1859w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-8-300x149.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-8-1024x510.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-8-768x382.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-8-600x299.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-8-1536x764.png 1536w\" sizes=\"(max-width: 779px) 100vw, 779px\" \/><figcaption id=\"caption-attachment-14986\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 8. Output<\/span><\/figcaption><\/figure>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">In the following article, let&#8217;s do our task, which is to show the color bars.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 18px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #993366;\"><strong>Get the Mastering Microcontroller: STM32-LTDC, LCD-TFT, LVGL(MCU3) Full course on<\/strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/www.udemy.com\/course\/mastering-microcontroller-stm32-ltdc-lcd-tft-lvgl\/\" target=\"_blank\" rel=\"noopener\"> Here<\/a>.<\/span><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 20px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><strong>FastBit Embedded Brain Academy Courses<\/strong><\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">Click here: <span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/fastbitlab.com\/course1\">https:\/\/fastbitlab.com\/course1<\/a><\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<\/div>\n<div class=\"col-lg-1 col-md-12 col-sm-12 col-xs-12\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; LTDC layer testing on hardware &nbsp; The term &#8220;LTDC layer&#8221; typically refers to the Layered Timing Controller (LTDC) in embedded systems, particularly in microcontrollers and display driver circuits. LTDC is responsible for managing the timing and control signals for driving an LCD (Liquid Crystal Display) or TFT (Thin-Film Transistor) display. The LTDC layer acts [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":14982,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[8],"tags":[],"class_list":["post-14976","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","entry","has-media"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Setting LTDC Layer Background Color in Embedded Displays<\/title>\n<meta name=\"description\" content=\"LTDC layer testing on hardware. Learn how to effectively configure and utilize the LTDC layer for hardware displays, set background color,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setting LTDC Layer Background Color in Embedded Displays\" \/>\n<meta property=\"og:description\" content=\"LTDC layer testing on hardware. Learn how to effectively configure and utilize the LTDC layer for hardware displays, set background color,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/\" \/>\n<meta property=\"og:site_name\" content=\"FastBit EBA\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/fastbiteba\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-14T04:15:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-20T11:55:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1455\" \/>\n\t<meta property=\"og:image:height\" content=\"767\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"FastBitLab\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:site\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"FastBitLab\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/\"},\"author\":{\"name\":\"FastBitLab\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\"},\"headline\":\"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 41| LTDC layer testing on hardware\",\"datePublished\":\"2023-07-14T04:15:46+00:00\",\"dateModified\":\"2023-10-20T11:55:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/\"},\"wordCount\":1079,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Figure-4.png\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/\",\"name\":\"Setting LTDC Layer Background Color in Embedded Displays\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Figure-4.png\",\"datePublished\":\"2023-07-14T04:15:46+00:00\",\"dateModified\":\"2023-10-20T11:55:18+00:00\",\"description\":\"LTDC layer testing on hardware. Learn how to effectively configure and utilize the LTDC layer for hardware displays, set background color,\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/#primaryimage\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Figure-4.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Figure-4.png\",\"width\":1455,\"height\":767,\"caption\":\"Figure 4. Green color displayed\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/ltdc-layer-testing-on-hardware-set-background-color\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 41| LTDC layer testing on hardware\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"name\":\"FastBit EBA\",\"description\":\"Your Online Academy of Embedded Systems\",\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\",\"name\":\"FastBit EBA\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"width\":640,\"height\":640,\"caption\":\"FastBit EBA\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/fastbiteba\\\/\",\"https:\\\/\\\/x.com\\\/fastbiteba\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/fastbit-embedded-brain-academy-b3167b124\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCa1REBV9hyrzGp2mjJCagBg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\",\"name\":\"FastBitLab\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"caption\":\"FastBitLab\"},\"description\":\"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setting LTDC Layer Background Color in Embedded Displays","description":"LTDC layer testing on hardware. Learn how to effectively configure and utilize the LTDC layer for hardware displays, set background color,","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/","og_locale":"en_US","og_type":"article","og_title":"Setting LTDC Layer Background Color in Embedded Displays","og_description":"LTDC layer testing on hardware. Learn how to effectively configure and utilize the LTDC layer for hardware displays, set background color,","og_url":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/","og_site_name":"FastBit EBA","article_publisher":"https:\/\/www.facebook.com\/fastbiteba\/","article_published_time":"2023-07-14T04:15:46+00:00","article_modified_time":"2023-10-20T11:55:18+00:00","og_image":[{"width":1455,"height":767,"url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4.png","type":"image\/png"}],"author":"FastBitLab","twitter_card":"summary_large_image","twitter_creator":"@fastbiteba","twitter_site":"@fastbiteba","twitter_misc":{"Written by":"FastBitLab","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/#article","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/"},"author":{"name":"FastBitLab","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d"},"headline":"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 41| LTDC layer testing on hardware","datePublished":"2023-07-14T04:15:46+00:00","dateModified":"2023-10-20T11:55:18+00:00","mainEntityOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/"},"wordCount":1079,"commentCount":0,"publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4.png","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/","url":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/","name":"Setting LTDC Layer Background Color in Embedded Displays","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/#primaryimage"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4.png","datePublished":"2023-07-14T04:15:46+00:00","dateModified":"2023-10-20T11:55:18+00:00","description":"LTDC layer testing on hardware. Learn how to effectively configure and utilize the LTDC layer for hardware displays, set background color,","breadcrumb":{"@id":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/#primaryimage","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4.png","width":1455,"height":767,"caption":"Figure 4. Green color displayed"},{"@type":"BreadcrumbList","@id":"https:\/\/fastbitlab.com\/blog\/ltdc-layer-testing-on-hardware-set-background-color\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fastbitlab.com\/blog\/"},{"@type":"ListItem","position":2,"name":"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 41| LTDC layer testing on hardware"}]},{"@type":"WebSite","@id":"https:\/\/fastbitlab.com\/blog\/#website","url":"https:\/\/fastbitlab.com\/blog\/","name":"FastBit EBA","description":"Your Online Academy of Embedded Systems","publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fastbitlab.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fastbitlab.com\/blog\/#organization","name":"FastBit EBA","url":"https:\/\/fastbitlab.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","width":640,"height":640,"caption":"FastBit EBA"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/fastbiteba\/","https:\/\/x.com\/fastbiteba","https:\/\/www.linkedin.com\/in\/fastbit-embedded-brain-academy-b3167b124\/","https:\/\/www.youtube.com\/channel\/UCa1REBV9hyrzGp2mjJCagBg"]},{"@type":"Person","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d","name":"FastBitLab","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","caption":"FastBitLab"},"description":"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries."}]}},"_links":{"self":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/14976","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/comments?post=14976"}],"version-history":[{"count":5,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/14976\/revisions"}],"predecessor-version":[{"id":16173,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/14976\/revisions\/16173"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media\/14982"}],"wp:attachment":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media?parent=14976"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/categories?post=14976"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/tags?post=14976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}