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

📄 bspbacklight.cpp

📁 Freescale ARM11系列CPU MX31的WINCE 5.0下的BSP
💻 CPP
字号:
/*---------------------------------------------------------------------------
* Copyright (C) 2005, 2006, Freescale Semiconductor, Inc. All Rights Reserved.
* THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS
* AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT 
*--------------------------------------------------------------------------*/
//------------------------------------------------------------------------------
//
//  File:  bspbacklight.c
//
//  Provides BSP-specific configuration routines for the backlight driver.
//  The routines in this file assume that we use MC13783 PMIC for the low level
//  function
//
//------------------------------------------------------------------------------
#include <windows.h>
#include "bsp.h"
#include "pmic_bklight.h"

//------------------------------------------------------------------------------
// External Functions


//------------------------------------------------------------------------------
// External Variables


//------------------------------------------------------------------------------
// Defines


//------------------------------------------------------------------------------
// Types


//------------------------------------------------------------------------------
// Global Variables


//------------------------------------------------------------------------------
// Local Variables


//------------------------------------------------------------------------------
// Local Functions


//------------------------------------------------------------------------------
//
// Function: BSPBacklightInitialize
//
//
// Parameters:
//      None.
//
// Returns:
//      None.
//
//------------------------------------------------------------------------------
void BSPBacklightInitialize()
{
    // initalize the Diplay backlight to a current control mode
    PmicBacklightSetMode(BACKLIGHT_MAIN_DISPLAY, BACKLIGHT_CURRENT_CTRL_MODE);

    // set to the minimum period
    PmicBacklightSetCycleTime(MC13783_LED_MIN_BACKLIGHT_PERIOD);

    // set the current level for Display
    PmicBacklightSetCurrentLevel(BACKLIGHT_MAIN_DISPLAY,
                                 MC13783_LED_DEFAULT_BACKLIGHT_CURRENT_LEVEL);

    // set the PWM dutycycle 
    PmicBacklightSetDutyCycle(BACKLIGHT_MAIN_DISPLAY, 
                                 MC13783_LED_DEFAULT_BACKLIGHT_DUTY_CYCLE);
    
    // turn on Master enable
    PmicBacklightMasterEnable();

}


//------------------------------------------------------------------------------
//
// Function: BSPBacklightRelease
//
// 
//
// Parameters:
//      None.
//
// Returns:
//      None.
//
//------------------------------------------------------------------------------
void BSPBacklightRelease()
{
    return;
}


//------------------------------------------------------------------------------
//
// Function: BSPBacklightSetIntensity
//
// 
//
// Parameters:
//      None.
//
// Returns:
//      None.
//
//------------------------------------------------------------------------------
void BSPBacklightSetIntensity(DWORD level)
{
  	static UINT8 Backlight_Off = 0x0;

	if(level == 0)
	{
		PmicBacklightMasterDisable();
		Backlight_Off = 0x1;
	}

	if((Backlight_Off == 0x1) && (level != 0x0))
	{
		PmicBacklightMasterEnable();
		Backlight_Off = 0x0;
	}

    // set the current level for max for the Display
    PmicBacklightSetDutyCycle(BACKLIGHT_MAIN_DISPLAY, (UINT8)level);

}

⌨️ 快捷键说明

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