📄 ra8806.c
字号:
//Subroutine: Access_Page1
//Function:
//==============================================================================
void Access_Page1(void)
{
uchar temp;
LCD_CmdWrite(MAMR);
temp = LCD_DataRead();
temp &= cClrb1;
temp |= cSetb0;
LCD_CmdWrite(MAMR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Access_2Page
//Function:
//==============================================================================
void Access_2Page(void)
{
uchar temp;
LCD_CmdWrite(MAMR);
temp = LCD_DataRead();
temp |= cSetb1;
temp |= cSetb0;
LCD_CmdWrite(MAMR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Two_Layer_OR
//Function:
//==============================================================================
void Two_Layer_OR(void)
{
uchar temp;
LCD_CmdWrite(MAMR);
temp = LCD_DataRead();
temp &= cClrb3;
temp &= cClrb2;
LCD_CmdWrite(MAMR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Two_Layer_XOR
//Function:
//==============================================================================
void Two_Layer_XOR(void)
{
uchar temp;
LCD_CmdWrite(MAMR);
temp = LCD_DataRead();
temp &= cClrb3;
temp |= cSetb2;
LCD_CmdWrite(MAMR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Two_Layer_NOR
//Function:
//==============================================================================
void Two_Layer_NOR(void)
{
uchar temp;
LCD_CmdWrite(MAMR);
temp = LCD_DataRead();
temp |= cSetb3;
temp &= cClrb2;
LCD_CmdWrite(MAMR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Two_Layer_XOR
//Function:
//==============================================================================
void Two_Layer_AND(void)
{
uchar temp;
LCD_CmdWrite(MAMR);
temp = LCD_DataRead();
temp |= cSetb3;
temp |= cSetb2;
LCD_CmdWrite(MAMR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: LCD_PrintStr 1
//Function:
//==============================================================================
void LCD_PrintStrD100ms(uchar *ptr, uchar x, uchar y, uchar time)
{
LCD_GotoXY(x, y);
while(*ptr != 0)
{
LCD_DataWrite(*ptr);
ptr++;
Delay100ms(time);
}
}
//==============================================================================
//Subroutine: LCD_PrintStr 2
//Function:
//==============================================================================
void LCD_PrintStr(uchar *ptr, uchar cXSize)
{
uchar temp;
LCD_CmdWrite(0xB0);
for(temp=0 ; temp<cXSize ; temp++)
{
LCD_DataWrite(*ptr);
Delay2us(50);
ptr++;
}
}
//==============================================================================
//Subroutine: LCD_PrintStr 2
//Function:
//==============================================================================
void LCD_PrintStr_Delay_100us(uchar *ptr, uchar cXSize, uchar Delay_time)
{
uchar temp;
LCD_CmdWrite(0xB0);
for(temp=0 ; temp<cXSize ; temp++)
{
LCD_DataWrite(*ptr);
Delay100us(Delay_time);
ptr++;
}
}
//==============================================================================
//Subroutine: LCD_PrintStr 2
//Function:
//==============================================================================
void LCD_PrintStr_Delay_100ms(uchar *ptr, uchar cXSize, uchar Delay_time)
{
uchar temp;
LCD_CmdWrite(0xB0);
for(temp=0 ; temp<cXSize ; temp++)
{
LCD_DataWrite(*ptr);
Delay100ms(Delay_time);
ptr++;
}
}
//==============================================================================
//Subroutine: Bold
//Function:
//==============================================================================
void LCD_Bold(void)
{
uchar temp;
LCD_CmdWrite(WCCR);
temp = LCD_DataRead();
temp |= cSetb4;
LCD_CmdWrite(WCCR);
LCD_DataWrite(temp);
}
void LCD_NoBold(void)
{
uchar temp;
LCD_CmdWrite(WCCR);
temp = LCD_DataRead();
temp &= cClrb4;
LCD_CmdWrite(WCCR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Inv
//Function:
//==============================================================================
void LCD_Inv(void)
{
uchar temp;
LCD_CmdWrite(WCCR);
temp = LCD_DataRead();
temp |= cSetb5; //@@@@@@@@@@@@@@
LCD_CmdWrite(WCCR);
LCD_DataWrite(temp);
}
void LCD_NoInv(void)
{
uchar temp;
LCD_CmdWrite(WCCR);
temp = LCD_DataRead();
temp &= cClrb5; //@@@@@@@@@@@@@@
LCD_CmdWrite(WCCR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: GInv
//Function:
//==============================================================================
void LCD_GInv(void)
{
uchar temp;
LCD_CmdWrite(WLCR);
temp = LCD_DataRead();
temp |= cSetb0;
LCD_CmdWrite(WLCR);
LCD_DataWrite(temp);
}
void LCD_NoGInv(void)
{
uchar temp;
LCD_CmdWrite(WLCR);
temp = LCD_DataRead();
temp &= cClrb0;
LCD_CmdWrite(WLCR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Set_Bit_Order
//Function:
//==============================================================================
void Set_Bit_Order(void)
{
uchar temp;
LCD_CmdWrite(ADSR);
temp = LCD_DataRead();
temp |= cSetb3;
LCD_CmdWrite(ADSR);
LCD_DataWrite(temp);
}
void Clr_Bit_Order(void)
{
uchar temp;
LCD_CmdWrite(ADSR);
temp = LCD_DataRead();
temp &= cClrb3;
LCD_CmdWrite(ADSR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Show Hex
//Function:
//==============================================================================
void Print_Hex(uchar buf)
{
uchar temp;
temp=buf;
temp = (temp >>4) & 0x0F;
if(temp < 0x0A)
{
temp |= 0x30;
}
else temp = temp + 0x37;
LCD_DataWrite(temp);
Delay1ms(1);
temp=buf;
temp = temp & 0x0F;
if(temp < 0x0A)
{
temp |= 0x30;
}
else temp = temp + 0x37;
LCD_DataWrite(temp);
Delay1ms(1);
}
//==============================================================================
//Subroutine: Fill_PNTR_to_DPRAM
//Function:
//==============================================================================
void Fill_PNTR_to_DPRAM(void)
{
uchar temp;
LCD_CmdWrite(FNCR);
temp = LCD_DataRead();
temp |= cSetb3;
LCD_CmdWrite(FNCR);
LCD_DataWrite(temp);
do{
Delay2us(1);
}while(LCD_CmdRead() & 0x80);
}
//==============================================================================
//Subroutine: Enable_KeyScan_INT
//Function:
//==============================================================================
void Enable_KeyScan_INT(void)
{
uchar temp;
LCD_CmdWrite(INTR);
temp = LCD_DataRead();
temp |= cSetb3;
LCD_CmdWrite(INTR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Enable_KeyScan
//Function:
//==============================================================================
void Enable_KeyScan(void)
{
uchar temp;
LCD_CmdWrite(KSCR1);
temp = LCD_DataRead();
temp |= cSetb7;
LCD_CmdWrite(KSCR1);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Enable_KeyScan
//Function:
//==============================================================================
void Disable_KeyScan(void)
{
uchar temp;
LCD_CmdWrite(KSCR1);
temp = LCD_DataRead();
temp &= cClrb7;
LCD_CmdWrite(KSCR1);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Enable_KeyScan_WakeUp
//Function:
//==============================================================================
void Enable_KeyScan_WakeUp(void)
{
uchar temp;
LCD_CmdWrite(KSCR2);
temp = LCD_DataRead();
temp |= cSetb7;
LCD_CmdWrite(KSCR2);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Disable_KeyScan_WakeUp
//Function:
//==============================================================================
void Disable_KeyScan_WakeUp(void)
{
uchar temp;
LCD_CmdWrite(KSCR2);
temp = LCD_DataRead();
temp &= cClrb7;
LCD_CmdWrite(KSCR2);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Clr_KeyScan_INT_Flag
//Function:
//==============================================================================
void Clr_KeyScan_INT_Flag(void)
{
uchar temp;
LCD_CmdWrite(INTR);
temp = LCD_DataRead();
temp = temp & 0xfd;
LCD_CmdWrite(INTR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Clr_Wakeup_INT_Flag
//Function:
//==============================================================================
void Clr_Wakeup_INT_Flag(void)
{
uchar temp;
LCD_CmdWrite(INTR);
temp = LCD_DataRead();
temp = temp & 0xfb;
LCD_CmdWrite(INTR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Get_Key
//Function:
//==============================================================================
uchar Get_Key(void)
{
uchar temp;
LCD_CmdWrite(INTR);
temp = LCD_DataRead();
temp = temp & 0x02;
if(temp == 0)
return 0;
else
return 1;
}
//==============================================================================
//Subroutine: Blk
//Function:
//==============================================================================
void LCD_Blk(void)
{
uchar temp;
LCD_CmdWrite(WLCR);
temp = LCD_DataRead();
temp |= cSetb1;
LCD_CmdWrite(WLCR);
LCD_DataWrite(temp);
}
void LCD_NoBlk(void)
{
uchar temp;
LCD_CmdWrite(WLCR);
temp = LCD_DataRead();
temp &= cClrb1;
LCD_CmdWrite(WLCR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Blk Timer
//Function:
//==============================================================================
void LCD_BlkTim(uchar buf)
{
uchar temp;
LCD_CmdWrite(BTMR);
temp = LCD_DataRead();
temp |= buf;
LCD_CmdWrite(BTMR);
LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine: Cursor On
//Function:
//==============================================================================
void LCD_Cur(void)
{
uchar temp;
LCD_CmdWrite(WCCR);
temp = LCD_DataRead();
temp |= cSetb2;
LCD_CmdWrite(WCCR);
LCD_DataWrite(temp);
}
void LCD_NoCur(void)
{
uchar temp;
LCD_CmdWrite(WCCR);
temp = LCD_DataRead();
temp &= cClrb2;
LCD_CmdWrite(WCCR);
LCD_DataWrite(temp);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -