⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ra8806.c

📁 Radio公司的最新控制器RA8806只要一条命令就可以实现硬件上90度的滚屏效果
💻 C
📖 第 1 页 / 共 4 页
字号:
}

//==============================================================================
//Subroutine:	Align On
//Function:
//==============================================================================
void LCD_AlignOn(void)
{
	uchar temp;
	
	LCD_CmdWrite(WCCR);
	temp = LCD_DataRead();
	temp |= cSetb6;
	LCD_CmdWrite(WCCR);
	LCD_DataWrite(temp);
}

void LCD_AlignOff(void)
{
	uchar temp;

	LCD_CmdWrite(WCCR);
	temp = LCD_DataRead();
	temp &= cClrb6;
	LCD_CmdWrite(WCCR);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	Auto Fill 
//Function:
//==============================================================================
void LCD_FillOn(void)
{
	uchar temp;

	LCD_CmdWrite(FNCR);
	temp = LCD_DataRead();
	temp |= cSetb3;
	LCD_CmdWrite(FNCR);
	LCD_DataWrite(temp);
}
//==============================================================================
//Subroutine:	Cursor Blink On
//Function:
//==============================================================================
void LCD_CurBlk(void)
{
	uchar temp;

	LCD_CmdWrite(WCCR);
	temp = LCD_DataRead();
	temp |= cSetb1;
	LCD_CmdWrite(WCCR);
	LCD_DataWrite(temp);
}

void LCD_NoCurBlk(void)
{
	uchar temp;
	
	LCD_CmdWrite(WCCR);
	temp = LCD_DataRead();
	temp &= cClrb1;
	LCD_CmdWrite(WCCR);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	Cursor Height
//Function:
//==============================================================================
void LCD_CurHei(uchar buf)
{
	uchar temp;
	buf = buf << 4;
	buf = buf & 0xF0; 	
	LCD_CmdWrite(CHWI);
	temp = LCD_DataRead();	
	temp = (temp & 0x0F) | buf;		
	LCD_CmdWrite(CHWI);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	Line Distance
//Function:
//==============================================================================
void LCD_LineDis(uchar buf)
{
	uchar temp;
	buf = buf & 0x0F; 	
	LCD_CmdWrite(CHWI);
	temp = LCD_DataRead();	
	temp = (temp & 0xF0) | buf;		
	LCD_CmdWrite(CHWI);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	Font Size
//Function:
//==============================================================================
void LCD_FontSize(uchar buf)
{
	uchar temp;
	buf = buf << 4;
	temp = (buf & 0xF0) | (0x0F);  	
	LCD_CmdWrite(FVHT);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	Font Size
//Function:
//==============================================================================
void LCD_LineDist_Adjust(uchar dis)
{
	uchar temp;
	LCD_CmdWrite(CHWI);	// Line Distance
	temp = LCD_DataRead();
	temp &= 0xf0;
	temp |= (dis & 0x0f);
	LCD_CmdWrite(CHWI);	// Line Distance
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	Software Reset
//Function:
//==============================================================================
void LCD_SWRst(void)
{
	uchar temp;
	
	LCD_CmdWrite(WLCR);
	temp = LCD_DataRead();
	temp |= cSetb5;
	LCD_CmdWrite(WLCR);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	LCD_Clear
//Function:		Clear LCD DDRAM
//==============================================================================
void LCD_Clear(void)
{
	LCD_Graphic();
	Access_2Page();
	
	LCD_CmdWrite(PNTR);
	LCD_DataWrite(0x00);
	
	Fill_PNTR_to_DPRAM();
//	Delay100ms(2);
}

//==============================================================================
//Subroutine:	No_Snow_Mode
//Function:		Clear LCD DDRAM
//==============================================================================
void No_Snow_Mode(void)
{
	uchar temp;

	LCD_CmdWrite(MISC);
	temp = LCD_DataRead();
	temp |= cSetb3;
	LCD_CmdWrite(MISC);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	No_Snow_Mode
//Function:		Clear LCD DDRAM
//==============================================================================
void Snow_Mode(void)
{
	uchar temp;

	LCD_CmdWrite(MISC);
	temp = LCD_DataRead();
	temp &= cClrb3;
	LCD_CmdWrite(MISC);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	LCD_Rotate90
//Function:		
//==============================================================================
void LCD_Rotate90(void)
{
	uchar temp;

	LCD_CmdWrite(WCCR);
	temp = LCD_DataRead();
	temp |= cSetb3;
	LCD_CmdWrite(WCCR);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	LCD_Rotate90_Disable
//Function:		
//==============================================================================
void LCD_Rotate90_Disable(void)
{
	uchar temp;

	LCD_CmdWrite(WCCR);
	temp = LCD_DataRead();
	temp &= cClrb3;
	LCD_CmdWrite(WCCR);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	ASCII_Block_0
//Function:		
//==============================================================================
void ASCII_Block_0(void)
{
	uchar temp;

	LCD_CmdWrite(FNCR);
	temp = LCD_DataRead();
//	temp &= cClrb3;
	temp &= cClrb1;
	temp &= cClrb0;
	LCD_CmdWrite(FNCR);
	LCD_DataWrite(temp);
//	Delay1ms(1);
}

//==============================================================================
//Subroutine:	ASCII_Block_1
//Function:		
//==============================================================================
void ASCII_Block_1(void)
{
	uchar temp;

	LCD_CmdWrite(FNCR);
	temp = LCD_DataRead();
	temp &= cClrb1;
	temp |= cSetb0;
	LCD_CmdWrite(FNCR);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	ASCII_Block_2
//Function:		
//==============================================================================
void ASCII_Block_2(void)
{
	uchar temp;

	LCD_CmdWrite(FNCR);
	temp = LCD_DataRead();
	temp |= cSetb1;
	temp &= cClrb0;
	LCD_CmdWrite(FNCR);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	ASCII_Block_3
//Function:		
//==============================================================================
void ASCII_Block_3(void)
{
	uchar temp;

	LCD_CmdWrite(FNCR);
	temp = LCD_DataRead();
	temp |= cSetb1;
	temp |= cSetb0;
	LCD_CmdWrite(FNCR);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	ASCII_All_Code
//Function:		
//==============================================================================
void ASCII_All_Code(void)
{
	uchar temp;

	LCD_CmdWrite(FNCR);
	temp = LCD_DataRead();
	temp |= cSetb2;
	LCD_CmdWrite(FNCR);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	ASCII_Half_Code
//Function:		
//==============================================================================
void ASCII_Half_Code(void)
{
	uchar temp;

	LCD_CmdWrite(FNCR);
	temp = LCD_DataRead();
	temp &= cClrb2;
	LCD_CmdWrite(FNCR);
	LCD_DataWrite(temp);
}

//==============================================================================
//Subroutine:	Set_Active_Window_Size
//Function:
//==============================================================================
void Set_Active_Window_Size(uchar top_pos, uchar Bot_pos, uchar Left_pos, uchar Right_pos)
{
	LCD_CmdWrite(AWTR);
	LCD_DataWrite(top_pos);
	Delay2us(20);
	LCD_CmdWrite(AWBR);
	LCD_DataWrite(Bot_pos);
	Delay2us(20);
	LCD_CmdWrite(AWLR);
	LCD_DataWrite(Left_pos);
	Delay2us(20);
	LCD_CmdWrite(AWRR);
	LCD_DataWrite(Right_pos);
	Delay2us(20);
}

//==============================================================================
//Subroutine:	Set_Display_Window_Size
//Function:
//==============================================================================
void Set_Display_Window_Size(uchar DW_Width, uchar DW_Height)
{
	LCD_CmdWrite(DWWR);
	LCD_DataWrite(DW_Width);
	Delay2us(20);
	LCD_CmdWrite(DWHR);
	LCD_DataWrite(DW_Height);
	Delay2us(20);
}

//==============================================================================
//Subroutine:	Set_Scroll_Window_Size
//Function:
//==============================================================================

void Set_Scroll_Window_Size(uchar seg_start, uchar seg_end, uchar com_start, uchar com_end)
{
	LCD_CmdWrite(0x61);			//SEG Start Position of Scrolling Mode
	LCD_DataWrite(seg_start);
	LCD_CmdWrite(0x62);			//SEG End Position of Scrolling Mode
	LCD_DataWrite(seg_end);

	LCD_CmdWrite(0x71);			//COM Start Position of Scrolling Mode
	LCD_DataWrite(com_start);
	LCD_CmdWrite(0x72);			//COM End Position of Scrolling Mode
	LCD_DataWrite(com_end);
}

//==============================================================================
//Subroutine:	LCD_Rotate90_Disable
//Function:		Frame Freq(max) = 416 Hz
//==============================================================================
void Set_Frame_Freq(int Frame_freq)
{
	int ITCR_num;

	ITCR_num = ((33333/Frame_freq) - 80);
	LCD_CmdWrite(ITCR);
	LCD_DataWrite(ITCR_num);
	Delay2us(20);
}

//==============================================================================
//Subroutine:	LCD_ShowStr
//Function:		
//==============================================================================
void LCD_ShowStr(unsigned char *text,unsigned int t)
{ 
	LCD_CmdWrite(0xB0);
    while(*text != '\0')          
	{
    	LCD_DataWrite(*text);
    	++text; 

	    Delay1ms(t);
    }
}

//==============================================================================
//Subroutine:	Clear_Head_Line
//Function:		
//==============================================================================
void Clear_Head_Line(void)
{
	int i;

	Access_Page1();
	Only_Show_Page1();
	LCD_Graphic();
	LCD_GotoXY(0,104);
	LCD_CmdWrite(0xb0);
	for(i=0;i<1280;i++)
		LCD_DataWrite(0x00);
}
//==============================================================================
//Subroutine:	ADC On/Off
//Function:
//==============================================================================
/*
void ADC_On(void)
{
	LCD_CmdWrite(TPCR, 0xC0);
}

void ADC_Off(void)
{
	LCD_CmdWrite(TPCR, 0x10);
}
*/
//==============================================================================
//Subroutine:	Get Panel Touch
//Function:		
//==============================================================================
/*
uchar ADC_Touch(void)
{
	uchar temp, tempT;

	temp = LCD_CmdRead(TPCR);
	temp &= cClrb0;
	temp &= cClrb1;
	temp &= cClrb2;
	temp |= cSetb3;
	LCD_CmdWrite(TPCR, temp);
	Delay1ms(2);

	tempT=LCD_CmdRead(TPSR);

	temp &= cClrb3;
	LCD_CmdWrite(TPCR, temp);

	tempT = tempT & B0100_0000;
	if(tempT == 0x40) return 0x01;
	else return 0x00;
}
*/
//==============================================================================
//Subroutine:	Get ADC X/Y
//Function:		
//==============================================================================
/*
uchar ADC_X(void)
{
	uchar temp, tempX;

	temp = LCD_CmdRead(TPCR);
	temp &= cClrb0;
	LCD_CmdWrite(TPCR, temp);
	temp &= cClrb1;
	LCD_CmdWrite(TPCR, temp);
	temp |= cSetb2;
	LCD_CmdWrite(TPCR, temp);
	temp |= cSetb3;
	LCD_CmdWrite(TPCR, temp);
	Delay1ms(1);

	tempX=LCD_CmdRead(TPXR);
	return tempX;
}

uchar ADC_Y(void)
{
	uchar temp, tempY;

	temp = LCD_CmdRead(TPCR);
	temp &= cClrb2;
	LCD_CmdWrite(TPCR, temp);
	temp &= cClrb3;
	LCD_CmdWrite(TPCR, temp);
	temp |= cSetb0;
	LCD_CmdWrite(TPCR, temp);
	temp |= cSetb1;
	LCD_CmdWrite(TPCR, temp);
	Delay1ms(1);

	tempY=LCD_CmdRead(TPYR);
	return tempY;
}
*/


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -