uint16_t TouchPanel_GetY(void) { uint16_t temp = 0x00; LCD_CmdWrite(0x73); temp = LCD_DataRead(); temp <<= 2; LCD_CmdWrite(0x74); temp |= (LCD_DataRead() & 0x0c) >> 2; return temp; }
void DMA_Start(bool start) { uint8_t temp = 0x00; LCD_CmdWrite(0xbf); if(start) temp = LCD_DataRead() | cSetD0; else temp = LCD_DataRead(); LCD_DataWrite(temp); }
void SerialFlash_DataLatchModeSet(uint8_t mode) { uint8_t temp = 0x00; LCD_CmdWrite(0x05); temp = LCD_DataRead()| (mode & 0x03); LCD_DataWrite(temp); }
void SerialFlash_DMAModeSet(void) { uint8_t temp = 0x00; LCD_CmdWrite(0x05); temp = LCD_DataRead()|(cSetD2); LCD_DataWrite(temp); }
void SerialFlash_Select(uint8_t option) { uint8_t temp = 0x00; LCD_CmdWrite(0x05); temp = LCD_DataRead()|(option & cSetD7); LCD_DataWrite(temp); }
void Draw_CircleStart(bool start) { uint8_t temp = 0x00; LCD_CmdWrite(0x90); temp = LCD_DataRead(); LCD_DataWrite(cSetD6 | (temp & cClrD7)); }
void SerialFlash_Read5Bus(void) { uint8_t temp = 0x00; LCD_CmdWrite(0x05); temp = (LCD_DataRead()|cSetD3)& cClrD4; LCD_DataWrite(temp); }
void Draw_LSTStart(bool start) { uint8_t temp = 0x00; LCD_CmdWrite(0x90); temp = LCD_DataRead(); LCD_DataWrite(cSetD7 | (temp & cClrD6)); while(!Draw_LSTComplete()); }
///////////////check dma busy void Chk_DMA_Busy(void) { uchar temp; do { LCD_CmdWrite(0xBF); temp =LCD_DataRead(); }while((temp&0x01)==0x01); }
void FontCtl_Enlarge(uint8_t xdir, uint8_t ydir) { uint8_t temp = 0; if(xdir<=3&&ydir<=3) { LCD_CmdWrite(0x22); temp = LCD_DataRead()|((xdir << 2)|ydir); LCD_CmdWrite(0x22); LCD_DataWrite(temp); } }
////////////////////BTE starting position void BTE_Source(uint SX,uint DX ,uint SY ,uint DY) { uchar temp,temp1; temp=SX; LCD_CmdWrite(0x54);//BTE horizontal position of read/write data LCD_DataWrite(temp); temp=SX>>8; LCD_CmdWrite(0x55);//BTE horizontal position of read/write data LCD_DataWrite(temp); temp=DX; LCD_CmdWrite(0x58);//BET written to the target horizontal position LCD_DataWrite(temp); temp=DX>>8; LCD_CmdWrite(0x59);//BET written to the target horizontal position LCD_DataWrite(temp); temp=SY; LCD_CmdWrite(0x56);//BTE vertical position of read/write data LCD_DataWrite(temp); temp=SY>>8; LCD_CmdWrite(0x57); temp1 = LCD_DataRead(); temp1 &= 0x80; temp=temp|temp1; LCD_CmdWrite(0x57);//BTE vertical position of read/write data LCD_DataWrite(temp); temp=DY; LCD_CmdWrite(0x5a);//BET written to the target vertical position LCD_DataWrite(temp); temp=DY>>8; LCD_CmdWrite(0x5b); temp1 = LCD_DataRead(); temp1 &= 0x80; temp=temp|temp1; LCD_CmdWrite(0x5b);//BET written to the target vertical position LCD_DataWrite(temp); }
void Backlight_PWM2DasableLevelSelect(bool low) { uint8_t temp = 0x00; LCD_CmdWrite(0x8c); temp = LCD_DataRead(); if(low) { LCD_DataWrite(cSetD6&temp); } else { LCD_DataWrite(cClrD6|temp); } }
void Draw_ECSFill(bool fill) { uint8_t temp = 0x00; LCD_CmdWrite(0xa0); temp = LCD_DataRead(); if(fill) { LCD_DataWrite(temp | cSetD6); } else { LCD_DataWrite(temp & cClrD6); } }
//0xa0: Draw Ellipse/Ellipse Curve/ Circle Squrare Contral Register void Draw_ECSStart(bool start) { uint8_t temp = 0x00; LCD_CmdWrite(0xa0); temp = LCD_DataRead(); if(start) { LCD_DataWrite(temp | cSetD7); } else { LCD_DataWrite(temp & cClrD7); } }
void Draw_CSTFill(bool fill) { uint8_t temp = 0x00; LCD_CmdWrite(0x90); temp = LCD_DataRead(); if(fill) { LCD_DataWrite(cSetD5 | temp); } else { LCD_DataWrite(cClrD5 & temp); } }
void Backlight_PWM2FunctionSelect(bool backlight) { uint8_t temp = 0x00; LCD_CmdWrite(0x8c); temp = LCD_DataRead(); if(backlight) { LCD_DataWrite(cSetD6&temp); } else { LCD_DataWrite(cClrD6|temp); } }
//0x8c: PWM2 Control Regiister (P2CR) //0x8d: PWM2 Duty Cycle Register (P2DCR) void Backlight_PWM2Enable(bool en) { uint8_t temp = 0x00; LCD_CmdWrite(0x8c); temp = LCD_DataRead(); if(en) { LCD_DataWrite(cSetD7|temp); } else { LCD_DataWrite(cClrD7&temp); } }
//0x20: Display Configuration Register (DPCR) void LCD_LayerMode(bool oneLayer) { uint8_t temp = 0; LCD_CmdWrite(0x20);//DPCR temp = LCD_DataRead(); if(oneLayer) { temp &= cClrD7 ; } else { temp |= cSetD7; } LCD_DataWrite(temp); }
//0x21: Font Control Register0 (FNCR0) void FontCtl_ExternelCGROMEnable(bool en) { uint8_t temp = 0x00; LCD_CmdWrite(0x21); temp = LCD_DataRead(); if(en) { LCD_DataWrite(0x20|temp); } else { LCD_DataWrite(cClrD4&temp); } }
void FontCtl_Rotate(bool rotate) { uint8_t temp; LCD_CmdWrite(0x22);//FNCR0 temp = LCD_DataRead(); if(rotate) { temp |= cSetD4; } else { temp &= cClrD4; } LCD_CmdWrite(0x22); LCD_DataWrite(temp); }
void FontCtl_ShowBackgroundColor(bool show) { uint8_t temp; LCD_CmdWrite(0x22);//FNCR0 temp = LCD_DataRead(); if(show) { temp |= cSetD6; } else { temp &= cClrD6; } LCD_CmdWrite(0x22); LCD_DataWrite(temp); }
//0x22: Font Control Register1 (FNCR1) void FontCtl_FullAlignment(bool full) { uint8_t temp; LCD_CmdWrite(0x22);//FNCR0 temp = LCD_DataRead(); if(full) { temp |= cSetD7; } else { temp &= cClrD7; } LCD_CmdWrite(0x22); LCD_DataWrite(temp); }
static uint8_t LCD_read_reg(uint8_t reg) { LCD_CmdWrite(reg); return LCD_DataRead(); }
bool Draw_CircleComplete(void) { LCD_CmdWrite(0x90); return ((LCD_DataRead() & cSetD6) == 0x00); }
void Draw_ECurvePartSelect(uint8_t part) { LCD_CmdWrite(0xa0); LCD_DataWrite((part & 0x03)|LCD_DataRead()); }
bool TouchPanel_CheckTouch(void) { LCD_CmdWrite(0xf1); return ((LCD_DataRead() & cSetD2)==cSetD2); }
bool Draw_ECSComplete(void) { LCD_CmdWrite(0xa0); return ((LCD_DataRead() & cSetD7)==0x00); }