📄 hello.c
字号:
/******************************************************************************/
/* HELLO.C: Hello World Example */
/******************************************************************************/
/* This file is part of the uVision/ARM development tools. */
/* Copyright (c) 2005-2006 Keil Software. All rights reserved. */
/* This software may only be used under the terms of a valid, current, */
/* end user licence from KEIL for a compatible version of KEIL software */
/* development tools. Nothing else gives you the right to use this software. */
/******************************************************************************/
#include <stdio.h> /* I/O Functions */
#include <S3C44B0X.H> /* S3C44B0X definitions */
extern volatile unsigned long timeval; /* Current Time Tick */
extern unsigned int LcdBuffer[244][640/4];
extern const unsigned char car[153600];
extern void Lcd_Initial(void);
extern void Lcd_DrawBackground(unsigned char RGB);
extern void Lcd_PutPixel(unsigned int x, unsigned int y,unsigned char RGB);
extern void Lcd_DrawBox(unsigned int H_Offset,unsigned int V_Offset,unsigned int H_Size,unsigned int V_Size,unsigned char RGB);
extern void Lcd_DrawHline(unsigned int x0,unsigned int y0,unsigned int x1,unsigned char RGB);
extern void Lcd_DrawVline(unsigned int x0,unsigned int y0,unsigned int y1,unsigned char RGB);
extern void Lcd_DrawLine(unsigned int x0,unsigned int y0,unsigned int x1,unsigned int y1,unsigned char RGB);
extern void Lcd_PutHz16(unsigned int x,unsigned int y,unsigned char RGB,unsigned char *GB2312);
extern void Lcd_PutChar(unsigned int x,unsigned int y,unsigned char RGB,unsigned char *c);
extern void Lcd_Print(unsigned int x,unsigned int y,unsigned char RGB,unsigned char *c);
extern void Lcd_DrawImage(const unsigned char *pic);
void wait (unsigned long time) { /* Wait Function */
unsigned long tick;
tick = timeval;
while ((timeval - tick) < time); /* Wait for specified Time */
}
extern void init_timer (void); /* Initialize Timer */
extern void init_serial (void); /* Initialize Serial Interface */
int main (void) {
init_timer(); /* Initialize Timer */
init_serial(); /* Initialize Serial Interface */
// pPIO->PDATC = 0x0;
// pPIO->PCONC = 0x54;
// pPIO->PUPC = 0x0;
Lcd_Initial();
Lcd_DrawBackground(0x1f);
wait(1000);
Lcd_DrawBox(300,100,180,80,0x03);
Lcd_DrawBox(200,60,180,80,0xfc);
// Lcd_PutPixel(250,70,0xe0);
// Lcd_DrawHline(50,90,600,0xAA);
// Lcd_DrawVline(320,10,230,0xff);
Lcd_DrawLine(20,30,600,230,0xe0);
Lcd_DrawLine(300,10,350,230,0x1c);
Lcd_DrawLine(50,90,600,90,0xAA);
Lcd_DrawLine(320,10,320,230,0xff);
// Lcd_PutHz16(200,200,0x02,"篆");
// Lcd_PutChar(216,200,0x02,"X");
Lcd_Print(0,0,0x00,"测试中...(中文测试)");
Lcd_Print(0,16,0x00,"ASCII Test...(英文测试)");
Lcd_Print(0,32,0x00,"直线,竖线测试...");
Lcd_Print(0,48,0x00,"斜线测试...");
Lcd_Print(0,64,0x00,"填充矩形测试...");
// Lcd_DrawImage(car); //显示图片
while(1) /* Loop forever */
{
// pPIO->PDATC &= ~0x0000000e; /* Turn LED On (PE0 = 1) */
// printf ("Hello World !\n"); /* Print "Hello World !" */
// wait(900); /* Wait 100ms */
// pPIO->PDATC |= 0x0000000e; /* Turn LED Off (PE0 = 0) */
wait(900); /* Wait 900ms */
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -