Lcd Moudle Driver Training§Lcd 介绍§硬件接口§软件处理流程LCD 介绍§液晶的特性§中常用的LCD 的产品液晶的特性§旋光性§双折射性§LCD,几乎都是利用了液晶的这两种性质制造而成 中常用的LCD 的产品§STN 特点是宽视角,大容量显示,缺点是响应速度慢(CSTN Color STN)§TFT 高对比度,高响应,宽视角,大容量显示,是主流产品§65K color 1pixel 16bit§260k color 1pixel 18bit硬件接口§串口(serial peripheral interface)§并口(high-speed parallel bus interfaces)串口(serial peripheral interface)§Low cost,lcd controller 性能低§超低端选用,一般用的不太多§Pin description RST resetSDI Serial input data.SDO Serial output data.SCLK Serial clock input并口(parallel bus interfaces)§成本较串口高,lcd controller 性能高§一般同时支持(SPI)pin IM[3:0] Selects the System interface mode.SPI Mode68 Moderead and write 共用,一根线select80 Moderead line write line 各一§Pin descriptionRSIBresetDB[15:0] data lineCSB chipset selectRS Selects the register.E_WRB write strobe signalRW_RDB read strobe signal软件处理流程§Address§Reset§Lcd controller initialize§Refresh display screen§Sleep in§Sleep outAddress§Baseband的片选,获的地址#define LCD_DRV_CS_BASE 0x01800000 /*CS4as the lcd cs*/#define LCD_DRV_CS_DATA_OFFSET 1/*ADD0 as the rs */§根据RS Pin获得相应的寄存器和数据的地址Low : Register Index High : Control dataRS 接A0#define LCD_DRV_ADDR_REG(*(volatile UINT16*)(LCD_DRV_CS_BASE))#define LCD_DRV_ADDR_DATA(*(volatile UINT16*)(LCD_DRV_CS_BASE + LCD_DRV_CS_DATA_OFFSET))#define LCD_DRV_WRITE_COMM(Addr, Data)LCD_DRV_ADDR_REG= (UINT16)Addr; \LCD_DRV_ADDR_DATA= (UINT16)DataReset§Initializes the LSI when low. §Must be reset after power-on.§通常连接到BB端的一个gpio上Lcd controller initialize§通过上一步得到的地址,对lcd相应的寄存器,发送相关的命令参数,配置lcd§初始化的序列一般都由LCD厂商提供。
§寄存器设置的方法// Set internalOSCfreq,use defaultLCD_DRV_WRITE_COMM(0x0061, 0x0018);/* Power control 1 set SLP bit = 1*/LCD_DRV_WRITE_COMM(0x0010, 0x1a0e);POWER CONTROL 1 (R10h)R/W RSIB15IB14IB13IB12IB11IB10IB9IB8IB7IB6IB5 IB4 IB3IB2IB1IB0W1DSTBXSAP2SAP1SAP0BT2BT1BT0DC2DC1DC0AP2AP1AP0SLPSTBRefresh display screen§设置刷屏的范围,不同的屏设置不同// Horizontalwindow addressLCD_DRV_WRITE_REG(0x0043);LCD_DRV_WRITE_REG(usStartx);LCD_DRV_WRITE_REG(usEndx);// Verticalwindow addressLCD_DRV_WRITE_REG(0x0042);LCD_DRV_WRITE_REG(usStarty);LCD_DRV_WRITE_REG(usEndy);§写数据用个for循环,调用下面的命令写入数据LCD_DRV_WRITE_DATA((UINT16)*disp_buf_addr);Sleep in§当在待机状态时,为了节约功耗,要把lcd进入睡眠模式§设置相关的寄存器/* Power control 1 set SLP bit = 1*/LCD_DRV_WRITE_COMM(0x0010,0x1a0e);Sleep out§当来电或者别的动作,退出待机状态要求显示屏幕时,要把lcd module唤醒,退出睡眠模式§设置相关的寄存器/* Power control 1 set SLP bit = 0*/LCD_DRV_WRITE_COMM(0x0010,0x1a0c);Thank you!。