资源描述:
《240320触摸屏液晶ili9325驱动程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、/***********************************************************************ILI9325TFT彩屏驱动程序***********************************************************************文件名:ILI9325.c*描述:*公司:爱晶电子*作者日期注释*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2、~~~~~~~~*王伟民2010/3/20原始文件********************************************************************/#include"stc.h"//#include #include"ILI9325.h"#include"delay.h"//=============================================================//TFT初始化//功能:该函数用于初始化TFT
3、彩屏模块。//入口参数:无//出口参数:无voidILI9325_initial(void){TFT_CS=1;delayms(5);TFT_RST=0;delayms(5);TFT_RST=1;delayms(50);//可以适当调整延时,保障稳定显示write_cmd_data(0x0001,0x0100);//源扫描设置SS=0,输出的移动方向是从S1到S720//(源扫描设置SS=1,输出的移动方向是从S720到S1) //SM=0,逐行扫描(SM=1,隔行扫描)write_cmd_data
4、(0x0002,0x0700);//B/C=1、EOR=1:行倒置(B/C=0:帧/场倒置)write_cmd_data(0x0003,0x1030);//AM=0,地址在水平方向自动加1//I/D[1:0]=11:水平垂直方向均增加//BGR=1:采用BGR格式//TRI=0、DFM=*:8位机、两次数据传送write_cmd_data(0x0004,0x0000);//比例缩放设置:不缩放//显示控制write_cmd_data(0x0008,0x0207);//设置后边沿和前沿write_cm
5、d_data(0x0009,0x0000);//设置非显示区时间间隔ISC[3:0]write_cmd_data(0x000A,0x0000);//帧标记功能 write_cmd_data(0x000C,0x0000);//RGB显示接口控制1write_cmd_data(0x000D,0x0000);//帧标记位置write_cmd_data(0x000F,0x0000);//RGB显示接口控制2//电源配置write_cmd_data(0x0010,0x0000);write_cmd_data(
6、0x0011,0x0007);write_cmd_data(0x0012,0x0000);write_cmd_data(0x0013,0x0000);//vghwrite_cmd_data(0x0010,0x1290); write_cmd_data(0x0011,0x0227);//delayms(100);//vregioutwrite_cmd_data(0x0012,0x001d);//0x001b//delayms(100);//vomamplitudewrite_cmd_data(0x00
7、13,0x1500);//delayms(100);//vomHwrite_cmd_data(0x0029,0x0018);write_cmd_data(0x002B,0x000D);//伽马校正write_cmd_data(0x0030,0x0004);write_cmd_data(0x0031,0x0307);write_cmd_data(0x0032,0x0002);//0006 write_cmd_data(0x0035,0x0206);write_cmd_data(0x0036,0x040
8、8);write_cmd_data(0x0037,0x0507);write_cmd_data(0x0038,0x0204);//0200write_cmd_data(0x0039,0x0707);write_cmd_data(0x003C,0x0405);//0504write_cmd_data(0x003D,0x0F02);//窗口设置write_cmd_data(0x0050,0x0000);//水平起始位置write_cmd_data(0x0051,0x00E