#include "system.h"
#include "altera_avalon_pio_regs.h"
#include "alt_types.h"
#include "LCD.h"
int LGDP4532_init(void){
LCD_WRITE_CMD(0x0007);LCD_WRITE_DATA(0x0000);
LCD_WRITE_CMD(0x0012);LCD_WRITE_DATA(0x0000);
LCD_WRITE_CMD(0x0013);LCD_WRITE_DATA(0x0000);
Delayms(40);
// Power Set
LCD_WRITE_CMD(0x0010);LCD_WRITE_DATA(0x0600);
LCD_WRITE_CMD(0x0011);LCD_WRITE_DATA(0x0000);
LCD_WRITE_CMD(0x0012);LCD_WRITE_DATA(0x0005);
LCD_WRITE_CMD(0x0013);LCD_WRITE_DATA(0x1049);
LCD_WRITE_CMD(0x0015);LCD_WRITE_DATA(0x0030);
LCD_WRITE_CMD(0x0010);LCD_WRITE_DATA(0x1628);
LCD_WRITE_CMD(0x0012);LCD_WRITE_DATA(0x0013);
Delayms(40);
LCD_WRITE_CMD(0x0010);LCD_WRITE_DATA(0x2620);
LCD_WRITE_CMD(0x0013);LCD_WRITE_DATA(0x3052); //3049
Delayms(100);
// Other Set
LCD_WRITE_CMD(0x0001);LCD_WRITE_DATA(0x0100);
LCD_WRITE_CMD(0x0002);LCD_WRITE_DATA(0x0300);
LCD_WRITE_CMD(0x0003);LCD_WRITE_DATA(0x1030);
LCD_WRITE_CMD(0x0008);LCD_WRITE_DATA(0x0604);
LCD_WRITE_CMD(0x000A);LCD_WRITE_DATA(0x0008);
LCD_WRITE_CMD(0x0041);LCD_WRITE_DATA(0x0002);
LCD_WRITE_CMD(0x0060);LCD_WRITE_DATA(0xA700);
LCD_WRITE_CMD(0x0061);LCD_WRITE_DATA(0x0001);
LCD_WRITE_CMD(0x0090);LCD_WRITE_DATA(0x0178); //0184
LCD_WRITE_CMD(0x0092);LCD_WRITE_DATA(0x0105);
LCD_WRITE_CMD(0x0093);LCD_WRITE_DATA(0x0101);
LCD_WRITE_CMD(0x00A3);LCD_WRITE_DATA(0x0010);
Delayms(100);
// Gamma Set
LCD_WRITE_CMD(0x0030);LCD_WRITE_DATA(0x0201);
LCD_WRITE_CMD(0x0031);LCD_WRITE_DATA(0x0007);
LCD_WRITE_CMD(0x0032);LCD_WRITE_DATA(0x0101);
LCD_WRITE_CMD(0x0033);LCD_WRITE_DATA(0x0000);
LCD_WRITE_CMD(0x0034);LCD_WRITE_DATA(0x0004);
LCD_WRITE_CMD(0x0035);LCD_WRITE_DATA(0x0002);
LCD_WRITE_CMD(0x0036);LCD_WRITE_DATA(0x0604);
LCD_WRITE_CMD(0x0037);LCD_WRITE_DATA(0x0000);
LCD_WRITE_CMD(0x0038);LCD_WRITE_DATA(0x0718);
LCD_WRITE_CMD(0x0039);LCD_WRITE_DATA(0x0000);
LCD_WRITE_CMD(0x003A);LCD_WRITE_DATA(0x0200);
LCD_WRITE_CMD(0x003B);LCD_WRITE_DATA(0x0000);
LCD_WRITE_CMD(0x003C);LCD_WRITE_DATA(0x0300);
LCD_WRITE_CMD(0x003D);LCD_WRITE_DATA(0x0002);
LCD_WRITE_CMD(0x003E);LCD_WRITE_DATA(0x0001);
LCD_WRITE_CMD(0x003F);LCD_WRITE_DATA(0x0000);
Delayms(40);
//Display On Sequence
LCD_WRITE_CMD(0x0007);LCD_WRITE_DATA(0x0001);
LCD_WRITE_CMD(0x0007);LCD_WRITE_DATA(0x0021);
LCD_WRITE_CMD(0x0007);LCD_WRITE_DATA(0x0023);
LCD_WRITE_CMD(0x0007);LCD_WRITE_DATA(0x0133);
LCD_WRITE_CMD(0x0022);
}
阅读(2069) | 评论(0) | 转发(0) |