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

📄 power.c

📁 Freescale ARM9系列CPU MX27的WINCE 5.0下的BSP
💻 C
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft 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.
//
//------------------------------------------------------------------------------
//
// Copyright (C) 2004-2006,2007 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
//
//------------------------------------------------------------------------------
//
//  Module: power.c
//
//  BSP specific implementation for power management on MX27 reference platform.
//
//------------------------------------------------------------------------------
#include "bsp.h"

//-----------------------------------------------------------------------------
//
//  Function: OALCPUPowerOff
//
//  This function puts the CPU or SOC in idle state. 
//  The CPU or SOC should exit the idle state when an interrupt occurs. 
//  This function is called with interrupts are disabled. 
//  When this function returns, interrupts must be disabled also.
//
//  Parameters:
//      None.
//
//  Returns:
//      None.
//
//-----------------------------------------------------------------------------
VOID OALCPUPowerOff()
{        
#if OAL_FAKE_IDLE
    CSP_AITC_REGS *pAITC;

    pAITC = (CSP_AITC_REGS *)OALPAtoUA(CSP_BASE_REG_PA_AITC);
    // Wait until AITC reports an interrupt is pending
    while((!INREG32(&pAITC->NIPNDH)) && (!INREG32(&pAITC->NIPNDL)));
#else
    // Use CP15 instruction to execute an ARM wait-for-interrupt
    _MoveToCoprocessor(0, 15, 0, 7, 0, 4);
#endif
}

//-----------------------------------------------------------------------------
//
//  Function: OALCPUPowerOn
//
//  This function restores all clock as pre-suspend status.
//
//  Parameters:
//      None.
//
//  Returns:
//      None.
//
//-----------------------------------------------------------------------------
VOID OALCPUPowerOn()
{ 
}    

//------------------------------------------------------------------------------
//
//  Function:  BSPPowerOff
//
//  This function is called to setup Power Off mode on board level.
//
VOID BSPPowerOff()
{
    OALMSG(OAL_FUNC&&OAL_POWER, (L"+BSPPowerOff\r\n"));

    OALMSG(OAL_FUNC&&OAL_POWER, (L"-BSPPowerOff\r\n"));
}    

//------------------------------------------------------------------------------
//
//  Function:  BSPPowerOn
//
//  This function is called to restore system after Power Off mode on board level.
//
VOID BSPPowerOn()
{
    OALMSG(OAL_FUNC&&OAL_POWER, (L"+BSPPowerOn\r\n"));

    OALMSG(OAL_FUNC&&OAL_POWER, (L"-BSPPowerOn\r\n"));
}       

//------------------------------------------------------------------------------

⌨️ 快捷键说明

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