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

📄 hdc1600.h

📁 Display driver for Hyvix HDC1600 LCD controller in Keil C for 8051
💻 H
字号:
/*
*************************************************************************************************
*		CM50012ACT6 65k color Graphical LCD Display Driver (HYVIX HDC1600 controller)
*										All Rights Reserved
* File name		: hdc1600.h
* Programmer 	: John Leung, TechToys Co. Hong Kong
* Web presence  : www.TechToys.com.hk
* Note			: 
* Language		: Keil C (C51) compiler, Eval version 7.09 under uVision2 IDE v2.40
* Hardware		: AT89S8253-cLCD-STK1, & CM50010ACT6_BO
* Date			: 24th August 2007 
* Version		: 1.0
*************************************************************************************************
*										DESCRIPTION
*
* This module provides an interface to CM50012ACT6 65k color graphical LCD module of 128x160dots
* Display controller chip is Hyvix HDC1600
* Module requires 3.3V DC supply to Vdd, LED backlight requires 6.2-6.5V, 15mA typical
*
* LCD pinout function summarized as below
* --------- LCD		MCU -----------------
* pin 1		LED-K 	- GND (Cathode for LED-backlight)
* pin 2 	LED+A 	- LED backlight, requires 6.2-6.5V, 15mA typical
* pin 3		Vss  	- GND
* pin 4		Vdd		- 3.3V Supply
* pin 5		n.c.	- shunt to ground
* pin 6		n.c.	
* pin 7		CS		- chip select, low active
* pin 8		RST		- reset, low active; wired to manual reset switch of the whole system
* pin 9		A0		- (H:Data, L:Command (data or command control))
* pin 10	WR		- active low, L:Write; use with RD pin
* pin 11	RD		- active low, L:Read; use with WR pin
* pin 12:19	D7:D0	- LCD_DATA 
* pin 20			- Vss
***********************************************************************************************
*/


#ifndef _HDC1600_H_
#define _HDC1600_H_

typedef unsigned char 		INT8U;
typedef unsigned int		INT16U;
typedef unsigned char		BOOLEAN;

/*
***********************************************************************************************
* Default brightness and contrast levels
***********************************************************************************************
*/

#define BRIGHTNESS			85			//range from 0 to 255
#define CONTRAST			50			//range from 0 to 63
#define PALETTE_RED			6			//Palette values range from 0 to 6 from red, blue, & green
#define PALETTE_BLUE		0			//See cDispInit(void) for details
#define PALETTE_GREEN		0
/*
***********************************************************************************************
* Pack RGB in 16 bits, for 65k color display mode
* [R4R3R2R1R0][G5G4G3G2G1G0][B4B3B2B1B0]
***********************************************************************************************
*/
#define RGB(r,g,b)	((INT16U)r<<11)+((INT16U)g<<5)+(INT8U)b

#define PIXEL_FONT_EN	1
#if		PIXEL_FONT_EN
#define MAX_FONT_WIDTH 	8
typedef struct _font
	{
		INT8U fontWidth;
		INT8U fontBody[MAX_FONT_WIDTH];
	}font;
#endif

/*
***********************************************************************************************
*								Pin definition, Keil C specific
*								Hardware: AT89S8253-cLCD-STK1
***********************************************************************************************
*/

sbit	cDISP_A0=		P2^1;
sbit	cDISP_WR=		P2^2;
sbit 	cDISP_RD=		P2^3;	
sbit 	cDISP_CS=		P2^4;	
sbit	cDISP_LM2665_SW=P2^5;
sbit	cDISP_RST=		P2^6;
sbit	cDISP_BL_PWR=	P2^7;

#define cDISP_DATA		P0

/*
***********************************************************************************************
*										GLOBAL CONSTANTS
***********************************************************************************************
*/

#define MAX_ROW_PIXEL		160		//MAX_ROW_PIXEL the physical matrix length (y dir, downward)									
#define MAX_COL_PIXEL		128		//MAX_COL_PIXEL the physical matrix width (x dir, left->right)
#define ENABLE				1
#define DISABLE				0

/*
***********************************************************************************************
*									FUNCTION PROTOTYPES
***********************************************************************************************
*/
void cDispInit(void);
void cDispSwitch(BOOLEAN sw);
void cDispClr(INT16U color);
void cDispSetPixel(INT8U x, INT8U y, INT16U color);
void cDisprPatAt(INT8U x, INT8U y, INT16U *pPat);
#if PIXEL_FONT_EN
void cDispStrAt(INT8U x, INT8U y, INT8U *pStr, INT8U fontSpace, INT16U color);
#endif
void cDispSetQuali(INT8U brightness, INT8U contrast);
/*
***********************************************************************************************
*									FUNCTION PROTOTYPES
*									 HARDWARE SPECIFIC
***********************************************************************************************
*/
void cDispInitPort(void);
void cDispWrCmd(INT8U cmd);
void cDispWrDat(INT8U dat);
void cDispBackLite(BOOLEAN ctrl);
#endif

⌨️ 快捷键说明

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