📄 lcd.h
字号:
/*
*************************************************************************
* Copyright (c) 2003, The Lab of Embedded System and Net Security,WHUT..
* All rights reserved.
*
* Filename: lcd.h
* Discription: This file drives lcd
*
* version: 1.0
* Author: Qiu Yanfei <qyfhm@tom.com>
* Accomplished Date: 2004/7/28 19:55:00
*************************************************************************
*/
#ifndef __LCD_H__
#define __LCD_H__
#ifdef LCD_GLOBALS
#define LCD_EXT
#else
#define LCD_EXT extern
#endif
#include "..\cpu\def.h"
#define SCR_XSIZE (320)
#define SCR_YSIZE (240)
//active lcd buffer size
#define LCD_XSIZE (320)
#define LCD_YSIZE (240)
#define M5D(n) ((n) & 0x1fffff)
#define ARRAY_SIZE_COLOR (SCR_XSIZE/1*SCR_YSIZE)
#define LINEVAL (LCD_YSIZE-1)
#define MVAL (13)
#define MVAL_USED 0
#define LCD_BUF_SIZE (SCR_XSIZE * SCR_YSIZE)
#ifdef CORLOR_LCD
#define COLOR_NUMBER 256
#define HOZVAL (LCD_XSIZE*3/8-1)
#define CLKVAL (4) //60Mhz
#define DISMODE 2 //8-bit single scan display mode
#define MODESEL 3 //color mode
#define BLACK 0x00
#define WHITE 0xff
#define RED 0xe0
#define GREEN 0x1c
#define BLUE 0x03
#define YELLOW 0xfc
#define ALLBLACK ((BLACK << 24) | (BLACK << 16) | (BLACK << 8) | BLACK)
#define ALLWHITE ((WHITE << 24) | (WHITE << 16) | (WHITE << 8) | WHITE)
#define ALLBLUE ((BLUE << 24) | (BLUE << 16) | (BLUE << 8) | BLUE)
#define LIGHTGRAY 0xa0
#define DARKGRAY 0x50
#define TRANSPARENCY 0xff
#define DEFAULT_COLOR (YELLOW)
LCD_EXT U32 aLcdActiveBuffer[LCD_YSIZE][LCD_XSIZE/4];
#define LCD_PutPixel(x, y, c)\
aLcdActiveBuffer[(y)][(x)/4]=(( aLcdActiveBuffer[(y)][(x)/4] & (~(0xff000000>>((x)%4)*8)) ) | ( (c)<<((4-1-((x)%4))*8) ));
#define LCD_ActivePutPixel(x, y, c)\
aLcdActiveBuffer[(y)][(x)/4]=(( aLcdActiveBuffer[(y)][(x)/4] & (~(0xff000000>>((x)%4)*8)) )\
| ( (c)<<((4-1-((x)%4))*8) ));
#else
#define BLACK 0x01
#define WHITE 0x00
#define DEFAULT_COLOR (BLACK)
#define HOZVAL (LCD_XSIZE/4-1)
#define CLKVAL (10) //68Mhz
#define DISMODE 1 //4-bit single scan display mode
#define MODESEL 0 //monocrome mode
LCD_EXT unsigned int aLcdActiveBuffer[SCR_YSIZE][SCR_XSIZE/32];
#define LCD_ActivePutPixel(x, y, c)\
aLcdActiveBuffer[(y)][(x)/8]=(( aLcdActiveBuffer[(y)][(x)/8] & (~(0x80>>((x)%8))) ) | ( (c)<<(7-((x)%8))));
#define LCD_PutPixel(x, y, c)\
aLcdActiveBuffer[(y)][(x)/32]=( aLcdActiveBuffer[(y)][(x)/32] & ~(0x80000000>>((x)%32)*1) ) | ( (c)<< ((32-1-((x)%32))*1) );
#endif /* CORLOR_LCD */
#ifndef RED
#define RED 0x00
#endif
#ifndef GREEN
#define GREEN 0x00
#endif
#ifndef BLUE
#define BLUE 0x00
#endif
#ifndef YELLOW
#define YELLOW 0x00
#endif
#define GUISWAP(a, b) {a^=b; b^=a; a^=b;}
LCD_EXT void Lcd_Init(void);
LCD_EXT void Lcd_Clr(void);
void Lcd_Draw_Box (U16 usLeft, U16 usTop, U16 usRight, U16 usBottom, U8 ucColor);
void Lcd_Draw_Line (U16 usX0, U16 usY0, U16 usX1, U16 usY1, U8 ucColor, U16 usWidth);
void Lcd_Draw_HLine (U16 usX0, U16 usX1, U16 usY0, U8 ucColor, U16 usWidth);
void Lcd_Draw_VLine (U16 usY0, U16 usY1, U16 usX0, U8 ucColor, U16 usWidth);
void Lcd_Fill_Box (U16 usX0, U16 usY0, U16 usX1, U16 usY1, U8 ucColor);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -