791 views|1 replies

501

Posts

4

Resources
The OP
 

[Digi-Key Follow Me Issue 4] Getting Started Task 3 - Porting ZLGGUI and LCD Display [Copy link]

 This post was last edited by qinyunti on 2024-2-15 22:19

  • Transplant ZLGGUI-display characters

3.1 Add code

CMakeLists.txt中

aux_source_directory(ZLG_GUI ZLG_GUI_SOURCES)

include_directories(ZLG_GUI/include.)

add_executable(blink

blink.c

ls013.c

ls013_lcd.c

${ZLG_GUI_SOURCES}

)

3.2 Driver Porting

Need to implement the functions in lcmdrv.c

#include"config.h"

#include"ls013_lcd.h"

void GUI_Initialize ( void) Initialization

voidGUI_Initialize(void)

{

lcd_init();

}

void GUI_FillSCR(TCOLOR dat) Fill the entire screen with the specified color

voidGUI_FillSCR(TCOLORdat)

{

lcd_fill(that);

}

void GUI_Point(uint16 x, uint16_t y, TCOLOR color) Write the color value of the point

voidGUI_Point(uint16x, uint16_ty, TCOLORcolor)

{

lcd_set_pixel(x,y,color);

}

uint32_t GUI_ReadPoint(uint16 x, uint16_t y, TCOLOR *ret) Get the color value of a point. Can be empty

uint32_tGUI_ReadPoint(uint16x, uint16_ty, TCOLOR*ret)

{

uint32_tretc;

retc= lcd_get_pixel(x,y);

if(ret!= 0)

{

*right = rightc;

}

returnretc;

}

void GUI_Exec(void) Refresh the video memory display

voidGUI_Exec(void)

{

lcd_sync();

}

Definition of resolution in Lcmdrv.h

#defineGUI_LCM_XMAX 144u

#define GUI_LCM_YMAX 168u

3.3 Configuration

UI_CONFIG.h can be used to enable the configuration of each module. We use 8x8 font to print HelloWorld

So enable configuration #define FONT8x8_EN 1

3.4 Testing

#include "config.h"

GUI_Initialize();

GUI_SetColor(1,0);

GUI_PutString8_8(0,0,"HelloWorld");

while(1)

{

GUI_Exec();

sleep_ms(10);

}

The download and run results are as follows

This post is from DigiKey Technology Zone

Latest reply

See HelloWorld   Details Published on 2024-2-16 22:24
 
 

6570

Posts

0

Resources
2
 

See HelloWorld

This post is from DigiKey Technology Zone
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list