bcr_lcdcontrast.c

来自「X-scale 27x 平台」· C语言 代码 · 共 98 行

C
98
字号
//
// Copyright (c) Chrontel Inc.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Chrontel end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

Module Name:  
   vd_LcdContrast.c
   
Abstract:  
   Adjust the STN panel contrast

Revision:
   12/11/02  Roger Yu. Created File     

Notes: 
--*/
#include "chrontel.h"

//\\//\\//\\//\\//\\//\\//\\//\\//\\//
//  Local LCD Panel Contrast Control
//\\//\\//\\//\\//\\//\\//\\//\\//\\//
//@@## Change this function for your own hardware.
// If you don't have contrast control functions, set the functions as empty

void LcdContrast(unsigned value)
{
#ifdef BSP_LUBBOCK
// Intel DBPXA25x system
// Use PWM0 for LMV31 Sharp SDTN Panle
static volatile PWM_REGS* pwmr=NULL;

	if (pwmr==NULL) {
		pwmr = (volatile PWM_REGS*)Xsl_MapReg[PWMREG].mapaddr;
		if (NULL==pwmr) return;
	}
    // the contrast value is 0~3FFh, input range is 0~255, so scale value is 4;
	value = (value & 0xff)*4;   

    pwmr->pwcr = 0;   // gracefully shutdown
	pwmr->pwdr = value;
	pwmr->pwpr = 0x3FF;   // use full period
#endif
	return;
}

//\\//\\//\\//\\//\\//\\//\\//\\//\\//
//  Board Control for LCD Panel Contrast Control
//\\//\\//\\//\\//\\//\\//\\//\\//\\//

//@@@Note:
//  This function depends on the BSP and Board design.
//  Currently designed for IDP_PAX250.
//  Code need be modified to support other BSP & boards.
//  Set these functions to empty if you don't have Bcr Control 

// Intel DBPXA25x system

#define SHARP_LCD_ON  0x100

// Turn On/Off Local Panel power through BCR register
void BcrOnOff( int on)
{
#ifdef BSP_LUBBOCK
	volatile DWORD *bcrlcd = (volatile DWORD*)((PBYTE)Xsl_MapReg[BCRREG].mapaddr + 0x80);

	if (on) {
        *bcrlcd |= SHARP_LCD_ON;
	}
	else {
		*bcrlcd  &= ~SHARP_LCD_ON;
	}
#endif
	return;
}

// Enable/Disable Local Panel & Backlight through BCR register
void BcrEnable( int enable)
{
#ifdef BSP_LUBBOCK
	if (enable) {
	}
	else {
	}
#endif
	return;
}

⌨️ 快捷键说明

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