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

📄 lcdapp.c

📁 完整的原创单片机控制彩色液晶源代码(keil工程) 320x240液晶模块底层驱动 控制芯片5408 CPU LPC2131(or Higher) 开发环境 keil C for ARM (MDK
💻 C
字号:
//#include <LPC213x.h>
#include <stdio.h>

#include "Delay.h"	//此文件包含操作GPIO的宏定义

#include "LCD.h"

#include "LCDApp.h"

void LcdInit(void)
{
	unsigned int i;

	SendCD(0x00010100);				//Driver Output Contral Register 
   	SendCD(0x00020700);    //0x0701	//LCD Driving Waveform Contral
  	SendCD(0x00031030);				//Entry Mode设置
  												//指针从左至右自上而下的自动增模式
  												//Normal Mode(Window Mode disable)
  												//RGB格式
  												//16位数据2次传输的8总线设置
   	SendCD(0x00040000);				//Scalling Control register
   	SendCD(0x00080207);				//Display Control 2
   	SendCD(0x00090000);				//Display Control 3
   	SendCD(0x000A0000);				//Frame Cycle Control
   	SendCD(0x000C0000);				//External Display Interface Control 1
    SendCD(0x000D0000);				//Frame Maker Position
   	SendCD(0x000F0000);				//External Display Interface Control 2
   	Delay_Macro(DelayTime,i);
   	SendCD(0x00070101);				//Display Control
   	Delay_Macro(DelayTime,i);
   	SendCD(0x001016B0);    //0x14B0	//Power Control 1
   	SendCD(0x00110001);    //0x0007	//Power Control 2
   	SendCD(0x00170001);    //0x0000	//Power Control 3
   	SendCD(0x00120138);    //0x013B	//Power Control 4
   	SendCD(0x00130800);    //0x0800	//Power Control 5
   	SendCD(0x00290009);				//NVM read data 2
   	SendCD(0x002a0009);				//NVM read data 3
   	SendCD(0x00a40000);

   	SendCD(0x00500000);				//设置操作窗口的X轴开始列
   	SendCD(0x005100EF);				//设置操作窗口的X轴结束列
   	SendCD(0x00520000);				//设置操作窗口的Y轴开始行
   	SendCD(0x0053013F);				//设置操作窗口的Y轴结束行
   	SendCD(0x00602700);				//Driver Output Control
   												//设置屏幕的点数以及扫描的起始行
   	SendCD(0x00610001);				//Driver Output Control
   	SendCD(0x006A0000);				//Vertical Scroll Control
   	//-------------- Partial Display Control ---------//
   	SendCD(0x00800000);				//Display Position – Partial Display 1
   	SendCD(0x00810000);				//RAM Address Start – Partial Display 1
   	SendCD(0x00820000);				//RAM address End - Partial Display 1
   	SendCD(0x00830000);				//Display Position – Partial Display 2
   	SendCD(0x00840000);				//RAM Address Start – Partial Display 2
   	SendCD(0x00850000);				//RAM address End – Partail Display2
	//-------------- Panel Control -------------------//
   	SendCD(0x00900013);				//Frame Cycle Control
   	SendCD(0x00920000);				//Panel Interface Control 2
   	SendCD(0x00930003);				//Panel Interface control 3
   	SendCD(0x00950110);				//Frame Cycle Control
	SendCD(0x00970000);
    SendCD(0x00980000);

   	SendCD(0x00070173);
}

void DispOneColor(unsigned int Color)
{
    unsigned int i;//,j;
    SendCD(0x00200000);        //行首址0
    SendCD(0x00210000);        //列首址0
    SendCom(0x22);
    for(i=0;i<(240*320);i++)
		SendDat(Color);
}

⌨️ 快捷键说明

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