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

📄 lcd_isr_handler.c

📁 8032底层驱动部分。因为可以移植 所以单独来拿出来
💻 C
📖 第 1 页 / 共 2 页
字号:
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2003
*
*****************************************************************************/

/*****************************************************************************
 *
 * Filename:
 * ---------
 *   lcd_isr_handler.c
 *
 * Project:
 * --------
 *   Maui
 *
 * Description:
 * ------------
 *   This function implements LCD LISR and HISR
 *
 * Author:
 * -------
 * -------
 * -------
 *
 *============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *============================================================================
 ****************************************************************************/
#include "kal_release.h"
#include "stack_common.h"
#include "stack_msgs.h"
#include "app_ltlcom.h"       /* Task message communiction */
#include "syscomp_config.h"
#include "task_config.h"
#include "stacklib.h"
#include "stack_timer.h"      /*stack_timer_struct....definitions*/
#include "drv_comm.h"
#include "reg_base.h"
#include "gpt_sw.h"
#include "intrCtrl.h"
#include "gpio_sw.h"
#include "lcd_sw_inc.h"
#include "lcd_hw.h"
#include "lcd_sw.h"
#include "lcd_if.h"
#include "visual_comm.h"
#include "drv_hisr.h"
#if (defined(CAMERA_MODULE))
#include "ext_camera.h"
#endif /* CAMERA_MODULE */
#if (defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229))
	#include "visual_comm.h"
	#include "img_comm.h"
	#include "imgproc.h"
	#include "imgdma.h"
	#if (defined(ISP_SUPPORT))
		#include "isp_if.h"
	#endif
	#if (defined(MT6228)||defined(MT6229))
		#include "tv_out.h"
		#include "2d_engine.h"
	#endif
#endif/*(defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229))*/  
#if (defined(MT6228)||defined(MT6229))
   extern g2d_buffer_struct g2d_tv_output_dest_buff;
   extern g2d_buffer_struct g2d_tv_output_src_buff;
   extern g2d_bitblt_struct g2d_tv_output_bitblt;
   extern kal_uint8 current_g2d_tv_output_bitblt_buffer;
#endif         
extern kal_eventgrpid lcd_event_id;	
extern lcd_layer_struct lcd_layer_data[LCD_TOTAL_LAYER];
/*************************************************************************
* FUNCTION
*     lcd_LISR
*
* DESCRIPTION
*     LCD interface LISR entry
*
* PARAMETERS
*
* RETURNS
*     None
*
* GLOBALS AFFECTED
*
*************************************************************************/
void lcd_LISR(void)
{
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229)||defined(MT6230))
   kal_uint16 temp_reg;
   kal_uint8 update_next_buffer;

#if (defined(MT6217)||defined(MT6218B))
	if (DRV_Reg(DRVPDN_CON1)&DRVPDN_CON1_LCD)
		ASSERT(0);
	IRQMask(IRQ_LCD_CODE);
   temp_reg=DRV_Reg(LCD_INT_STATUS_REG);
   lcd_transfer_complete = KAL_TRUE;
	drv_active_hisr(DRV_LCD_HISR_ID);
#elif (defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229)||defined(MT6230))
	if (DRV_Reg(DRVPDN_CON1)&DRVPDN_CON1_LCD)
		ASSERT(0);
	IRQMask(IRQ_LCD_CODE);
   temp_reg=DRV_Reg(LCD_INT_STATUS_REG);
   if (temp_reg & LCD_INT_ENABLE_COMPLETE_BIT)
   {
      lcd_transfer_complete=KAL_TRUE;
	#if ((defined(MT6228)||defined(MT6229))&& (!defined(__MAUI_BASIC__))&& (!defined(__L1_STANDALONE__)))
	   /*for TVout, configure TVout buffer address and LCD memory output address*/
      if (tv_output_owner==TV_OUT_OWNER_LCD)
      { 
  			update_next_buffer=KAL_TRUE;
      	if (tv_out_current_fb==0)
      	{
      		if (tv_full_screen>0)
      		{
      			if (*((volatile unsigned int *) tv_output_buffer_offset_address1)!=0x55555555)
      			{
      				if (tv_output_config_data.tv_output_mode==TV_OUTPUT_MODE1)
      				   tv_fb_update(TV_OUT_OWNER_LCD,tv_output_buffer_base_address1);
      				else if (tv_output_config_data.tv_output_mode==TV_OUTPUT_MODE4)
							tv_output_buffer_rotate=1;
						lcd_mem_out_address_shadow1=tv_output_buffer_offset_address2;
	      			*((volatile unsigned int *) tv_output_buffer_offset_address2)=0x55555555;
	      			tv_full_screen--;
	      		}
	      		else
	      			update_next_buffer=KAL_FALSE;
      		}
      		else
      		{
      			if (tv_output_config_data.tv_output_mode==TV_OUTPUT_MODE1)
      			   tv_fb_update(TV_OUT_OWNER_LCD,tv_output_buffer_base_address1);
      			else if (tv_output_config_data.tv_output_mode==TV_OUTPUT_MODE4)
						tv_output_buffer_rotate=1;
					lcd_mem_out_address_shadow1=main_lcd_fb_update_para.tv_output_frame_buffer2_address;
	      	}
      	}
      	else
      	{
      		if (tv_full_screen>0)
      		{
      			if (*((volatile unsigned int *) tv_output_buffer_offset_address2)!=0x55555555)
      			{
	      			if (tv_output_config_data.tv_output_mode==TV_OUTPUT_MODE1)
      				   tv_fb_update(TV_OUT_OWNER_LCD,tv_output_buffer_base_address2);
      				else if (tv_output_config_data.tv_output_mode==TV_OUTPUT_MODE4)
							tv_output_buffer_rotate=2;
						lcd_mem_out_address_shadow1=tv_output_buffer_offset_address1;
	      			*((volatile unsigned int *) tv_output_buffer_offset_address1)=0x55555555;
	      			tv_full_screen--;
	      		}
	      		else
	      			update_next_buffer=KAL_FALSE;
      		}
      		else
      		{
      			if (tv_output_config_data.tv_output_mode==TV_OUTPUT_MODE1)
      			   tv_fb_update(TV_OUT_OWNER_LCD,tv_output_buffer_base_address2);
	      		else if (tv_output_config_data.tv_output_mode==TV_OUTPUT_MODE4)
						tv_output_buffer_rotate=2;
					lcd_mem_out_address_shadow1=main_lcd_fb_update_para.tv_output_frame_buffer1_address;
      		}
      	}
      	if (update_next_buffer==KAL_TRUE)
      	{
	      	tv_out_current_fb++;
	      	tv_out_current_fb&=0x01;
	      	tv_output_buffer_count++;
	      	REG_LCD_ROI_WMEM_ADDR=lcd_mem_out_address_shadow1;
      		START_LCD_TRANSFER;
	      }
      }
   #endif/*#if ((defined(MT6228)||defined(MT6229))&& (!defined(__MAUI_BASIC__))&& (!defined(__L1_STANDALONE__)))*/
   }
   if (temp_reg & LCD_INT_ENABLE_CMD_COMPLETE_BIT)
   {
      lcd_cmd_latch_complete=KAL_TRUE;
   }
   drv_active_hisr(DRV_LCD_HISR_ID);
#endif
#endif
}  /* lcd_LISR() */

/*************************************************************************
* FUNCTION
*     lcd_HISR
*
* DESCRIPTION
*     LCD interface HISR entry
*
* PARAMETERS
*
* RETURNS
*     None
*
* GLOBALS AFFECTED
*
*************************************************************************/

⌨️ 快捷键说明

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