Пример #1
0
//  Function:  lcd_config
//  This function configures the LCD
void lcd_config(void){    

	reset_display_controller();

	// Enable LCD clocks
	enable_lcd_power();

	// Configure the DSS registers
	configure_dss(framebuffer);

	// Display data on LCD
	display_lcd_image();
}
Пример #2
0
//------------------------------------------------------------------------------
//
//  Function:  lcd_config
//
//  This function configures the LCD
//
void lcd_config(UINT32 framebuffer)
{    
    reset_display_controller();

    // Enable LCD clocks
    enable_lcd_power();

    // Configure the DSS registers
    configure_dss(framebuffer);
      
    // Display data on LCD
    display_lcd_image() ;
    
    //if (IsDVIMode())
        // DVI is selected, disable backlight
    //    disable_lcd_backlight();
    //else
        // Turn on backlight last
        enable_lcd_backlight();

}
Пример #3
0
static int configure_lcd_evm()
{

	reset_display_controller();

	if (enable_lcd_backlight()) {
		return -1;
	}
	if (enable_lcd_power()) {
		return -1;
	}
	if (configure_vga_mode()) {
		return -1;
	}

	printf("%d\t%d\n",disable_lcd_reset(),__LINE__);
	printf("%d\t%d\n",enable_lcd_HVIF(),__LINE__);
	printf("%d\t%d\n",enable_lcd_reset(),__LINE__);
	printf("%d\t%d\n",enable_INI(),__LINE__);
	printf("%d\t%d\n",configure_vert_scan_direction(CONV_SCAN_DIRECTION),__LINE__);
	printf("%d\t%d\n",configure_horiz_scan_direction(CONV_SCAN_DIRECTION),__LINE__);

	return 0;
}
Пример #4
0
void init_lcd(void)
{
    /** 1. 设置LCD的相关GPIO引脚 */
    // VD0 ~ VD23的引脚为GPI0 ~ GPI15,GPJ0 ~ GPJ7
    // LDVEN、LVSYNC、LHSYNC、LVCLK的引脚为GPJ8 ~ GPJ11
    GPICON = 0xAAAAAAAA;
    GPJCON = 0xAAAAAA;
    
    // GPF14用作背光使能信号,设为输出模式
    // GPE0用作LCD的电源使能信号,设为输出模式
    GPFCON &= ~(3 << 28);
    GPFCON |= (1 << 28);
    GPECON &= ~(0xF);
    GPECON |= 1;
    
    /** 2. 初始化LCD控制器 */
    // PROGRAMMER'S MODEL (P-492)
    // 设置MIFPCON的SEL_BYPASS[3]为Normal mode
    MIFPCON &= ~(1 << 3);
    
    // 设置SPCON的LCD_SEL[1:0]为RGB I/F Style
    SPCON = (SPCON & (~3)) | 1;
    
    // 设置VIDCON0控制器,设置图像输出格式等属性
    VIDCON0 &= ~((3 << 26) | (3 << 17) | (0xFF << 6) | 0x1F);
    VIDCON0 |= ((13 << 6) | (1 << 4));
    
    // 设置VIDCON1控制器,设置HSYNC、VSYNC、VCLK、VDEN
    VIDCON1 &= ~(0xF << 4);
    VIDCON1 |= (0x7 << 4);
    
    // 设置VIDTCON控制器的时间参数,行列数
    VIDTCON0 = (1 << 16) | (1 << 8) | 9;
    VIDTCON1 = (1 << 16) | (1 << 8) | 40;
    VIDTCON2 = ((lcd_cfg.height - 1) << 11) | (lcd_cfg.width - 1);
    
    // 设置WINCON0的输出像素格式
    // use 16 BPP - RGB 565 - 0101
    // 24 BPP - 1011
    WINCON0 &= ~(0xF << 2);
    WINCON0 |= (0xB << 2);
    
    // 设置左上角和右下角坐标
    VIDOSD0A = 0;
    VIDOSD0B = ((lcd_cfg.width - 1) << 11) | (lcd_cfg.height - 1);
    
    // 设置图像大小
    VIDOSD0C = lcd_cfg.width * lcd_cfg.height;
    
    // 设置显存起始地址
    VIDW00ADD0B0 = FRAME_BUFFER;
    // 设置显存结束地址
    VIDW00ADD1B0 = lcd_cfg.width * 4 * lcd_cfg.height;
    
    // 
    enable_lcd_power();
    enable_lcd_backLight();
    enable_lcd_display();
    display_bg_color(COLOR_WHITE);
    
    return;
}