?? lcd.h
字號:
/***********************************************/
// 定義LCD控制器寄存器設(shè)置值等。
/***********************************************/
#ifndef __LCD_H__
#define __LCD_H__
/* 屏象素點大小 */
#define SCR_XSIZE (640)
#define SCR_YSIZE (480)
#define LCD_XSIZE (640)
#define LCD_YSIZE (480)
/* 取后21位 */
#define M5D(n) ((n) & 0x1fffff)
/* LCD CONTROLLER SPECIAL REGISTERS */
/* LCD Control 1 Register */
/* VCLK頻率 */
#define CLKVAL (13)//
/* VLINE脈沖寬度(系統(tǒng)時鐘為時間單位) */
#define WLH (3)
/* VLINE和VCLK之間的延時(系統(tǒng)時鐘為時間單位) */
#define WDLY (3)
/* VM翻轉(zhuǎn)頻率 */
#define MMODE (0)
/* 雙4位單掃描 */
#define DISMODE (0)
/* VCLK決定數(shù)據(jù)在哪種邊沿下被讀取 */
#define INVCLK (0)
/* VLINE脈沖極性 */
#define INVLINE (0)
/* VFRAME脈沖極性*/
#define INVFRAME (0)
/* VD數(shù)據(jù)極性*/
#define INVVD (0)
/* 使能視頻輸出和邏輯 */
#define ENABLE (1)
/* 禁止視頻輸出和邏輯 */
#define DISABLE (0)
/* LCD Control 2 Register */
/* 行空白時間長度 */
#define LINEBLANK (10)
/* 屏水平像素點個數(shù) */
#define HOZVAL (SCR_XSIZE / 4 - 1)
/* 屏垂直像素點個數(shù) */
#define LINEVAL (SCR_YSIZE / 2 - 1)
/* LCD Control 3 Register */
/* LCD自刷新模式使能 */
#define SELFREF (0)
/* FRAME BUFFER START ADDRESS 1 REGISTER */
/* 顯示模式選擇:0:黑白 2:16級*/
#define MODESEL (2)
/* 這些位指示視頻緩沖區(qū)在系統(tǒng)存儲器的段地址A[27:22] */
//#define LCDBANK(0)
/* LCDBASEU [20:0]這些位指示幀緩沖區(qū)或在雙掃描LCD時的上幀緩沖區(qū)的開始地址 A[21:1] */
//#define LCDBASEU (0)
/* FRAME Buffer Start Address 2 Register*/
/* 字節(jié)交換控制位 */
#define BSWP (0)
/* MMODE為1時,VM翻轉(zhuǎn)的頻率 */
#define MVAL (0)
/* the start address of the lower address counter */
//#define LCDBASEL (LCDBASEU + (PAGEWIDTH + OFFSIZE ) * (LINEVAL +1))
/* LCD寄存器地址 */
#define rLCDCON1 (*(volatile unsigned *)0x1f00000)
#define rLCDCON2 (*(volatile unsigned *)0x1f00004)
#define rLCDCON3 (*(volatile unsigned *)0x1f00040)
#define rLCDSADDR1 (*(volatile unsigned *)0x1f00008)
#define rLCDSADDR2 (*(volatile unsigned *)0x1f0000c)
#define rLCDSADDR3 (*(volatile unsigned *)0x1f00010)
#define rREDLUT (*(volatile unsigned *)0x1f00014)
#define rGREENLUT (*(volatile unsigned *)0x1f00018)
#define rBLUELUT (*(volatile unsigned *)0x1f0001c)
#define rDP1_2 (*(volatile unsigned *)0x1f00020)
#define rDP4_7 (*(volatile unsigned *)0x1f00024)
#define rDP3_5 (*(volatile unsigned *)0x1f00028)
#define rDP2_3 (*(volatile unsigned *)0x1f0002c)
#define rDP5_7 (*(volatile unsigned *)0x1f00030)
#define rDP3_4 (*(volatile unsigned *)0x1f00034)
#define rDP4_5 (*(volatile unsigned *)0x1f00038)
#define rDP6_7 (*(volatile unsigned *)0x1f0003c)
#define rDITHMODE (*(volatile unsigned *)0x1f00044)
#define rPDATD (*(volatile unsigned *)0x01d20020)
/* IO寄存器地址 */
#define rPCOND (*(volatile unsigned *)0x1d2001c)
#define rPCONC (*(volatile unsigned *)0x1d20010)
/*
LCD的初始化。
*/
void Lcd_Init(void);
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -