#include "main.h"
#include "usart.h"
#include "sys.h"
#include "delay.h"
#include "led.h"
#include "Lcd_Driver.h"
#include "GUI.h"
#include "delay.h"
#include "Picture.h"
unsigned char Num[10]={0,1,2,3,4,5,6,7,8,9};
void Num_Test(void)
{
u8 i=0;
Lcd_Clear(GRAY0);
Gui_DrawFont_GBK16(16,20,RED,GRAY0,"1234567890");
// delay_ms(1000);
Lcd_Clear(GRAY0);
for(i=0;i<10;i++)
{
Gui_DrawFont_Num32((i%3)*40,32*(i/3)+30,RED,GRAY0,Num[i+1]);
// delay_ms(100);
}
}
void Font_Test(void)
{
Lcd_Clear(GRAY0);
// delay_ms(1000);
Lcd_Clear(GRAY0);
Gui_DrawFont_GBK16(0,100,BLUE,GRAY0,"1234567890");
Gui_DrawFont_GBK16(0,130,RED,GRAY0, "1234567890");
// delay_ms(1800);
}
void Color_Test(void)
{
u8 i=1;
Lcd_Clear(GRAY0);
Gui_DrawFont_GBK16(20,10,BLUE,GRAY0,"Color Test");
// delay_ms(200);
while(i--)
{
Lcd_Clear(WHITE);
Lcd_Clear(BLACK);
Lcd_Clear(RED);
Lcd_Clear(GREEN);
Lcd_Clear(BLUE);
}
}
//16位 垂直扫描 右到左 高位在前
void show_pic()
{
int i,j,k;
unsigned char picH,picL;
Lcd_Clear(GRAY0);
// delay_ms(1000);
Lcd_Clear(GRAY0);
k=0;
for(i=0;i<128;i++)
for(j=0;j<160;j++)
{
picH=gImage_123[k++];
picL=gImage_123[k++];
Lcd_WriteData(picH);
Lcd_WriteData(picL);
}
}
u16 ID=0;
int main(void)
{
// u8 a=0;
u16 color=0;
HAL_Init();
// Cache_Enable();
/* Configure the system clock to 216 MHz */
SystemClock_Config();
LED_Init();
uart_init(115200);
Lcd_Init(2);
Lcd_Clear(GRAY0);
while(1)
{
// Lcd_Init(2);
Lcd_Clear(color);
Color_Test(); //简单纯色填充测试
Num_Test();
Font_Test();//中英文显示测试
show_pic();//图片显示示例
delay_ms(600);
color+=100;
}
}
|