📄 pwr.c
字号:
/*============================================================================
____________________________________________________________________________
______________________________________________
SSSS M M CCCC Standard Microsystems Corporation
S MM MM SSSS C Austin Design Center
SSS M M M S C 11000 N. Mopac Expressway
S M M SSS C Stonelake Bldg. 6, Suite 500
SSSS M M S CCCC Austin, Texas 78759
SSSS ______________________________________________
____________________________________________________________________________
Copyright(C) 1999, Standard Microsystems Corporation
All Rights Reserved.
This program code listing is proprietary to SMSC and may not be copied,
distributed, or used without a license to do so. Such license may have
Limited or Restricted Rights. Please refer to the license for further
clarification.
____________________________________________________________________________
Notice: The program contained in this listing is a proprietary trade
secret of SMSC, Hauppauge, New York, and is copyrighted
under the United States Copyright Act of 1976 as an unpublished work,
pursuant to Section 104 and Section 408 of Title XVII of the United
States code. Unauthorized copying, adaption, distribution, use, or
display is prohibited by this law.
____________________________________________________________________________
Use, duplication, or disclosure by the Government is subject to
restrictions as set forth in subparagraph(c)(1)(ii) of the Rights
in Technical Data and Computer Software clause at DFARS 52.227-7013.
Contractor/Manufacturer is Standard Microsystems Corporation,
80 Arkay Drive, Hauppauge, New York, 1178-8847.
____________________________________________________________________________
____________________________________________________________________________
device.c - the device manager implementarion
____________________________________________________________________________
comments tbd
____________________________________________________________________________
Revision History
Date Who Comment
________ ___ _____________________________________________________________
12/16/02 cds initial version - transferred from device.c
===========================================================================*/
//------------------------------------------------------------------------------
#ifdef k_mcu_97223
#include "project.h"
#include "dev.h"
xdata t_pwr_mode g_pwr_mode;
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void pwr_initialize(void) reentrant
{
// power-on value of pwr mgt register is for low power
g_pwr_mode=k_pwr_mode_low;
trace0(0, pwr, 0, "g_pwr_mode: k_power_mode_low");
}
//------------------------------------------------------------------------------
#pragma NOAREGS
void pwr_set_full_power_mode(void) reentrant
{
// always allow full power mode to be set. If disabled, the init routine will call this to
// enable full power mode.
trace0(0, pwr, 0, "pwr_set_full_power_mode() -- enabling all register banks");
if( _dev_pwr_mgmt_disabled() )
{
trace0(0, pwr, 0, "enabling full power, cf_ce and sm_ce pull-ups") ;
_mcu_register_set_bits(x_pwr_mgmt_ctl, kbm_pwr_mgmt_ctl_full_power);
}
_mcu_register_set_bits(x_pwr_mgmt_ctl, kbm_pwr_mgmt_ctl_configed);
g_pwr_mode=k_pwr_mode_full;
trace1(0, pwr, 0, "x_pwr_mgmt_ctl:%02x", x_pwr_mgmt_ctl);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void pwr_set_parial_power_mode() reentrant
{
if( _dev_pwr_mgmt_disabled() )
return;
trace0(0, pwr, 0, "pwr_set_parial_power_mode() -- enabling sm pio registers");
_mcu_register_set_bits(x_pwr_mgmt_ctl, kbm_pwr_mgmt_ctl_sm_pio_access);
_mcu_register_clr_bits(x_pwr_mgmt_ctl, kbm_pwr_mgmt_ctl_configed);
g_pwr_mode=k_pwr_mode_partial;
trace1(0, pwr, 0, "x_pwr_mgmt_ctl:%02x", x_pwr_mgmt_ctl);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void pwr_set_low_power_mode(void) reentrant
{
if( _dev_pwr_mgmt_disabled() )
return;
trace0(0, pwr, 0, "pwr_set_low_power_mode() -- powering down to low-power mode");
_mcu_register_clr_bits(x_pwr_mgmt_ctl, kbm_pwr_mgmt_ctl_configed|kbm_pwr_mgmt_ctl_sm_pio_access);
g_pwr_mode=k_pwr_mode_low;
trace1(0, pwr, 0, "x_pwr_mgmt_ctl:%02x", x_pwr_mgmt_ctl);
}
#pragma AREGS
#endif // k_mcu_97223
// eof -------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -