Preface
A few days ago, we have completed the transplantation of LVGL to W801, and the effect is shown in the following figure:
‘
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:
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
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:
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)
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:
display effect
Note here that the touch coordinates also need to convert some coordinates:
O1(h3,v3) -> O2(x3=v3,y3=239-h3)
Previous article:HLK-W801-LVGL8 source code transplantation
Next article:HLK-W801-LVGL8 touch driver
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [Domestic RISC-V Linux Board Fang·Starlight VisionFive Trial Report] Unboxing Report
- Award-winning live broadcast: 5G and edge computing development and technology applications
- Smart wax therapy machine based on STM32 and Gizwits
- [Xingkong Board Python Programming Learning Main Control Board] Python development environment experience - graphic code can be quickly started
- Method of measuring automobile throttle sensor signal with auto repair oscilloscope
- 【NXP Rapid IoT Review】+① NXP Rapid IoT unboxing test
- How to detect whether the switching power supply transformer is good or bad?
- How to enable TI 15.4-Stack to support 470M frequency band
- 【Development Kit for nRF52840】+ Review 5-thread trial
- How to determine whether the EN enable pin of the chip needs a series resistor?