EmWin transplant-based on Red Bull Development Board

Source: Internet
Author: User

Always want to use what you learn to design a delicate work, at hand there is a Red Bull Development Board, first use it to write some software, familiar with the process and some ideas of the feasibility. First of all, of course, the choice of an operating system, compared to a few after the choice of Emwin. Then transplant it.

Here is the first to thank http://www.openedv.com/posts/list/0/27697.htm this post. My idea is basically done according to this post. Thank the landlord of the hard work to contribute to the results, so that my rookie can quickly get started.

stemwin:http://www.st.com/web/en/catalog/tools/pf259225#

Download the Stemwin on the official St website, and then use the STemWinLibrary522 folder in the Libraries folder to copy to the Project project folder.

Then add the following files to the project

Modify LCDCONF_FLEXCOLOR_TEMPLATE.C

Add #include "ili9320.h" before you need to write the underlying driver for the LCD screen you are using. The screen depends on the underlying driver.

Note that the following functions, write instructions and write data are generally defined in the bottom layer of the LCD driver, directly added in the line.

Static voidLcdwritereg (U16 Data) {// ... TBD by UserLcd->lcd_reg =Data;}Static voidLcdwritedata (U16 Data) {// ... TBD by UserLcd->lcd_ram =Data;}Static voidLcdwritedatamultiple (U16 * pData,intNumItems) {   while(numitems--)   {    // ... TBD by UserLcd->lcd_ram = *pdata++; }}Static voidLcdreaddatamultiple (U16 * pData,intNumItems) {  *pdata = lcd->Lcd_ram;  while(numitems--)    {    // ... TBD by User*pdata++ = lcd->Lcd_ram; }}

After the completion of the modification is the establishment of the Emwin and LCD screen contact

about void lcd_x_config (void) function (this I will summarize later) cont ....

Then test the GUI to see if it is normal

I use the latest library function of the ST official program, including the LCD drive function is official, so feel to operate to facilitate some

The following code is written in the main function:

Systeminit (); Rcc_ahbperiphclockcmd (rcc_ahbperiph_crc,enable); Lcd_x_init (); Ili9320_initializtion (); Gui_init (); Gui_setcolor (Gui_yellow); Gui_dispstringat ("emWin5.22 GUIcomplete",+);  while (1);

Pay attention to the initialization of the liquid crystal don't forget

So I can display it normally on the Red Bull Development Board (LCD drive is ILI9320)

You can then use the various functions inside the GUI.h to show what you want.

The function of the specific function and how to use the reference Emwin User manual are explained in detail.

Here are a few API functions that can be found in the manual

Numeric API:

Text API:

So far we have finished the preliminary liquid crystal bottom transplant. Next, try porting the demo program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.