⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd.h

📁 Keil平台
💻 H
字号:
/*
* Filename     : lcd.h
* Author       : Li Dawen
* Copyright (c): Coslight Group .co
* Create Date  : 2002.04.27
* Version      : 0.1.0
*/
#ifndef LCD_H
#define LCD_H

//#include "includes.h"

/* pixel screen cursor */
#define LCD_WPIXELSIZE      240
#define LCD_HPIXELSIZE      64
/* lcd width height */

#define LCD_WSIZE           30
#define LCD_HSIZE           8
#define LCD_MEMSIZE         LCD_WSIZE*LCD_HSIZE*2

#define LCD_MAX_COL         LCD_WSIZE-1
#define LCD_MAX_ROW         LCD_HSIZE-1

#define LCD_REFRESH         0x01
#define LCD_CLEAR           0x02

/*
+-------+-------+-------+-------+-------+-------+-------+-------+
|BRIGHT |SM FONT| BLINK | HIDE  |ONLY R |NO CAPT|NO DATA|NO UNIT|
+-------+-------+-------+-------+-------+-------+-------+-------+
*/

typedef struct
{
	uchar cursor_en;
	uchar cursor_x;
	uchar cursor_y;
	uchar cursor_size;
	uint  blink_count;
	uint  blink_cycle;
	uchar font;
	uchar win_style;
	uchar flag;
//    int   pixel;
//    int   screen;
//    uchar maskcode;
	uchar *mem;
} LCD;

void LcdInit(void);
void LcdClose(void);

/* LCD manage function */
void LcdOnLamp(void);
void LcdOffLamp(void);

/* lcd textbuf and bmpbuf manage function*/
void LcdCls(void);
void LcdDisplay(void);
void LcdDisplayxy(int x, int y, int len);
void LcdWinStyle(uchar value);
/* Cursor manage function */
void LcdCursor(int x, int y);
void LcdCursorSize(int value);
void LcdUpdate(void);
/*
    lcd text buf      0~480
    lcd graphics buf  240~1200 not 
    uchar LCDMEM[480];
*/
void  LcdPoke(uint offset, uchar value);
uchar LcdPeek(uint offset);

void LcdPutxy(int x, int y, uchar value); /* Draw Dot to LCD */
void LcdPutxyb(int x, int y, uchar value); /* Draw byte to LCD*/
void LcdPutCh(uchar x, uchar y, uchar ch, uchar style);
void LcdClearText(void);

void DrawCursor(void);                          /* 显示光标                     */
void DrawBmp(uchar x, uchar y, uchar w, uchar h, uchar  *buf, uchar style); /* Draw bitmap to LCD*/
void DrawText(uchar x, uchar y, char *text, uchar style);
void DrawLedText(uchar x, uchar y, char  *text, uchar style);
void DrawLed15(uchar x, uchar y, char text, uchar style);
/* text out function*/
int TextPick(uchar x, uchar y, int len, uchar *buf);  /* rt str len */
void TextOut(uchar x, uchar y, const char  *text, uchar style);/* style is font*/
void TextFocus(uchar x, uchar y, uchar index, uchar style);
void TextClear(uchar x, uchar y, uchar w, uchar style);

/* bitmap font manage function */
void Get_DZ(uchar qu, uchar wei, uchar  **pDZ);       /* 16*16*/
void Get_ASC(uchar code, uchar  **pDZ);      /* 8*16*/
void Get_ASCA(uchar  code, uchar  **pDZ);     /* 8*8*/

extern  unsigned int   HZMB[];
extern  unsigned char  HZ[];
extern  unsigned char  BMP[];
extern  unsigned char  ASC[];
extern  unsigned char  ASCA[];

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -