|
发表于 2022-8-1 11:30:47
|
显示全部楼层
- void Write_Dgus(u16 Dgus_Addr,u16 Val)
- u16 Read_Dgus(u16 Dgus_Addr)
- //===========================
- u16 Read_Dgus(u16 Dgus_Addr)
- { u16 R_Dgus=0;
- EA = 0;ADR_H = 0x00;
- ADR_M = (u8)((Dgus_Addr/2)>>8);
- ADR_L = (u8)(Dgus_Addr/2);
- RAMMODE = 0xAF; while(!APP_ACK); //读操作
- APP_EN = 1; while(APP_EN);
- if(Dgus_Addr%2) R_Dgus = (DATA1<<8)+DATA0;
- else R_Dgus=(DATA3<<8)+DATA2;
- RAMMODE = 0; EA = 1; return R_Dgus;
- }
- //=================================
- void Write_Dgus(u16 Dgus_Addr,u16 Val)
- { EA = 0;ADR_H = 0x00;
- ADR_M = (u8)((Dgus_Addr/2)>>8);
- ADR_L = (u8)(Dgus_Addr/2);
- RAMMODE = 0xAF;while(!APP_ACK); //读操作
- APP_EN = 1;while(APP_EN);RAMMODE = 0;
- ADR_M = (u8)((Dgus_Addr/2)>>8);
- ADR_L = (u8)(Dgus_Addr/2);
- RAMMODE = 0x8F;while(!APP_ACK); //写操作
- if(Dgus_Addr%2){DATA1=(u8)(Val>>8);DATA0=(u8)(Val);}
- else {DATA3=(u8)(Val>>8);DATA2=(u8)(Val);}
- APP_EN = 1; while(APP_EN);RAMMODE = 0;
- EA = 1;
- }
- 把页面切换到10页
- Write_Dgus(0x0085,0x000A);
- Write_Dgus(0x0084,0x5A01);
复制代码
|
|