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

📄 lcd_task_init_i.c

📁 MMI层OBJ不能完全编译
💻 C
字号:
/* 联想  密级:绝密	保密期限:3年				   */

/***CONFIDENTIAL *****************************************************
本文件属于公司秘密信息,请您恪守保密义务,勿向第三人透露。谢谢合作。 
This file is confidential. Recipient(s) is(are) obligated to maintain secrecy
and is(are) not permitted to disclose the contents of this communication to others. 
Thank you. 
***********************************************************************/
/**************************************************************************
*
*                    	  联想研究院移动通信研究室
*								软件处
*
*			联想研究院移动通信研究室 版权所有(c) 
*
* 文件名	:	lcd_task_i.c
*
* 目的		:	This is source file on lcd platform (locosto)
*               
* 作者		:	fujl
* 
* 生成日期	:	2006.03.30
*
* 修改纪录	:
* 
*-------------------------------------------------------------------------
* 姓名			日期			版本			描述
*-------------------------------------------------------------------------
* fujl		2006.03.30	    	0.1				创建            
***************************************************************************/
#include "cpu.h"
#include "lcd_task_init_i.h"
#include "lcd\lcd_transport.h"
#include "lcd\lcd_manager.h"
#include "lcd_data.h"

#include "l1_types.h"
#include "r2d/lcds/i_sample/lcd.h"

//#include "lcd.h"
#include "lls/lls_api.h"

U8   g_lcd_backlight=BackLight_Off;
unsigned char gLCDSleepStatus;

U8	g_lcd_type;
BOOL g_bIsLCDSleep = FALSE;



/******************************************************************
@function		 :   lcd_ms_delay()
@discussion     :   delay num. ms
@input		 :   ms
@output	        :   none    
@author		 :   fujl
@date		 :   06/03/29
******************************************************************/ 
void lcd_ms_delay(UINT32 ms)
{
    	wait_ARM_cycles(convert_nanosec_to_cycles(2*1000*1000*ms));
}

/******************************************************************
@function		 :   lcd_us_delay()
@discussion     :   delay num. ms
@input		 :   us
@output	        :   none    
@author		 :   fujl
@date		 :   06/03/29
******************************************************************/ 
void lcd_us_delay(UINT32 us)
{
    	wait_ARM_cycles(convert_nanosec_to_cycles(1000*us));
}

/*************************************************************************
@function		 :   LCD_Main_WriteRegTable()
@discussion     :   write main lcd table
@input		 :   table   --
@output	        :   none        
@author		 :   fujl
@date		 :   06/03/29
**************************************************************************/
void LCD_WriteRegTable(unsigned short* table)
{
    	unsigned short* point;
    	unsigned short usReg;
    	unsigned short usData;

	if(NULL ==table)
		return;
    	point   =table;
    	while(1)
    	{
        	usReg =*point;
        	if(usReg == 0xffff)
            		break;
        	point++;
        	usData=*point;
        	point++;
       
        	if(usReg==0xfffe)
            		lcd_ms_delay(usData);
        	else    
            		write_lcd_index_data(usReg,usData);
    	}

}

#if 0
void	Lcd_AUO_init(void)
{
	DRIVER_TRACE("AUO lcd panel driver init.");	
	LCD_WriteRegTable(AUO_LCD_INIT);
	//LCD_WriteRegTable(Hitachi_LCD_INIT);
}


/****************************************************************
@function		 :   Lcd_Drv_Init()
@discussion     :   init main lcd drv ic
@input		 :  none
@output	        :   none     
@author		 :   fujl
@date		 :   06/03/29
****************************************************************/
void Lcd_Drv_Init(void)
{
    //DRIVER_TRACE("LCD initial");
	write_lcd_index_data(0x0000,0x001);	/*start osc	 */
	lcd_ms_delay(10);
   	LCD_WriteRegTable(TRULY_LCD_POWER_SETTING);           
	LCD_WriteRegTable(TRULY_LCD_INIT);           
	lcd_ms_delay(10);
	LCD_WriteRegTable(TRULY_LCD_DISPLAY_ON);           

       //LCD_SetRefreshMode(0,0,0,0,0); 			//set main lcd full screen refresh mode

       //LCD_Main_BackLight_Switch(BackLight_High);
        
	//LCD_ColorRefresh(LCD_COLOR_BLUE);

       //DRIVER_TRACE("LCD initial LOGO");
 
}

void color_line_lcd_test(void)
{
	UINT16 i, k;
	//UINT16 point1;
	
	lls_switch_on(LLS_BACKLIGHT); //Switch backlight on	
	
	write_lcd_index_data(0x21, 0x0000); // RAM address set
       LCD_WriteSetInstruction(0x22);
	LCD_DataTypeSelection(LCD_DISPLAY);

	// for(k=0;k<220;k++){
	 for(k=0;k<LCD_MAIN_CY;k++){
        	for(i=0;i<LCD_MAIN_CX/4;i++){
             		LCD_Write(0xf100);     
        	}
        	for(i=0;i<LCD_MAIN_CX/4;i++){
             		LCD_Write(0x07e0);   
        	}
        	for(i=0;i<LCD_MAIN_CX/4;i++){
             		LCD_Write(0x001f);     
        	}
        	for(i=0;i<LCD_MAIN_CX/4;i++){
             		LCD_Write(0xffff);     
        	}

    }
	//while(1);
 	for(i=4000;i>0;i++);	
	 
	
}

