Ejemplo n.º 1
0
void RXLCD_ScrollWindow_Down(unsigned short x1,unsigned short y1 ,unsigned short x2 ,unsigned short y2,unsigned char Speed)
{
    u16 i=0;
    
    Scroll_Window(x1,x2,y1,y2);    
    if(g_u8LcdLayer==1)
    {
        Layer1_Visible();
        for(i= (y2-y1+2);i>0;i--) 
        {
            Scroll(0,i-1); 
            Delay2us(Speed*2000);
        }
        g_u8LcdLayer=0;
    }
    else if(g_u8LcdLayer==0)
    {
        Layer2_Visible();
        for(i= (y2-y1+2);i>0;i--) 
        {
            Scroll(0,i-1); 
            Delay2us(Speed*2000);
        }
        g_u8LcdLayer=1;
    }
}
Ejemplo n.º 2
0
void RXLCD_ScrollWindow_Prev(unsigned short x1,unsigned short y1 ,unsigned short x2 ,unsigned short y2, u8 Speed)
{
    u16 i=0;
    
    Scroll_Window(x1,x2,y1,y2);    
    if(g_u8LcdLayer==1)
    {
        Layer1_Visible();
        for(i= (x2-x1+2);i>0;i--) 
        {
            Scroll(i-1,0); 
            Delay2us(Speed*2000);
        }
        g_u8LcdLayer=0;
    }
    else if(g_u8LcdLayer==0)
    {
        Layer2_Visible();
        for(i= (x2-x1+2);i>0;i--) 
        {
            Scroll(i-1,0); 
            Delay2us(Speed*2000);
        }
        g_u8LcdLayer=1;
    }
}
Ejemplo n.º 3
0
void Soft_Reset(void)
{
	xSemaphoreTake(xDispSemaphore, portMAX_DELAY);
	{
		LCD_Reset();
		Delay1ms(500);
		LCD_Initial();
		Two_Layers();
		Delay1ms(100);
		Active_Window(0,479,0,271);
		Background_color(color_black);
		Text_color(color_white);
		Text_Cursor_Disable();
		Layer1_Visible();
		Write_To_Bank1();
		Clear_Active_Window();
		Write_To_Bank2();
		Clear_Full_Window();
		Display_ON();

		//backlight on for RAiO RA8875_demo_board_V2
		PWM1_enable();
		PWM1_duty_cycle(0xff);

		Text_color(color_white);
		Background_color(color_black);
		xSemaphoreGive(xDispSemaphore);
	}
}
Ejemplo n.º 4
0
void RXLCD_VisibleLayer(void)
{
    if(g_u8LcdLayer==1)
    {
        Layer1_Visible();
    }
    else if(g_u8LcdLayer==0)
    {
        Layer2_Visible();
    }
}
Ejemplo n.º 5
0
void ShowNextScene(void)
{
	if(currentLayer == 0)
	{
		Layer2_Visible();
		currentLayer = 1;
	}
	else
	{
		Layer1_Visible();
		currentLayer = 0;
	}
}
Ejemplo n.º 6
0
//-----模块初始化代码----------建议客户直接移植---------------------------//
void RXLCD_init(void)
{ 	
    Reset();
    Delay10ms(5);
    RA8870_PLL_ini();

    Write_Command(0x10);	 //SYSR   bit[4:3]=00 256 color  bit[2:1]=  00 8bit MPU interface
    Write_Data(0x0f);   //                 1x 64k color             1x	16bit 						 

    Write_Command(0x04);    //PCLK
    Write_Data(0x03);   //
    Delay10ms(1);

    //Horizontal set
    Write_Command(0x14);	 //HDWR//Horizontal Display Width Setting Bit[6:0]  
    Write_Data(0x3b); //Horizontal display width(pixels) = (HDWR + 1)*8       0x27
    Write_Command(0x15);	 //HNDFCR//Horizontal Non-Display Period fine tune Bit[3:0] 
    Write_Data(0x02); //(HNDR + 1)*8 +HNDFCR
    Write_Command(0x16);	 //HNDR//Horizontal Non-Display Period Bit[4:0] 
    Write_Data(0x03); //Horizontal Non-Display Period (pixels) = (HNDR + 1)*8 
    Write_Command(0x17);	 //HSTR//HSYNC Start Position[4:0] 
    Write_Data(0x01); //HSYNC Start Position(PCLK) = (HSTR + 1)*8 
    Write_Command(0x18);	 //HPWR//HSYNC Polarity ,The period width of HSYNC. 
    Write_Data(0x03); //HSYNC Width [4:0]   HSYNC Pulse width(PCLK) = (HPWR + 1)*8 

    //Vertical set
    Write_Command(0x19); //VDHR0 //Vertical Display Height Bit [7:0] 
    Write_Data(0x0f); //Vertical pixels = VDHR + 1	0xef
    Write_Command(0x1a); //VDHR1 //Vertical Display Height Bit [8] 
    Write_Data(0x01); //Vertical pixels = VDHR + 1 	0x00
    Write_Command(0x1b); //VNDR0 //Vertical Non-Display Period Bit [7:0]
    Write_Data(0x0f); //Vertical Non-Display area = (VNDR + 1) 
    Write_Command(0x1c); //VNDR1 //Vertical Non-Display Period Bit [8] 
    Write_Data(0x00); //Vertical Non-Display area = (VNDR + 1) 
    Write_Command(0x1d); //VSTR0 //VSYNC Start Position[7:0]
    Write_Data(0x0e); //VSYNC Start Position(PCLK) = (VSTR + 1) 
    Write_Command(0x1e); //VSTR1 //VSYNC Start Position[8] 
    Write_Data(0x06); //VSYNC Start Position(PCLK) = (VSTR + 1) 
    Write_Command(0x1f);	 //VPWR //VSYNC Polarity ,VSYNC Pulse Width[6:0]
    Write_Data(0x01); //VSYNC Pulse Width(PCLK) = (VPWR + 1) 

    Write_Command(0x20);	 
    Write_Data(0x80); 
    Write_Dir(0x52,0xc1);//设置为缓冲卷动模式
    Write_Dir(0x40,0x80);//设置为文字模式
    Write_Dir(0x41,0x01);
Layer1_Visible();
    Write_Dir(0xf0,0x04);//开启中断
    Write_Dir(0x71,0x04);//设置为4线触摸屏
    Write_Dir(0x70,0xB2);//开启触摸功能,设置触摸参数
    Write_Dir(0xf1,0x04);//clear INT state 確保上次觸碰後 TP_interrupt 清除

    
    Write_Command(0x8c);//PWM控制设置
    Write_Data(0x80);//开启PWM
    Write_Command(0x8c);//PWM控制设置
    Write_Data(0x81);//开启PWM
    Write_Command(0x8d);//背光亮度
    Write_Data(0x80);//亮度参数0xff-0x00

    Active_Window(0,479,0,271);//设置区域显示窗口
    Text_Foreground_Color1(0x0000);//前景颜色设定
    Text_Background_Color1(0xffff);//背景颜色设定
    Write_Dir(0X8E,0X80);//开始清屏(显示窗口)
    Delay10ms(1); 

    Write_Dir(0X01,0X80);//开启显示
    
}