Exemplo n.º 1
0
UINT32 mt_disp_get_lcd_time(void)
{
	UINT32 time0, time1, lcd_time;

	mt_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
	
	if(lcm_params->type==LCM_TYPE_DPI)
		DPI_WaitVsync();
	else if(lcm_params->type==LCM_TYPE_DBI)
		LCD_WaitForNotBusy();
	else if(lcm_params->type==LCM_TYPE_DSI && lcm_params->dsi.mode!=CMD_MODE) {
		DSI_WaitVsync();
		DSI_WaitVsync();
	}
	time0 = gpt4_tick2time_us(gpt4_get_current_tick());

	if(lcm_params->type==LCM_TYPE_DPI)
		DPI_WaitVsync();
	else if(lcm_params->type==LCM_TYPE_DBI){
		mt_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
		LCD_WaitForNotBusy();
	}
	else{//DSI
		if(lcm_params->dsi.mode!=CMD_MODE)
			DSI_WaitVsync();
		else
			DSI_StartTransfer(TRUE);
//			DSI_WaitBtaTE();
	}

	time1 = gpt4_tick2time_us(gpt4_get_current_tick());

	lcd_time = time1 - time0;

	printf("Screen Update Costs %d us\n", lcd_time);

    mt_disp_adjusting_hardware_addr();
	if(0 != lcd_time)	
		return (100000000/lcd_time);
	else
		return (6000);
}
Exemplo n.º 2
0
void mt_disp_wait_idle(void)
{
	if(lcm_params->type==LCM_TYPE_DPI)
	{
		DPI_WaitVsync();
	}
	else if(lcm_params->type==LCM_TYPE_DBI)
	{
		LCD_WaitForNotBusy();
	}
	else if(lcm_params->type==LCM_TYPE_DSI && lcm_params->dsi.mode!=CMD_MODE) 
	{
		DSI_WaitVsync();
		DSI_WaitVsync();
	}
	else if(lcm_params->type==LCM_TYPE_DSI && lcm_params->dsi.mode ==CMD_MODE) 
	{
		DSI_WaitForNotBusy();
	}
}