#if 0
void LCD_Fresh()     /* 刷新LCD */
{
	lcd_fb_coordinates p_lcd_coord = { 0,0,128,160};
	
	lcd_display(DISPLAY_MAIN_LCD,ImageDataPtrTemp,&p_lcd_coord);
}
#endif
#endif


/**************************************************************************
函数名称:   LCD_Main_BackLight_Switch()
函数功能:   设置LCD的背光
输入参数:   usBL_level      --0x01, 亮
                                                --0x00, 关 
输出参数:   none        
***************************************************************************/
void LCD_Main_BackLight_Switch(BACKLIGHT_STATE ucBL_level)
{
	
	if( g_lcd_backlight == ucBL_level ) return;

	switch(ucBL_level)
	{
	case BackLight_High:
		//LCD_MainSetLackLightState(LCD_BKL_ON);
		//LCD_SetBackLightLevel();
		LcdBackLightInit();
            g_lcd_backlight = BackLight_High;
            break;

	case BackLight_Off:
            g_lcd_backlight = BackLight_Off;
		//LCD_MainSetLackLightState(LCD_BKL_OFF);
		LCD_SetBackLightLevel(0);
            break;
	case BackLight_Low:
		g_lcd_backlight = BackLight_Low;
		//LCD_MainSetLackLightState(LCD_BKL_LOW);
		LCD_SetBackLightLevel(10);
            break;
	default: 
		break;
	}

}

/****************************************************************************************
函数名称:   LCD_SleepIn()
函数功能:   关上翻盖主LCD进入省电模式
输入参数:   none
输出参数:   none          
注  背光和刷屏应由MMI设置
				
**********************************************************************************/
void LCD_SleepIn(void)
{
  	if(g_bIsLCDSleep != TRUE){  	
            DRIVER_TRACE("lcd sleep in");	
            LCD_Main_BackLight_Switch(BackLight_Off);	
            g_bIsLCDSleep = TRUE;
  	}
	
}

/****************************************************************************************
函数名称:   LCD_SleepOut()
函数功能:   打开翻盖主LCD退出省电模式
输入参数:   none
输出参数:   none   
注  背光和刷屏应由MMI设置
camera off	main setting ->send refresh event
camera on	lock -> main setting -> unlock -> jpeg ic refresh
**********************************************************************************/
 void LCD_SleepOut(void)
{
  	if(g_bIsLCDSleep != FALSE){
            DRIVER_TRACE("lcd sleep out");	
			
            LCD_Main_BackLight_Switch(BackLight_High);	
            LCD_SetRefreshMode(0,0,0,0,0);
            g_bIsLCDSleep = FALSE;
            LCD_Fresh();
            rvf_delay(1);
  	}  	
}


/*********************************************************************************
func: LCD_Main_ContrastSetting()
parameter : LcdContrastValue
desc: the interface for mmi to change the lcd backlight level
	  the contrast level range is level1 ~ level19
author: fujl 
date: 20060906
**********************************************************************************/
void LCD_Main_ContrastSetting(unsigned char LcdContrastValue)
{
 	DRIVER_TRACE_PARAM("LCD_Main_ContrastSetting level ==", LcdContrastValue);	
	//LCD_MainSetBackLightMaxLevel(LcdContrastValue);
	LCD_SetContrast(100 + LcdContrastValue*10);//100-170
}
/*********************************************************************************
func: LCD_Main_BackLightSetting()
parameter : LcdContrastValue
desc: the interface for mmi to change the lcd backlight level
	  the contrast level range is level1 ~ level8
author: wuweie
date: 20070122
**********************************************************************************/
void LCD_Main_BackLightSetting(unsigned char LcdContrastValue)
{
 	DRIVER_TRACE_PARAM("LCD_Main_BackLightSetting level ==", LcdContrastValue);	

	LCD_SetBackLightLevel((1+ LcdContrastValue)*32);
}


void LCD_Contrast_Set(unsigned char LcdContrastValue)
{
}

void VibratorSetting(unsigned char VibratorState)
{
}

void LCD_Sub_ContrastSetting(unsigned char LcdContrastValue)
{
}

void LCD_Main_Display_OnOff(unsigned short usOnOff)
{
}

void Lcd_Power_Off(void)
{
}

void Set_Pc_Sync_Mode(unsigned char State)
{
}

void Set_KbdLight_Mode(unsigned char state)
{
}



⌨️ 快捷键说明

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