Stemwin (RBI based function)

Stemwin (RBI based function)
of this project I self-test, the TLT9341_SPI bus is available for other LCD screen, may be accordingly modified based on the project.
Based Stemwin transplant, I will do the following aspects introduced:
a: Stemwin development and why we want to transplant enwin of
two: build the basic engineering Stemwin of
three: memory allocation and establish ticking timer
Four: RBI function transplant
five: engineering validation download

As the photo on the world can not be added directly into the blog, the temporarily joined the picture, if necessary, add qq whisper.
2120198233
Here Insert Picture Description
a: Stemwin development and why we want to enwin transplant?
This is a good question, I believe we are all more or less ask this question before making transplant, yes, Xiao Bian during the transplant, they also consider this issue, the following will give you a brief introduction.
emWin Segger is embedded platform development company for stable and efficient graphics software library, suitable for any graphics LCD applications of operations, and output high-quality anti-aliased text and graphics function interface provided by calling emWin, development embedded GUI applications become simple and quick. EmWin use development interface is a detailed live, to design an interface that controls often need to be adjusted several times to reach the desired effect, here to share with you two emWin interface design tool: PC simulator and GUI Builder.
Two: to build basic engineering Stemwin's
first establish what works before you need to download and file, you can then download the official website, also can be downloaded via this link.
Link: https: //pan.baidu.com/s/1tcX-nBqBhpkT_DC3TSU0Kw
extraction code: rsdq

After downloading the following interface is
Here Insert Picture Description
the first LCD file for my project, this step we can put together their own drive panel to determine to be able to display, or behind the operation is meaningless.
The second document is a punctual atoms DEMO file, you can add their own good transplant after this project, the effect is cool.
The third document is a GUI (Stemwin) project files, some files need to be ported out.
Finally one needs to modify the value of the register portion according to the manual for the TLTLCD9341 chip manual transplantation.

1; First we open your own project with LCD, EMWIN create a new folder (GUI used to store files transplant), I demonstrate in their own projects.
Here Insert Picture Description

2 then open STemWin_Library_V1.2.0, then open the folder change under Libraries folder, then open the folder change STemWinLibrary532 folder, then the file in the Config, inc, Lib, OS four folders to above built EMWIN folder inside.
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

After copying the folder as shown below
Here Insert Picture Description

Then transfer all files OS inside the folder to the next EMWIN file
Here Insert Picture Description
Here Insert Picture Description
STemWin532_CM4_Keil copy then Lib folder, attached to the lower EMWIN folder, explain, there is a corresponding single chip GUI library with ot is with operator system, we first transplant without an operating system, I use the STM32ZET6, for the M4 core, as shown in FIG well after transplantation
Here Insert Picture Description
Here Insert Picture Description
and then copy the Config folder 7 paste the file to the next EMWIN
Here Insert Picture Description
well after transplant as shown shows
Here Insert Picture Description
the migration file the final step is to Config, Lib, OS folder is deleted, all the while changing file attributes and Stemwin532_CM4_Keil except in the case EMWIN folder, remove the read-only mode.
If your folder is shown in the following figure paintings, congratulations Stemwin first step to success
Here Insert Picture Description

II: The following allocation ticking timer and memory

The EMWIN file to the project, as shown, do not forget to add the c file
Here Insert Picture Description
after a good join in the project as shown in the open
Here Insert Picture Description

Then add GUI header file in main.c file,
Here Insert Picture Description
while adding lcd header files in both GUI template in.
Here Insert Picture Description
Here Insert Picture Description
At this time, dynamic memory can be allocated as a GUI, determined as required
Here Insert Picture Description

After completion of the above GUI memory allocation is complete, followed by ticking timer configuration
volatile GUI_TIMER_TIME OS_TimeMS will GUI_X.c under; stm32f4xx_it ... c added to the inside, and affirms extern make global calls
Here Insert Picture Description

As shown in FIG After addition
Here Insert Picture Description
was then added in OS_TimeMS ++ 144 lines in the document; statement, at this time the timer tick has the configuration
Here Insert Picture Description
last call in which the main function, while enabling the timer tick
Here Insert Picture Description

The most important three dot is a function of transplanted
prior to grafting RBI need to configure the value of the function, LCDConf_Lin_Template.c color template file, as shown in FIG.
Here Insert Picture Description
142 files simultaneously modify the file,
Here Insert Picture Description

At the same time shielding at the file, and there's no use, if not, then the compiler will not shielded by
Here Insert Picture Description
the addition of the x scan LCD_Init (initialization file)
Here Insert Picture Description
If you have reached this step, then everything is ready only a strong wind. Now you can transplant RBI function of
Here Insert Picture Description
the RBI function from your LCD RBI function, we can not direct transplant, transplanted directly if possible will complain directly to the mobile function within it, then compiled, then may be error, the reason is constituted you LCD RBI function has no global declaration. Just follow the steps below will solve
Here Insert Picture Description

Videos can then use a GUI operating dotted line inside the main function.
Here Insert Picture Description
At this point I the following code written in the main function inside, and like the driving of the LCD, the corresponding function can be viewed inside emwin manual.
Here Insert Picture Description
In this case the wrong color, the magenta be displayed, the high color discrimination, but may display information I need, the main LCD is not a value to the register 36, the register control color, reversal, etc. in our LCD.c initialization file. Data can be sent 0X60 details, you can view the LCD according to the manual network disk inside of me, configuration-related registers

After modifying the code in FIG.
Here Insert Picture Description
** here ** Insert Picture Description

At this time, ok, the migration is complete

Note: The RBI graft function is not very good, brush frequency will be relatively slow, mainly because I was this screen SPI interface, a parallel interface is slower than the serial interface, and add simulation spi, not hard-core, not a function of RBI like generic template function which can be directly accessed register. We may recommend a change screen, or refresh the code be amended accordingly.

Released two original articles · won praise 5 · views 90

Guess you like

Origin blog.csdn.net/weixin_43517955/article/details/104907192