?? main.c
字號:
/****************************************Copyright (c)**************************************************
** Guangzou ZLG-MCU Development Co.,LTD.
** graduate school
** http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name: main.c
** Last modified Date: 2004-09-16
** Last Version: 1.0
** Descriptions: The main() function example template
**
**------------------------------------------------------------------------------------------------------
** Created by: Chenmingji
** Created date: 2004-09-16
** Version: 1.0
** Descriptions: The original version
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/
#include "config.h"
extern uint8 gImage_pic1[];
extern void DelaymS(uint32 no);
/*******************************************************
* 名稱: DispRGB
* 功能: 顯示RGB紅色。第種純色,各占80行。
* 入口參數: 無
* 出口參數: 無
*******************************************************/
void DispRGB(void)
{ uint32 x,y;
TftSetWindow(0,0, 239,319);
TftSetWrite(0, 0);
// 填充紅色
for(y=0; y<80; y++)
{ for(x=0; x<240; x++)
{ TftSendDat(0xF800);
}
}
// 填充綠色
for(y=0; y<80; y++)
{ for(x=0; x<240; x++)
{ TftSendDat(0x07E0);
}
}
// 填充藍色
for(y=0; y<80; y++)
{ for(x=0; x<240; x++)
{ TftSendDat(0x001F);
}
}
// 填充白色
for(y=0; y<80; y++)
{ for(x=0; x<240; x++)
{ TftSendDat(0xFFFF);
}
}
DelaymS(5*1000); // 延時5S
}
/*******************************************************
* 名稱: DispPic
* 功能: 顯示圖形演示。
* 入口參數: 無
* 出口參數: 無
*******************************************************/
void DispPic(void)
{ uint32 x, y;
uint32 no;
uint16 dat;
// 第1幅圖
TftSetWindow(0,0, 239, 319);
TftSetWrite(0,0);
no = 0;
for(y=0; y<320; y++)
{ for(x=0; x<240; x++)
{ dat = (gImage_pic1[no+1]<<8) | gImage_pic1[no];
TftSendDat(dat);
no++;
no++;
}
}
DelaymS(5*1000);
}
int main (void)
{ // add user source code
PINSEL0 = 0x00000000;
PINSEL1 = 0x00000000;
GUI_Initialize();
while(1)
{ // 屏幕填充RGB色
DispRGB();
// 顯示圖片
DispPic();
}
return 0;
}
/*********************************************************************************************************
** End Of File
********************************************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -