📄 common.c
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
//
// (C) Copyright 2006 Marvell International Ltd.
// All Rights Reserved
//
/*
** INTEL CONFIDENTIAL
** Copyright 2000-2006 Intel Corporation All Rights Reserved.
**
** The source code contained or described herein and all documents
** related to the source code (Material) are owned by Intel Corporation
** or its suppliers or licensors. Title to the Material remains with
** Intel Corporation or its suppliers and licensors. The Material contains
** trade secrets and proprietary and confidential information of Intel
** or its suppliers and licensors. The Material is protected by worldwide
** copyright and trade secret laws and treaty provisions. No part of the
** Material may be used, copied, reproduced, modified, published, uploaded,
** posted, transmitted, distributed, or disclosed in any way without Intel抯
** prior express written permission.
**
** No license under any patent, copyright, trade secret or other intellectual
** property right is granted to or conferred upon you by disclosure or
** delivery of the Materials, either expressly, by implication, inducement,
** estoppel or otherwise. Any license under such intellectual property rights
** must be express and approved by Intel in writing.
*/
#include "lcd_plat.h"
lcd_t *global_lcd = NULL;
PXA_STATUS_T LCDGetMode(UINT32 *width, UINT32 *height, UINT32 *bpp, BOOL *is_smart)
{
void* panel = NULL;
BOOL is_active;
//set_lcd_domain(TRUE);
is_active = LCDPanelSelect(&panel);
if (!panel)
return PXA_STATUS_FAILURE;
if (is_active)
{
active_panel_t *active_panel = (active_panel_t*)panel;
*width = active_panel->config.width;
*height = active_panel->config.height;
*bpp = active_panel->config.bpp;
*is_smart = FALSE;
global_lcd = ActiveCreate(active_panel);
if (!global_lcd)
return PXA_STATUS_NO_RESOURCES;
}
return PXA_STATUS_SUCCESS;
//else
// global_lcd = SmartCreate((smart_panel_t*)panel);
}
PXA_STATUS_T LCDInit(UINT32 base_phy)
{
return global_lcd->init(global_lcd, base_phy);
}
void LCDResume()
{
//set_lcd_domain(TRUE);
global_lcd->resume(global_lcd);
}
void LCDSuspend()
{
global_lcd->suspend(global_lcd);
//set_lcd_domain(FALSE);
}
void LCDFlip(UINT32 phy_addr)
{
global_lcd->flip(global_lcd, phy_addr);
}
PXA_STATUS_T LCDOverlay1Enable(overlay_t *overlay, UINT32 phy_addrs)
{
return global_lcd->overlay1_enable(global_lcd, overlay, phy_addrs);
}
PXA_STATUS_T LCDOverlay1DynChange(overlay_t *overlay, UINT32 phy_addrs, UINT32 change_flag)
{
return global_lcd->overlay1_dyn_change(global_lcd, overlay, phy_addrs, change_flag);
}
void LCDOverlay1Disable(overlay_t *overlay, UINT32 phy_addrs)
{
global_lcd->overlay1_disable(global_lcd);
}
PXA_STATUS_T LCDOverlay2Enable(overlay_t *overlay, UINT32 phy_addrs[3])
{
return global_lcd->overlay2_enable(global_lcd, overlay, phy_addrs);
}
PXA_STATUS_T LCDOverlay2DynChange(overlay_t *overlay, UINT32 phy_addrs[3], UINT32 change_flag)
{
return global_lcd->overlay2_dyn_change(global_lcd, overlay, phy_addrs, change_flag);
}
void LCDOverlay2Disable(overlay_t *overlay, UINT32 phy_addrs[3])
{
global_lcd->overlay2_disable(global_lcd);
}
void LCDCursorSetShape( UINT8 *mask, UINT8 *palette, int xHot, int yHot, int cX, int cY )
{
global_lcd->cursor_set_shape( global_lcd, mask, palette, xHot, yHot, cX, cY );
}
void LCDCursorOn( BOOL on_off )
{
global_lcd->cursor_on( global_lcd, on_off );
}
void LCDCursorMove( int x, int y )
{
global_lcd->cursor_move( global_lcd, x, y );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -