ILI9325初始化代码
2015-06-16 11:07
295 查看
void LCD_Init1(void) { unsigned int i; GPIO_ResetBits(GPIOE, GPIO_Pin_1); Delay(0xAFFff); GPIO_SetBits(GPIOE, GPIO_Pin_1 ); //V7 Delay(0xAFFff); //************* Start Initial Sequence **********// LCD_WR_CMD(0x0001, 0x0100); // set SS and SM bit LCD_WR_CMD(0x0002, 0x0700); // set 1 line inversion LCD_WR_CMD(0x0003, 0x1030); // set GRAM write direction and BGR=1. LCD_WR_CMD(0x0004, 0x0000); // Resize register LCD_WR_CMD(0x0008, 0x0207); // set the back porch and front porch LCD_WR_CMD(0x0009, 0x0000); // set non-display area refresh cycle ISC[3:0] LCD_WR_CMD(0x000A, 0x0000); // FMARK function LCD_WR_CMD(0x000C, 0x0000); // RGB interface setting LCD_WR_CMD(0x000D, 0x0000); // Frame marker Position LCD_WR_CMD(0x000F, 0x0000); // RGB interface polarity //*************Power On sequence ****************// LCD_WR_CMD(0x0010, 0x0000); // SAP, BT[3:0], AP, DSTB, SLP, STB LCD_WR_CMD(0x0011, 0x0007); // DC1[2:0], DC0[2:0], VC[2:0] LCD_WR_CMD(0x0012, 0x0000); // VREG1OUT voltage LCD_WR_CMD(0x0013, 0x0000); // VDV[4:0] for VCOM amplitude LCD_WR_CMD(0x0007, 0x0001); Delay(12000); // Dis-charge capacitor power voltage LCD_WR_CMD(0x0010, 0x1490); // SAP, BT[3:0], AP, DSTB, SLP, STB LCD_WR_CMD(0x0011, 0x0227); // DC1[2:0], DC0[2:0], VC[2:0] Delay(15500); // Delay 50ms LCD_WR_CMD(0x0012, 0x001C); // Internal reference voltage= Vci; Delay(15000); // Delay 50ms LCD_WR_CMD(0x0013, 0x1A00); // Set VDV[4:0] for VCOM amplitude LCD_WR_CMD(0x0029, 0x0025); // Set VCM[5:0] for VCOMH LCD_WR_CMD(0x002B, 0x000C); // Set Frame Rate Delay(15000); // Delay 50ms LCD_WR_CMD(0x0020, 0x0000); // GRAM horizontal Address LCD_WR_CMD(0x0021, 0x0000); // GRAM Vertical Address // ----------- Adjust the Gamma Curve ----------// LCD_WR_CMD(0x0030, 0x0000); LCD_WR_CMD(0x0031, 0x0506); LCD_WR_CMD(0x0032, 0x0104); LCD_WR_CMD(0x0035, 0x0207); LCD_WR_CMD(0x0036, 0x000F); LCD_WR_CMD(0x0037, 0x0306); LCD_WR_CMD(0x0038, 0x0102); LCD_WR_CMD(0x0039, 0x0707); LCD_WR_CMD(0x003C, 0x0702); LCD_WR_CMD(0x003D, 0x1604); //------------------ Set GRAM area ---------------// LCD_WR_CMD(0x0050, 0x0000); // Horizontal GRAM Start Address LCD_WR_CMD(0x0051, 0x00EF); // Horizontal GRAM End Address LCD_WR_CMD(0x0052, 0x0000); // Vertical GRAM Start Address LCD_WR_CMD(0x0053, 0x013F); // Vertical GRAM Start Address LCD_WR_CMD(0x0060, 0xA700); // Gate Scan Line LCD_WR_CMD(0x0061, 0x0001); // NDL,VLE, REV LCD_WR_CMD(0x006A, 0x0000); // set scrolling line //-------------- Partial Display Control ---------// LCD_WR_CMD(0x0080, 0x0000); LCD_WR_CMD(0x0081, 0x0000); LCD_WR_CMD(0x0082, 0x0000); LCD_WR_CMD(0x0083, 0x0000); LCD_WR_CMD(0x0084, 0x0000); LCD_WR_CMD(0x0085, 0x0000); //-------------- Panel Control -------------------// LCD_WR_CMD(0x0090, 0x0010); LCD_WR_CMD(0x0092, 0x0600); LCD_WR_CMD(0x0007, 0x0133); // 262K color and display ON LCD_WR_CMD(32, 0); LCD_WR_CMD(33, 0); *(__IO uint16_t *) (Bank1_LCD_C)= 34; //×¼±¸Ð´Êý¾ÝÏÔʾÇø for(i=0;i<76800;i++) { LCD_WR_Data(0xffff); //ÓúÚÉ«ÇåÆÁ } }
相关文章推荐
- 【第八章】 对ORM的支持 之 8.1 概述 ——跟我学spring3
- MQTT IM开发
- java指纹识别+谷歌图片识别技术
- eclipse中使用git
- 【第七章】 对JDBC的支持 之 7.5 集成Spring JDBC及最佳实践 ——跟我学spring3
- Java线程:线程的调度-守护线程
- Spring 注解方式 链接数据库
- 【第七章】 对JDBC的支持 之 7.4 Spring提供的其它帮助 ——跟我学spring3
- C#在子线程中更新窗口部件的写法
- 【第七章】 对JDBC的支持 之 7.3 关系数据库操作对象化 ——跟我学spring3
- java枚举
- 杂谈spring、springMVC
- Eclipse常用快捷键
- C#抽象方法的简单理解
- 【Heritrix基础教程】在Eclipse中配置Heritrix
- (转)windows 下 Java 及 Python 环境变量设置
- SpringMVC和Struts2的比较的优点
- 【第七章】 对JDBC的支持 之 7.1 概述 ——跟我学spring3
- HX8347-I_(T)初始化代码
- 【第六章】 AOP 之 6.9 代理机制 ——跟我学spring3