?? lcd_pwr.c
字號:
/*
* @file lcd_pwr.c
*
* Power management implementation for LCD.
*
* @author santosh v kondajji
*
* @version 0.1
*
* History:
*
* Date Author Modification
* -------------------------------------------------------------------
*
*
* (C) Copyright 2005 by Texas Instruments Incorporated, All Rights Reserved
*/
#include "r2d/lcds/i_sample/lcd_if.h"
#include "lcd_pwr.h"
#include "lcd.h"
#include "drv_power.h"
typedef enum
{
LCD_ACTIVE,
DISPLAY_OFF,
CLOCK_OFF
}LCD_STATE;
int lcd_g_state = LCD_ACTIVE;
UINT8 lcd_pwr_interface(UINT8 command)
{
SYS_UWORD16 command2;
switch(command)
{
case 0 : /* Clock Mask */
if ( lcd_g_state == LCD_ACTIVE )
return DCXO_CLOCK;
else if ( lcd_g_state == DISPLAY_OFF )
return LOW_CLOCK;
else
return NO_CLOCK;
case 1 : /* Sleep Command */
if ( lcd_g_state == CLOCK_OFF )
return SUCCESS;
else
return FAILURE;
case 2 : /* Wakeup Command */
// Enable the clock
LCD_INTERFACE_CNTL_REG = ((LCD_INTERFACE_CNTL_REG & 0xFFFD) | (LCD_CLOCK13_EN << LCD_INTERFACE_CNTL_REG_CLOCK13_EN_POS));
// LCD DISPALY ON
command2= 0xAF;
f_lcd_if_poll_write(C_LCD_IF_CS0, &(command2), 1, C_LCD_IF_INSTRUCTION);
return SUCCESS;
default :
return FAILURE;
}
}
void lcd_sleep_timer2_expiration(UNSIGNED id2)
{
LCD_INTERFACE_CNTL_REG = ((LCD_INTERFACE_CNTL_REG & 0xFFFD) | (LCD_CLOCK13_DIS << LCD_INTERFACE_CNTL_REG_CLOCK13_EN_POS));
lcd_g_state = CLOCK_OFF;
}
void lcd_sleep_timer1_expiration(UNSIGNED id1)
{
SYS_UWORD16 command1;
command1 = 0xAE;
f_lcd_if_poll_write(C_LCD_IF_CS0, &(command1), 1, C_LCD_IF_INSTRUCTION);
lcd_g_state = DISPLAY_OFF;
}
#if (L1_POWER_MGT !=0)
void Lcd_Vote_DeepSleepStatus(void)
{
if(lcd_g_state == CLOCK_OFF)
{
Update_Sleep_Status(LCD_ID,ASLEEP);
}
else
{
Update_Sleep_Status(LCD_ID,AWAKE);
}
}
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -