HLK-W801-LVGL8 horizontal screen display

Publisher:轻松自在Latest update time:2022-08-09 Source: csdn Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Preface

A few days ago, we have completed the transplantation of LVGL to W801, and the effect is shown in the following figure:

Please add a description of the image

The picture is displayed in portrait mode because the screen has a resolution of 240x320. If it is to be displayed in landscape mode, that is, how to configure the screen as 320x240? I originally wanted to achieve this goal by directly configuring some configuration parameters in LVGL, but there are several problems in actual operation. In LVGL, sw_rotate=1, rotated=LV_DISP_ROT_90 can be used to achieve the rotation purpose, but the actual effect is indeed low frame rate and high CPU usage caused by software implementation, and the picture can only display 240*320 effect after rotation, not widescreen display. So here I am thinking about how to use the display driver function in ILI9325 to achieve this (that is, the ILI9235 driver configuration displays a 90° rotation)


Analysis of normal vertical screen display

As shown in the figure, the F1 area displays vertically:

Please add a description of the image

Screen horizontal H: vertical V = 240: 320

Screen origin coordinates O1(0,0)

In the lvgl interface function flush, the area filling needs to be implemented. For details, please refer to the LCD driver here for the basic steps:

1) Configure Entry Mode (R03h)

Bit3 AM,Bit4:5=ID0:1

AM=0,ID0:1=3

Please add a description of the image

2) Window Area ((R50h, R51h, R52h, R53h) and starting coordinates (R20h, R21h) when filling the F1 area


Set the start/end coordinates of the fill area

reg :

0x50 set h1

0x51 set h2

0x52 set v1

0x53 set v2

Set the starting coordinate address

reg:

0x20 set h1

0x21 set v1

Anatomy of a horizontal display

As shown in the figure, the F1 area displays horizontally:

Please add a description of the image

The horizontal screen display is regarded as rotating the screen 90° clockwise, but the screen horizontal X: vertical Y = 320: 240

The displayed starting point coordinates become O2(0,0)

In the lvgl interface function flush, area filling needs to be implemented.

1) Configure Entry Mode (R03h)

Bit3 AM,Bit4:5=ID0:1

AM=1,ID0:1=2, here set ORG=1, then the starting point coordinates change from O1(0,0) to O2(0,0)

Please add a description of the image

2) Window Area ((R50h, R51h, R52h, R53h) and starting coordinates (R20h, R21h) when filling the F1 area

Here is the key point: because the starting and ending points of the filled area are still determined by the screen origin coordinates O1(0,0), when ORG=1 is adjusted, the area filled by the O2 coordinate system needs to be converted to the O1 coordinate system.

As shown in the figure, the starting and ending coordinates of the F1 area are O2(x1,y1), O2(x2,y2),

When configuring the window area, you need to configure it as O1(h1,v1),O1(h2,v2)

According to the coordinate relationship of the screen, it can be concluded that:


Set the start/end coordinates of the fill area

reg :

0x50 set h1=239-y2

0x51 set h2=239-y1

0x52 set v1=x1

0x53 set v2=x2

Set the starting coordinate address

reg:

0x20 set x1

0x21 set y1

The flush interface is implemented as follows:

Please add a description of the image

display effect

Please add a description of the image

Note here that the touch coordinates also need to convert some coordinates:

O1(h3,v3) -> O2(x3=v3,y3=239-h3)


Reference address:HLK-W801-LVGL8 horizontal screen display

Previous article:HLK-W801-LVGL8 source code transplantation
Next article:HLK-W801-LVGL8 touch driver

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号