{"id":15011,"date":"2023-07-19T09:49:47","date_gmt":"2023-07-19T04:19:47","guid":{"rendered":"https:\/\/fastbitlab.com\/?p=15011"},"modified":"2024-03-01T16:35:55","modified_gmt":"2024-03-01T11:05:55","slug":"stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation","status":"publish","type":"post","link":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/","title":{"rendered":"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 43| About portrait orientation"},"content":{"rendered":"<div class=\"boldgrid-section color-neutral-background-color color-neutral-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-family: 'Roboto Slab'; font-weight: 400; font-size: 35px; line-height: 50px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><strong>About portrait orientation<\/strong><\/span><\/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;\"><\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\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=\"font-weight: 400; color: #000000;\">The orientation of the display refers to how the content is displayed on the screen. The two common orientations are <span style=\"color: #800080;\"><strong>landscape<\/strong><\/span> and <span style=\"color: #800080;\"><strong>portrait<\/strong><\/span>.<\/span><\/p>\n<p class=\"\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-size: 20px; 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: #ff0000;\">What is <span style=\"font-weight: 400;\"><strong>Portrait orientation?<\/strong><\/span><\/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=\"\"><strong><span style=\"color: #000000;\">Portrait orientation means that the display is taller than it is wide, similar to the orientation of a portrait photograph.<\/span><\/strong><\/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;\"> This means that the height of the display is greater than its width. In portrait mode, the content is typically displayed vertically, with the height of the screen determining the vertical resolution and the width determining the horizontal resolution.<\/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 BSP_LCD_Init function, there is a step where the LCD_config command is used. Specifically, the command used is the ILI9341_MAC (Memory Access Control) register, which is responsible for changing the screen orientation.&nbsp;<\/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;\">Currently, the register is set to landscape mode. Let me explain how to modify the parameters of this command to achieve the portrait mode.<\/span><\/p>\n<figure id=\"attachment_15014\" aria-describedby=\"caption-attachment-15014\" style=\"width: 698px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-15014 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/07\/Figure-1-2.png\" alt=\"Figure 1. Memory access Control \" width=\"698\" height=\"326\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-1-2.png 1429w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-1-2-300x140.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-1-2-1024x478.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-1-2-768x358.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-1-2-600x280.png 600w\" sizes=\"(max-width: 698px) 100vw, 698px\" \/><figcaption id=\"caption-attachment-15014\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 1. Memory access Control<\/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=\"color: #000000;\"><span style=\"font-weight: 400;\">You use the Memory access control values which are mentioned at the beginning of the file( as shown below).<\/span><span style=\"font-weight: 400;\">&nbsp;<\/span><\/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> <span style=\"color: #99ccff;\">\"bsp_lcd.h\"<\/span>\r\n\r\n<span style=\"color: #993366;\">#define<\/span> MADCTL_MY 0x80   <span style=\"color: #00ff00;\">\/\/\/&lt; Bottom to top<\/span>\r\n<span style=\"color: #993366;\">#define<\/span> MADCTL_MX 0x40<span style=\"color: #00ff00;\">   \/\/\/&lt; Right to left<\/span>\r\n<span style=\"color: #993366;\">#define<\/span> MADCTL_MV 0x20   <span style=\"color: #00ff00;\">\/\/\/&lt; Reverse Mode<\/span>\r\n<span style=\"color: #993366;\">#define<\/span> MADCTL_ML 0x10   <span style=\"color: #00ff00;\">\/\/\/&lt; LCD refresh Bottom to top<\/span>\r\n<span style=\"color: #993366;\">#define<\/span> MADCTL_RGB 0x00  <span style=\"color: #00ff00;\">\/\/\/&lt; Red-Green-Blue pixel order<\/span>\r\n<span style=\"color: #993366;\">#define<\/span> MADCTL_BGR 0x08  <span style=\"color: #00ff00;\">\/\/\/&lt; Blue-Green-Red pixel order<\/span>\r\n<span style=\"color: #993366;\">#define<\/span> MADCTL_MH 0x04   <span style=\"color: #00ff00;\">\/\/\/&lt; LCD refresh right to left<\/span><\/pre>\n<p class=\"\" style=\"text-align: center;\"><span style=\"color: #000000;\">Memory access control(36h) bits degining<\/span><\/p>\n<p class=\"\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">&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;\">If you want to understand more about that command, you can just go to the <\/span><span style=\"color: #ff6600;\"><a style=\"color: #ff6600;\" href=\"https:\/\/cdn-shop.adafruit.com\/datasheets\/ILI9341.pdf\"><span style=\"font-weight: 400;\">LCD datasheet<\/span><\/a><\/span><span style=\"font-weight: 400;\"> and just search for 36h. That&#8217;s a command 36h. Here it is, Memory Access Control, as shown in Figure 2.<\/span><\/span><\/p>\n<figure id=\"attachment_15016\" aria-describedby=\"caption-attachment-15016\" style=\"width: 689px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-15016 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/07\/Figure-3-2.png\" alt=\"Figure 3. Memory Access Control(36h)\" width=\"689\" height=\"381\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-3-2.png 1449w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-3-2-300x166.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-3-2-1024x566.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-3-2-768x425.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-3-2-600x332.png 600w\" sizes=\"(max-width: 689px) 100vw, 689px\" \/><figcaption id=\"caption-attachment-15016\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 2. Memory Access Control(36h)<\/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=\"color: #000000;\"><span style=\"font-weight: 400;\">You have to change MY, MX, MV, ML, BGR, and MH bits to get the desired orientation.<\/span><span style=\"font-weight: 400;\">&nbsp;<\/span><\/span><\/p>\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=\"color: #000000;\"><span style=\"font-weight: 400;\">&nbsp;<\/span><span style=\"color: #ff0000;\"><strong>How does it work?&nbsp;<\/strong><\/span><\/span><\/p>\n<figure id=\"attachment_15017\" aria-describedby=\"caption-attachment-15017\" style=\"width: 738px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-15017 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/07\/Figure-4-2.png\" alt=\"Figure 4. Memory access control in Portrait mode\" width=\"738\" height=\"387\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4-2.png 1861w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4-2-300x157.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4-2-1024x538.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4-2-768x403.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4-2-600x315.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-4-2-1536x806.png 1536w\" sizes=\"(max-width: 738px) 100vw, 738px\" \/><figcaption id=\"caption-attachment-15017\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 3. Memory access control in Portrait mode<\/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;\">Look at Figure 3. This is your LCD&#8217;s GRAM or frame memory. It has a width of 240 pixels and a height of 320 lines. Additionally, there is a display panel.<\/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;\">Whenever you send data to the display module, the data is first stored in the GRAM of the display. Therefore, when you write data to the GRAM in the X direction, it will be displayed in the corresponding X direction on the display panel. This is the default behavior.<\/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;\">But we want something different. What we want is, let&#8217;s take the case of the landscape. In landscape, whenever you send data to the frame memory, frame memory will be written in the X direction, but you want the display to be happening in the Y direction.&nbsp; That is a landscape mode, as shown in Figure 4.<\/span><\/p>\n<figure id=\"attachment_15018\" aria-describedby=\"caption-attachment-15018\" style=\"width: 638px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15018 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/07\/Figure-5-2.png\" alt=\"Figure 5. Memory access control in Landscape mode\" width=\"638\" height=\"350\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-5-2.png 1833w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-5-2-300x165.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-5-2-1024x563.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-5-2-768x422.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-5-2-600x330.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-5-2-1536x844.png 1536w\" sizes=\"(max-width: 638px) 100vw, 638px\" \/><figcaption id=\"caption-attachment-15018\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 4. Memory access control in Landscape mode<\/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;\">You want the display to happen either in a positive Y direction or in a negative Y direction. This is also a landscape mode. That&#8217;s why there is one bit called MV. So, that is used for this XY exchange.<\/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;\">The writing is happening in the X direction, but the display is happening in the Y direction.&nbsp; If you want to achieve that, then you have to set this bit MV = 1, Row\/Column Exchange(Figure 2). <\/span><span style=\"font-weight: 400;\">&nbsp;<\/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=\"font-weight: 400; color: #000000;\">If you want to explore more, then go to page number 209, as shown in Figure 5. Here \u2018B\u2019 means begin.&nbsp; \u2018E\u2019 means end.<\/span><\/p>\n<figure id=\"attachment_15019\" aria-describedby=\"caption-attachment-15019\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15019\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/07\/Figure-6-2.png\" alt=\"About portrait orientation\" width=\"800\" height=\"1072\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-6-2.png 968w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-6-2-224x300.png 224w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-6-2-764x1024.png 764w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-6-2-768x1030.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-6-2-600x805.png 600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption id=\"caption-attachment-15019\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 5. Frame memory<\/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;\">Everything is explained in the below diagram you can see here(Figure 6).<\/span><\/p>\n<figure id=\"attachment_15020\" aria-describedby=\"caption-attachment-15020\" style=\"width: 705px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15020\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/07\/Figure-7-1.png\" alt=\"About portrait orientation\" width=\"705\" height=\"414\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1.png 1741w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1-300x176.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1-1024x602.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1-768x451.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1-600x353.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1-1536x903.png 1536w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><figcaption id=\"caption-attachment-15020\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 6. Direction of pixel display<\/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 our portrait-1 mode, we want MX = 1, MY = 1,&nbsp; MV = 0. But, if you want to hold the board in Portrait-2 orientation, then you can use&nbsp; MX=0, MY=0, MV=0 parameters, like that.<\/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;\">There are two more important commands which you need to change. Now you have to change the number of rows and a number of columns information. When it is in the landscape, there are 320 columns. The number of columns we program in this column address set register(CASET).&nbsp;<\/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 code snippet, here you can see that, I have programmed 320, which is 320 means in hex it is 0x140. So, I&#8217;m sending something like this.<\/span><\/p>\n<pre class=\"color-5-text-contrast color5-background-color\" style=\"font-size: 12px; box-shadow: #cecece 0px 0px 0px 0px;\">LCD_Write_Cmd(ILI9341_RASET); <span style=\"color: #00ff00;\">\/\/page address set<\/span>\r\nparams[0]= 0x00;\r\nparams[1]= 0x00;\r\nparams[2]= 0x00;\r\nparams[3]= 0xf0; <span style=\"color: #00ff00;\">\/\/240 rows = 0xf0<\/span>\r\nLCD_Write_Data(params, 4);\r\n\r\nLCD_Write_Cmd(ILI9341_CASET);\r\nparams[0]= 0x00;\r\nparams[1]= 0x00;\r\nparams[2]= 0x01;\r\nparams[3]= 0x40; <span style=\"color: #00ff00;\">\/\/320 columns = 0x140<\/span>\r\nLCD_Write_Data(params, 4);<\/pre>\n<div><\/div>\n<div><\/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;\">If you want portrait orientation, this needs to be modified.&nbsp; If you want to change the orientation because in portrait there are 240 columns. So, you have to exchange these values.&nbsp;<\/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 for RASET, that is the page address set, where you need to configure the number of rows.&nbsp;<\/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_Orientation(<span style=\"color: #993366;\">int<\/span> orientation)\r\n{\r\n&nbsp; &nbsp;<span style=\"color: #008000;\">uint8_t<\/span> params[4];\r\n\r\n  &nbsp;  <span style=\"color: #993366;\">if<\/span>(orientation == LANDSCAPE){\r\n\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LCD_Write_Cmd(ILI9341_RASET); <span style=\"color: #00ff00;\">\/\/page address set<\/span>\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;params[0]= 0x00;\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;params[1]= 0x00;\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;params[2]= 0x00;\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;params[3]= 0xf0; <span style=\"color: #00ff00;\">\/\/240 rows = 0xf0<\/span>\r\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LCD_Write_Data(params, 4);\r\n\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  LCD_Write_Cmd(ILI9341_CASET);\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  params[0]= 0x00;\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  params[1]= 0x00;\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  params[2]= 0x01;\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  params[3]= 0x40; \/\/320 columns = 0x140\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  LCD_Write_Data(params, 4);\r\n\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  params[0] = MADCTL_MV | MADCTL_MY | MADCTL_BGR; <span style=\"color: #00ff00;\">\/*Memory Access Control &lt;Landscape setting&gt;*\/<\/span>\r\n  &nbsp; }<span style=\"color: #993366;\">else if<\/span>(orientation == PORTRAIT){\r\n\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  LCD_Write_Cmd(ILI9341_RASET); <span style=\"color: #00ff00;\">\/\/page address set<\/span>\r\n  &nbsp; &nbsp; &nbsp;   &nbsp;params[0]= 0x00;\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  params[1]= 0x00;\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  params[2]= 0x01;\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  params[3]= 0x40;<span style=\"color: #00ff00;\"> \/\/320 rows = 0x140<\/span>\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  LCD_Write_Data(params, 4);\r\n\r\n  &nbsp; &nbsp; &nbsp; &nbsp;  LCD_Write_Cmd(ILI9341_CASET);\r\n  &nbsp; &nbsp; &nbsp;    params[0]= 0x00;\r\n  &nbsp; &nbsp; &nbsp;    params[1]= 0x00;\r\n  &nbsp; &nbsp; &nbsp;    params[2]= 0x00;\r\n  &nbsp; &nbsp; &nbsp;    params[3]= 0xf0; <span style=\"color: #00ff00;\">\/\/240 columns = 0xf0<\/span>\r\n  &nbsp; &nbsp; &nbsp;    LCD_Write_Data(params, 4);\r\n\r\n  &nbsp; &nbsp; &nbsp;    params[0] = MADCTL_MY| MADCTL_MX| MADCTL_BGR; <span style=\"color: #00ff00;\">\/* Memory Access Control &lt;portrait setting&gt; *\/<\/span>\r\n}<\/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;\">Here, in this file, I have added a new function called BSP_LCD_Set_Orientation. This function allows you to specify the desired orientation. If you choose a landscape, we will reconfigure the RASET and CASET commands and set the MV and MY bits accordingly. On the other hand, if you choose a portrait, we will reconfigure RASET and CASET, modify the memory access control settings, and resend the command with the specified parameter.<\/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 complete this implementation, we need to provide the prototype of this function in bsp_lcd.h.<\/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;\">After that, let&#8217;s go to the main. And from the main, after you do the Layer_Init, we&#8217;ll call the BSP_LCD_Set_Orientation function. Orientation: let&#8217;s use Portrait. So, you can also use this after this LCD_Init. And in the bsp_lcd.h, so make sure that you select a Portrait.<\/span><\/p>\n<figure id=\"attachment_15023\" aria-describedby=\"caption-attachment-15023\" style=\"width: 708px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15023 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/07\/Figure-10.png\" alt=\"Figure 10. main.c file\" width=\"708\" height=\"363\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-10.png 1095w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-10-300x154.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-10-1024x525.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-10-768x393.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-10-600x307.png 600w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><figcaption id=\"caption-attachment-15023\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 10. main.c file<\/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, we will test this.<\/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;\">It&#8217;s important to consult the datasheet or documentation provided by the manufacturer of your TFT-LCD display for specific guidance on interfacing and programming in portrait orientation. The details may vary depending on the display controller and module you are using.<\/span><\/p>\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=\"color: #000080;\"><strong>FastBit Embedded Brain Academy Courses<\/strong><\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; font-family: 'Roboto Slab'; font-weight: 400; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><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\">&nbsp;<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; About portrait orientation &nbsp; The orientation of the display refers to how the content is displayed on the screen. The two common orientations are landscape and portrait. &nbsp; What is Portrait orientation? Portrait orientation means that the display is taller than it is wide, similar to the orientation of a portrait photograph. This means [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":15020,"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-15011","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>About portrait orientation in LVGL<\/title>\n<meta name=\"description\" content=\"Portrait orientation means that the display is taller than it is wide, similar to the orientation of a portrait photograph. The landscape\" \/>\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\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"About portrait orientation in LVGL\" \/>\n<meta property=\"og:description\" content=\"Portrait orientation means that the display is taller than it is wide, similar to the orientation of a portrait photograph. The landscape\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/\" \/>\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-19T04:19:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-01T11:05:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1741\" \/>\n\t<meta property=\"og:image:height\" content=\"1023\" \/>\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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/\"},\"author\":{\"name\":\"FastBitLab\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\"},\"headline\":\"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 43| About portrait orientation\",\"datePublished\":\"2023-07-19T04:19:47+00:00\",\"dateModified\":\"2024-03-01T11:05:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/\"},\"wordCount\":961,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Figure-7-1.png\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/\",\"name\":\"About portrait orientation in LVGL\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Figure-7-1.png\",\"datePublished\":\"2023-07-19T04:19:47+00:00\",\"dateModified\":\"2024-03-01T11:05:55+00:00\",\"description\":\"Portrait orientation means that the display is taller than it is wide, similar to the orientation of a portrait photograph. The landscape\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/#primaryimage\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Figure-7-1.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Figure-7-1.png\",\"width\":1741,\"height\":1023,\"caption\":\"Figure 7. Direction of pixel display\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\\\/#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 43| About portrait orientation\"}]},{\"@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":"About portrait orientation in LVGL","description":"Portrait orientation means that the display is taller than it is wide, similar to the orientation of a portrait photograph. The landscape","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\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/","og_locale":"en_US","og_type":"article","og_title":"About portrait orientation in LVGL","og_description":"Portrait orientation means that the display is taller than it is wide, similar to the orientation of a portrait photograph. The landscape","og_url":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/","og_site_name":"FastBit EBA","article_publisher":"https:\/\/www.facebook.com\/fastbiteba\/","article_published_time":"2023-07-19T04:19:47+00:00","article_modified_time":"2024-03-01T11:05:55+00:00","og_image":[{"width":1741,"height":1023,"url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1.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":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/#article","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/"},"author":{"name":"FastBitLab","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d"},"headline":"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 43| About portrait orientation","datePublished":"2023-07-19T04:19:47+00:00","dateModified":"2024-03-01T11:05:55+00:00","mainEntityOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/"},"wordCount":961,"commentCount":0,"publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1.png","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/","url":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/","name":"About portrait orientation in LVGL","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/#primaryimage"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1.png","datePublished":"2023-07-19T04:19:47+00:00","dateModified":"2024-03-01T11:05:55+00:00","description":"Portrait orientation means that the display is taller than it is wide, similar to the orientation of a portrait photograph. The landscape","breadcrumb":{"@id":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/#primaryimage","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/07\/Figure-7-1.png","width":1741,"height":1023,"caption":"Figure 7. Direction of pixel display"},{"@type":"BreadcrumbList","@id":"https:\/\/fastbitlab.com\/blog\/stm32-ltdc-lcd-tft-lvglmcu3-lecture-43-about-portrait-orientation\/#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 43| About portrait orientation"}]},{"@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\/15011","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=15011"}],"version-history":[{"count":4,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/15011\/revisions"}],"predecessor-version":[{"id":16289,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/15011\/revisions\/16289"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media\/15020"}],"wp:attachment":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media?parent=15011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/categories?post=15011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/tags?post=15011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}