?? lcd_if.c
字號:
case LCD_LAYER4:
SET_LCD_LAYER4_WINDOW_OFFSET(layer_offset_x,layer_offset_y);
break;
case LCD_LAYER5:
SET_LCD_LAYER5_WINDOW_OFFSET(layer_offset_x,layer_offset_y);
break;
#endif
}
#endif
} /* config_lcd_layer_offset() */
#if (defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229))
void config_lcd_hw_layer(kal_uint32 hw_layer,kal_uint16 layer_offset_x,kal_uint16 layer_offset_y,
kal_uint16 layer_width, kal_uint16 layer_height)
{
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#if (defined(MT6228)||defined(MT6229))
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
/* under construction !*/
/* under construction !*/
#endif
} /* config_lcd_hw_layer() */
kal_uint8 get_lcd_hw_layer_rotate_value(kal_uint32 hw_layer)
{
kal_uint8 rotate_value;
lcd_power_up();
switch (hw_layer)
{
case LCD_LAYER0_ENABLE:
rotate_value=GET_LCD_LAYER0_ROTATE;
break;
case LCD_LAYER1_ENABLE:
rotate_value=GET_LCD_LAYER1_ROTATE;
break;
case LCD_LAYER2_ENABLE:
rotate_value=GET_LCD_LAYER2_ROTATE;
break;
case LCD_LAYER3_ENABLE:
rotate_value=GET_LCD_LAYER3_ROTATE;
break;
#if (defined(MT6228)||defined(MT6229))
case LCD_LAYER4_ENABLE:
rotate_value=GET_LCD_LAYER4_ROTATE;
break;
case LCD_LAYER5_ENABLE:
rotate_value=GET_LCD_LAYER5_ROTATE;
break;
#endif
}
lcd_power_down();
return rotate_value;
}
#endif
/*************************************************************************
* FUNCTION
* config_lcd_roi_window
*
* DESCRIPTION
* This function configures the ROI window offset and size of LCD interface.
*
* CALLS
*
* PARAMETERS
* roi_x_offset : ROI X offset
* roi_y_offset : ROI Y offset
* roi_column : ROI width
* roi_row : ROI height
*
* RETURNS
* return KAL_TRUE if configure successful
*
* GLOBALS AFFECTED
* none
**************************************************************************/
kal_bool config_lcd_roi_window(kal_uint16 roi_offset_x, kal_uint16 roi_offset_y, kal_uint16 roi_column,
kal_uint16 roi_row)
{ /* LCM independent */
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229))
#if (defined(MT6217)||defined(MT6218B))
ASSERT(!LCD_IS_RUNNING);
#elif (defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227))
#ifndef DUAL_LCD
if ((main_lcd_operation_state!=LCD_STANDBY_STATE)&&
(main_lcd_operation_state!=LCD_SW_UPDATE_STATE)&&
(main_lcd_operation_state!=LCD_HW_UPDATE_STATE)&&
(main_lcd_operation_state!=LCD_DC_UPDATE_STATE)&&
(main_lcd_operation_state!=LCD_SLEEP_STATE))
ASSERT(0);
#else
if (current_update_lcd==MAIN_LCD)
{
if ((main_lcd_operation_state!=LCD_STANDBY_STATE)&&
(main_lcd_operation_state!=LCD_SW_UPDATE_STATE)&&
(main_lcd_operation_state!=LCD_HW_UPDATE_STATE)&&
(main_lcd_operation_state!=LCD_DC_UPDATE_STATE)&&
(main_lcd_operation_state!=LCD_SLEEP_STATE))
ASSERT(0);
}
else
{
if ((sub_lcd_operation_state!=LCD_STANDBY_STATE)&&
(sub_lcd_operation_state!=LCD_SW_UPDATE_STATE)&&
(sub_lcd_operation_state!=LCD_HW_UPDATE_STATE)&&
(sub_lcd_operation_state!=LCD_DC_UPDATE_STATE)&&
(sub_lcd_operation_state!=LCD_SLEEP_STATE))
ASSERT(0);
}
#endif /* DUAL_LCD */
#elif (defined(MT6228)||defined(MT6229))
#ifndef DUAL_LCD
if ((main_lcd_operation_state!=LCD_STANDBY_STATE)&&
(main_lcd_operation_state!=LCD_SW_UPDATE_STATE)&&
(main_lcd_operation_state!=LCD_HW_UPDATE_STATE)&&
(main_lcd_operation_state!=LCD_DC_UPDATE_STATE)&&
(main_lcd_operation_state!=LCD_SLEEP_STATE)&&
(main_lcd_operation_state!=LCD_DC_UPDATE_SLEEP_STATE)&&
(main_lcd_operation_state!=LCD_HW_UPDATE_SLEEP_STATE))
ASSERT(0);
#else
if (current_update_lcd==MAIN_LCD)
{
if ((main_lcd_operation_state!=LCD_STANDBY_STATE)&&
(main_lcd_operation_state!=LCD_SW_UPDATE_STATE)&&
(main_lcd_operation_state!=LCD_HW_UPDATE_STATE)&&
(main_lcd_operation_state!=LCD_DC_UPDATE_STATE)&&
(main_lcd_operation_state!=LCD_SLEEP_STATE)&&
(main_lcd_operation_state!=LCD_DC_UPDATE_SLEEP_STATE)&&
(main_lcd_operation_state!=LCD_HW_UPDATE_SLEEP_STATE))
ASSERT(0);
}
else
{
if ((sub_lcd_operation_state!=LCD_STANDBY_STATE)&&
(sub_lcd_operation_state!=LCD_SW_UPDATE_STATE)&&
(sub_lcd_operation_state!=LCD_HW_UPDATE_STATE)&&
(sub_lcd_operation_state!=LCD_DC_UPDATE_STATE)&&
(sub_lcd_operation_state!=LCD_SLEEP_STATE)&&
(sub_lcd_operation_state!=LCD_DC_UPDATE_SLEEP_STATE)&&
(sub_lcd_operation_state!=LCD_HW_UPDATE_SLEEP_STATE))
ASSERT(0);
}
#endif /* DUAL_LCD */
#endif
lcd_power_up();
SET_LCD_ROI_WINDOW_OFFSET(roi_offset_x,roi_offset_y);
SET_LCD_ROI_WINDOW_SIZE(roi_column,roi_row);
lcd_power_down();
#endif
return KAL_TRUE;
} /* config_lcd_roi_window() */
void config_lcd_output(kal_bool lcd_output)
{
#if (defined(MT6228)||defined(MT6229))
if (lcd_output==KAL_TRUE)
lcd_output_mode=KAL_TRUE;
else if (lcd_output==KAL_FALSE)
lcd_output_mode=KAL_FALSE;
else
ASSERT(0);
#endif
}
/*************************************************************************
* FUNCTION
* set_lcd_color_palette
*
* DESCRIPTION
* This function set the color palette of LCD interface.
*
* CALLS
*
* PARAMETERS
* color_palette_select : choose LCD color palette 0 or color palette 1
* color_palette_addr_ptr : the address ptr that points to the color with offset
* (start_index) from the 0th color in color palette
* start_index : the offset from the 0th color in color palette
* number_of_color : number of colors in color palette will be set.
*
* RETURNS
* return KAL_TRUE if configure successful
*
* GLOBALS AFFECTED
* none
**************************************************************************/
void set_lcd_color_palette(kal_uint8 color_palette_select,kal_uint32 *color_palette_addr_ptr,
kal_uint8 start_index, kal_uint8 number_of_color)
{
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229))
kal_uint16 i;
lcd_power_up();
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219))
if (color_palette_select==LCD_COLOR_PALETTE0)
{
for (i=start_index;i<(start_index+number_of_color);i++)
{
SET_LUT0_COLOR(i,*(color_palette_addr_ptr+i));
}
}
else if (color_palette_select==LCD_COLOR_PALETTE1)
{
for (i=start_index;i<(start_index+number_of_color);i++)
{
SET_LUT1_COLOR(i,*(color_palette_addr_ptr+i));
}
}
#elif (defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229))
for (i=start_index;i<(start_index+number_of_color);i++)
{
SET_LUT0_COLOR(i,*(color_palette_addr_ptr+i));
}
#endif
lcd_power_down();
#endif /* MT6218B, MT6219 */
} /* set_lcd_color_palette() */
/*************************************************************************
* 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))
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))
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__)))
if (tv_output_owner==TV_OUT_OWNER_LCD)
{
update_next_buffer=KAL_TRUE;
if (tv_out_current_fb==0)
{
// tv_fb_update(TV_OUT_OWNER_LCD,main_lcd_fb_update_para.tv_output_frame_buffer1_address);
// tv_fb_update(TV_OUT_OWNER_LCD,tv_output_buffer_base_address1);
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;
// REG_LCD_ROI_WMEM_ADDR=tv_output_buffer_offset_address2;
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;
// REG_LCD_ROI_WMEM_ADDR=main_lcd_fb_update_para.tv_output_frame_buffer2_address;
lcd_mem_out_address_shadow1=main_lcd_fb_update_para.tv_output_frame_buffer2_address;
}
}
else
{
// tv_fb_update(TV_OUT_OWNER_LCD,main_lcd_fb_update_para.tv_output_frame_buffer2_address);
// tv_fb_update(TV_OUT_OWNER_LCD,tv_output_buffer_base_address2);
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;
// REG_LCD_ROI_WMEM_ADDR=tv_output_buffer_offset_address1;
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;
// REG_LCD_ROI_WMEM_ADDR=main_lcd_fb_update_para.tv_output_frame_buffer1_address;
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 (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
*
*************************************************************************/
void lcd_HISR(void)
{
#if (defined(MT6217)||defined(MT6218B)||defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229))
kal_uint32 save_irq_mask;
#if (defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229))
kal_uint8 i;
volatile kal_uint16 j;
#endif
#if (defined(MT6217)||defined(MT6218B))
kal_set_eg_events(lcd_event_id,LCD_TRANSFER_COMPLETE_EVENT,KAL_OR);
save_irq_mask=SaveAndSetIRQMask();
lcd_transfer_complete=KAL_FALSE;
if (wait_lcd_update_flag==KAL_TRUE)
{ /* for software udpate only */
wait_lcd_update_flag=KAL_FALSE;
if (main_lcd_operation_state==LCD_SW_UPDATE_STATE)
main_lcd_operation_state=LCD_STANDBY_STATE;
#ifdef DUAL_LCD
if (sub_lcd_operation_state==LCD_SW_UPDATE_STATE)
sub_lcd_operation_state=LCD_STANDBY_STATE;
#endif
config_lcd_layer_window_queue();
if (lcd_block_cb!=NULL)
lcd_block_cb();
}
RestoreIRQMask(save_irq_mask);
IRQUnmask(IRQ_LCD_CODE);
#elif (defined(MT6219)||defined(MT6226)||defined(MT6226M)||defined(MT6227)||defined(MT6228)||defined(MT6229))
if (current_update_lcd==MAIN_LCD)
{
if (lcd_transfer_complete==KAL_TRUE)
{
if ((main_lcd_operation_state==LCD_SW_UPDATE_STATE)||
(main_lcd_operation_state==LCD_WAIT_LAST_UPDATE_STATE)||
(main_lcd_operation_state==LCD_MEM_UPDATE_STATE))
kal_set_eg_events(lcd_event_id,LCD_TRANSFER_COMPLETE_EVENT,KAL_OR);
save_irq_mask=SaveAndSetIRQMask();
lcd_transfer_complete=KAL_FALSE;
RestoreIRQMask(save_irq_mask);
if (wait_lcd_update_flag==KAL_TRUE)
{ /* for software udpate only */
wait_lcd_update_flag=KAL_FALSE;
if (main_lcd_operation_state==LCD_SW_UPDATE_STATE)
main_lcd_operation_state=LCD_STANDBY_STATE;
config_lcd_layer_window_queue();
if (lcd_block_cb!=NULL)
lcd_block_cb();
}
}
if (lcd_cmd_latch_complete==KAL_TRUE)
{
if (lcd_hw_trigger_flag==KAL_TRUE)
{
#if ((defined(MT6228)||defined(MT6229))&& (!defined(__MAUI_BASIC__))&& (!defined(__L1_STANDALONE__)))
if ((tv_output_owner == TV_OUT_OWNER_LCD) && (tv_output_buffer_count<2))
{
IRQUnmask(IRQ_LCD_CODE);
return;
}
#endif
lcd_hw_trigger_flag=KAL_FALSE;
if ((main_lcd_operation_state==LCD_HW_CMD_QUEUE_STATE)||
(main_lcd_operation_state==LCD_DC_CMD_QUEUE_STATE)||
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -