📄 lcd_lcm_if.c
字号:
/*****************************************************************************
* 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 LCM interface adaptation layer
*
* 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)||defined(MT6230))
#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
extern lcd_layer_struct lcd_layer_data[LCD_TOTAL_LAYER];
/*************************************************************************
* FUNCTION
* lcd_set_rotate
*
* DESCRIPTION
* This function is to ask LCM rotate
*
* PARAMETERS
* lcd_id : selection MAIN_LCD or SUB_LCD
* rotate_value: the rotate value of LCM
*
* RETURNS
* none
*
* GLOBALS AFFECTED
*
*************************************************************************/
void lcd_set_rotate(kal_uint8 lcd_id,kal_uint8 rotate_value)
{
#if (defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229)||defined(MT6230))
#ifdef LCM_ROTATE_SUPPORT
current_lcd_rotate_value=rotate_value;
if (lcd_id==MAIN_LCD)
{
if (MainLCD->set_rotate==NULL)
ASSERT(0);
MainLCD->set_rotate(rotate_value);
}
#ifdef DUAL_LCD
else if (lcd_id==SUB_LCD)
{
if (SubLCD->set_rotate==NULL)
ASSERT(0);
SubLCD->set_rotate(rotate_value);
}
#endif
#endif
#endif
} /* lcd_set_rotate() */
/*************************************************************************
* FUNCTION
* lcd_set_temp_compensate
*
* DESCRIPTION
* This function set the temperature compensation parameters of LCM
*
* PARAMETERS
* lcd_id : selection MAIN_LCD or SUB_LCD
* *compensate : the temperature compensate of LCM
*
* RETURNS
* none
*
* GLOBALS AFFECTED
*
*************************************************************************/
void lcd_set_temp_compensate(kal_uint8 lcd_id, kal_uint8 *compensate)
{
lcd_power_up();
switch (lcd_id)
{
case MAIN_LCD:
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229)||defined(MT6230))
DRV_WriteReg32(LCD_ROI_CMD_ADDR_REG,MAIN_LCD_CMD_ADDR);
DRV_WriteReg32(LCD_ROI_DATA_ADDR_REG,MAIN_LCD_DATA_ADDR);
#endif /* MT6218B, MT6219 */
MainLCD->set_temp_compensate(compensate);
break;
#ifdef DUAL_LCD
case SUB_LCD:
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229)||defined(MT6230))
DRV_WriteReg32(LCD_ROI_CMD_ADDR_REG,SUB_LCD_CMD_ADDR);
DRV_WriteReg32(LCD_ROI_DATA_ADDR_REG,SUB_LCD_DATA_ADDR);
#endif /* MT6218B, MT6219 */
SubLCD->set_temp_compensate(compensate);
break;
#endif /* DUAL_LCD */
default:
ASSERT(0);
break;
}
lcd_power_down();
} /* lcd_set_temp_compensate() */
/*************************************************************************
* FUNCTION
* lcd_set_linerate
*
* DESCRIPTION
* This function set the line rate of LCM
*
* PARAMETERS
* lcd_id : selection MAIN_LCD or SUB_LCD
* *lienrate: the line rate of LCM
*
* RETURNS
* none
*
* GLOBALS AFFECTED
*
*************************************************************************/
void lcd_set_linerate(kal_uint8 lcd_id, kal_uint8 *linereate)
{
lcd_power_up();
switch (lcd_id)
{
case MAIN_LCD:
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229)||defined(MT6230))
DRV_WriteReg32(LCD_ROI_CMD_ADDR_REG,MAIN_LCD_CMD_ADDR);
DRV_WriteReg32(LCD_ROI_DATA_ADDR_REG,MAIN_LCD_DATA_ADDR);
#endif
MainLCD->set_linerate(linereate);
break;
#ifdef DUAL_LCD
case SUB_LCD:
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229)||defined(MT6230))
DRV_WriteReg32(LCD_ROI_CMD_ADDR_REG,SUB_LCD_CMD_ADDR);
DRV_WriteReg32(LCD_ROI_DATA_ADDR_REG,SUB_LCD_DATA_ADDR);
#endif /* MT6218B, MT6219 */
SubLCD->set_linerate(linereate);
break;
#endif /* DUAL_LCD */
default:
ASSERT(0);
break;
}
lcd_power_down();
} /* lcd_set_linerate() */
/*************************************************************************
* FUNCTION
* lcd_set_contrast
*
* DESCRIPTION
* This function set the contrast of LCM
*
* PARAMETERS
* lcd_id : selection MAIN_LCD or SUB_LCD
* *contrast : the contrast of LCM
*
* RETURNS
* none
*
* GLOBALS AFFECTED
*
*************************************************************************/
void lcd_set_contrast(kal_uint8 lcd_id, kal_uint8 *contrast)
{
lcd_power_up();
switch (lcd_id)
{
case MAIN_LCD:
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229)||defined(MT6230))
DRV_WriteReg32(LCD_ROI_CMD_ADDR_REG,MAIN_LCD_CMD_ADDR);
DRV_WriteReg32(LCD_ROI_DATA_ADDR_REG,MAIN_LCD_DATA_ADDR);
#endif /* MT6218B, MT6219 */
MainLCD->set_contrast(contrast);
break;
#ifdef DUAL_LCD
case SUB_LCD:
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229)||defined(MT6230))
DRV_WriteReg32(LCD_ROI_CMD_ADDR_REG,SUB_LCD_CMD_ADDR);
DRV_WriteReg32(LCD_ROI_DATA_ADDR_REG,SUB_LCD_DATA_ADDR);
#endif /* MT6218B, MT6219 */
SubLCD->set_contrast(contrast);
break;
#endif /* DUAL_LCD */
default:
ASSERT(0);
break;
}
lcd_power_down();
} /* lcd_set_contrast() */
/*************************************************************************
* FUNCTION
* lcd_set_bias
*
* DESCRIPTION
* This function set the bias of LCM
*
* PARAMETERS
* lcd_id : selection MAIN_LCD or SUB_LCD
* *bias : the bias of LCM
*
* RETURNS
* none
*
* GLOBALS AFFECTED
*
*************************************************************************/
void lcd_set_bias(kal_uint8 lcd_id, kal_uint8 *bias)
{
lcd_power_up();
switch (lcd_id)
{
case MAIN_LCD:
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229)||defined(MT6230))
DRV_WriteReg32(LCD_ROI_CMD_ADDR_REG,MAIN_LCD_CMD_ADDR);
DRV_WriteReg32(LCD_ROI_DATA_ADDR_REG,MAIN_LCD_DATA_ADDR);
#endif /* MT6218B, MT6219 */
MainLCD->set_bias(bias);
break;
#ifdef DUAL_LCD
case SUB_LCD:
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229)||defined(MT6230))
DRV_WriteReg32(LCD_ROI_CMD_ADDR_REG,SUB_LCD_CMD_ADDR);
DRV_WriteReg32(LCD_ROI_DATA_ADDR_REG,SUB_LCD_DATA_ADDR);
#endif /* MT6218B, MT6219 */
SubLCD->set_bias(bias);
break;
#endif /* DUAL_LCD */
default:
ASSERT(0);
break;
}
lcd_power_down();
} /* lcd_set_bias() */
/*************************************************************************
* FUNCTION
* lcd_get_size
*
* DESCRIPTION
* This function returns the width and height of LCM
*
* PARAMETERS
* lcd_id : selection MAIN_LCD or SUB_LCD
* *lcd_width : the width of LCM
* *lcd_height : the height of LCM
*
* RETURNS
* none
*
* GLOBALS AFFECTED
*
*************************************************************************/
void lcd_get_size(kal_uint8 lcd_id, kal_uint16 *lcd_width, kal_uint16 *lcd_height)
{
switch (lcd_id)
{
case MAIN_LCD:
MainLCD->GetSize(lcd_width, lcd_height);
break;
#ifdef DUAL_LCD
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -