📄 tmpowerdown.c
字号:
/*
* +-------------------------------------------------------------------+
* | Copyright (c) 1995,1996,1997,1998 by TriMedia Technologies. |
* | |
* | This software is furnished under a license and may only be used |
* | and copied in accordance with the terms and conditions of such a |
* | license and with the inclusion of this copyright notice. This |
* | software or any other copies of this software may not be provided |
* | or otherwise made available to any other person. The ownership |
* | and title of this software is not transferred. |
* | |
* | The information in this software is subject to change without |
* | any prior notice and should not be construed as a commitment by |
* | TriMedia Technologies. |
* | |
* | This code and information is provided "as is" without any |
* | warranty of any kind, either expressed or implied, including but |
* | not limited to the implied warranties of merchantability and/or |
* | fitness for any particular purpose. |
* +-------------------------------------------------------------------+
*
*
* Module name : tmPowerdown.c 1.4
*
* Last update : 19:40:24 - 00/11/09
*
*
* Description : Powerdown library for tm1100 rev1.3
* DO NOT DISTRIBUTE
*
* This function can powerdown ICP and EVO.
*
* Revision :
*
*/
/*-----------------------------includes-------------------------------------*/
#include <tm1/mmio.h>
#include <tm1/tmPowerdown.h>
#include <tm1/tmICPmmio.h>
/*-----------------------------defines--------------------------------------*/
#define VV_CTL (0x105018)
#define TM_POWERDOWN_VV (UInt32)(1 << 31)
/*-----------------------------functions------------------------------------*/
tmLibdevErr_t
tmPowerdown(UInt32 units)
{
#ifdef __TCS_tm1__
extern UInt32 _micro_code_pwdn[];
/* powerdown this part by default */
if ((units & TM_POWERDOWN_VV)==0) {
MMIO(VV_CTL) = 0x00000007;
}
/* powerdown EVO if EVO bit set */
if (units & TM_POWERDOWN_EVO) {
MMIO(EVO_CTL) = 0x00000080;
}
/* powerdown ICP if ICP bit set */
if (units & TM_POWERDOWN_ICP) {
MMIO(ICP_MPC) = (UInt32) _micro_code_pwdn;
#ifdef __LITTLE_ENDIAN__
MMIO(ICP_SR) = ICP_BUSY | ICP_LITTLE_ENDIAN;
#else
MMIO(ICP_SR) = ICP_BUSY;
#endif
}
#endif
return TMLIBDEV_OK;
}
/*--------------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -