Skip to content

Instantly share code, notes, and snippets.

@fanoush
Created June 19, 2019 18:40
Show Gist options
  • Select an option

  • Save fanoush/ec7bd1c5e0fa4d8d83604a3f51d4eee2 to your computer and use it in GitHub Desktop.

Select an option

Save fanoush/ec7bd1c5e0fa4d8d83604a3f51d4eee2 to your computer and use it in GitHub Desktop.
void LCD_Init(void)
{
GPIO_CfgPinOutput(5);
GPIO_CfgPinOutput(6);
GPIO_CfgPinOutput(0x1d);
GPIO_CfgPinOutput(0x10);
_DAT_5000050c = 0x10000; /* clear D16 */
GPIO_ConfOutput4_28();
D4_PulseZero50ms();
SPILCD_SendCMD(0xae);
SPILCD_SendCMD(0);
SPILCD_SendCMD(0x10);
SPILCD_SendCMD(0xb0);
SPILCD_SendCMD(0x81);
SPILCD_SendCMD(0x14);
SPILCD_SendCMD(0x20);
SPILCD_SendCMD(0xa0);
SPILCD_SendCMD(0xc0);
SPILCD_SendCMD(0xa4);
SPILCD_SendCMD(0xa6);
SPILCD_SendCMD(0xa8);
SPILCD_SendCMD(0x3f);
SPILCD_SendCMD(0xd3);
SPILCD_SendCMD(0x60);
SPILCD_SendCMD(0xd5);
SPILCD_SendCMD(0x51);
SPILCD_SendCMD(0xd9);
SPILCD_SendCMD(0x22);
SPILCD_SendCMD(0xdb);
SPILCD_SendCMD(0x35);
SPILCD_SendCMD(0xad);
SPILCD_SendCMD(0x81);
SPILCD_SendCMD(0xaf);
memclear(&LCD_Buffer,0x400);
LCD_Fill(0);
return;
}
void LCD_Fill(undefined4 value)
{
byte page;
byte col;
page = 0;
do {
SPILCD_SendCMD((uint)(byte)(page + 0xb0));
SPILCD_SendCMD(0);
SPILCD_SendCMD(0x10);
col = 0;
do {
SPI_SendData(value);
col = col + 1;
} while (col < 0x40);
page = page + 1;
} while (page < 0x10);
return;
}
void LCD_ShowArrow(void)
{
byte *pbVar1;
byte pageNo;
byte col;
int iVar2;
ClearFrame();
FUN_0007877c(0x14,0x3c,&DAT_0007d186,0x19,0x38,0,0,0x19,0x38);
iVar2 = 0x1c0;
pageNo = 7; // start on page 7 - only bottom half pages 7 to 15
do {
SPILCD_SendCMD((uint)(byte)(pageNo + 0xb0));
SPILCD_SendCMD(0);
SPILCD_SendCMD(0x10);
col = 0;
do {
pbVar1 = &LCD_Buffer + iVar2;
iVar2 = iVar2 + 1;
SPI_SendData((uint)*pbVar1);
col = col + 1;
} while (col < 0x40);
pageNo = pageNo + 1;
} while (pageNo < 0x10);
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment