8051-ELL库  beta 1.1.6
8051-ELL library API Document Center
STC8x_POWER.h 文件参考
#include "ELL_CORE.h"
#include "STC8Ax_REG.h"
STC8x_POWER.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

宏定义

#define PER_LIB_MCU_MUODEL   STC8Ax
 如果没有定义这个宏,默认为STC8Ax。 If the mirco is undefined,select to STC8Ax 更多...
 
#define PER_LIB_POWER_CTRL   1
 如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1" 更多...
 
#define PER_LIB_POWER_NVIC_CTRL   1
 如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1" 更多...
 
#define PER_LIB_POWER_WORK_CTRL   1
 如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1" 更多...
 
#define POWER_GET_WORK_MODE()   (PCON & 0x10)
 获取电源工作模式函数。 更多...
 
#define ESH_CURRENT_ENABLE()   VOCTRL = 0x80 /* Use external */
 使能外部静态电流保持电流控制电路,功耗更低。 更多...
 
#define ESH_CURRENT_DISABLE()   VOCTRL = 0x00 /* Use internal */
 不使能外部静态电流保持电流控制电路, 选择内部的静态电流保持电流控制电路。 更多...
 
#define LVD_GET_FLAG()   (PCON & 0x20)
 获取比较中断标志位宏函数。 更多...
 
#define LVD_CLEAR_FLAG()   do{PCON &= 0xDF;}while(0)
 清除比较中断标志位宏函数。 更多...
 
#define NVIC_LVD_CTRL(run)   do{ELVD = run;}while(0)
 LVD中断开关控制宏函数。 更多...
 
#define NVIC_LVD_PRI(pri)
 LVD选择中断优先级宏函数,仅限本文件调用。 更多...
 

枚举

enum  POWERMode_Type { POWER_Mode_Normal = 0x00 , POWER_Mode_Stop = 0x02 , POWER_Mode_Idle = 0x03 }
 电源工作模式枚举体。 更多...
 

函数

FSCSTATE POWER_Mode_Ctrl (POWERMode_Type mode)
 电源工作模式控制函数。 更多...
 
FSCSTATE NVIC_LVD_Init (NVICPri_Type priority, BOOL run)
 低压检测中断初始化函数。 更多...
 

宏定义说明

◆ ESH_CURRENT_DISABLE

#define ESH_CURRENT_DISABLE ( )    VOCTRL = 0x00 /* Use internal */

不使能外部静态电流保持电流控制电路, 选择内部的静态电流保持电流控制电路。

Disable external quiescent current to maintain current control circuit, lower power consumption.

◆ ESH_CURRENT_ENABLE

#define ESH_CURRENT_ENABLE ( )    VOCTRL = 0x80 /* Use external */

使能外部静态电流保持电流控制电路,功耗更低。

Enable external quiescent current to maintain current control circuit, lower power consumption.

◆ LVD_CLEAR_FLAG

#define LVD_CLEAR_FLAG ( )    do{PCON &= 0xDF;}while(0)

清除比较中断标志位宏函数。

LVD clears interrupt flag bit macro function.

返回
[bit] 完成(也是中断)标志位。Completion (interrupt) flag bit.

◆ LVD_GET_FLAG

#define LVD_GET_FLAG ( )    (PCON & 0x20)

获取比较中断标志位宏函数。

LVD gets interrupt flag bit macro function.

返回
[bit] 完成(也是中断)标志位。Completion (interrupt) flag bit.

◆ NVIC_LVD_CTRL

#define NVIC_LVD_CTRL (   run)    do{ELVD = run;}while(0)

LVD中断开关控制宏函数。

LVD interrupt switch control macro function.

参数
[in]run使能控制位。Enable control bit.

◆ NVIC_LVD_PRI

#define NVIC_LVD_PRI (   pri)
值:
do{ \
IPH = (IPH & 0xBF) | ((pri & 0x02) << 5); \
IP = (IP & 0xBF) | ((pri & 0x01) << 6); \
}while(0)
sfr IPH
Definition: STC15x_REG.h:212
sfr IP
Definition: STC15x_REG.h:210

LVD选择中断优先级宏函数,仅限本文件调用。

LVD select interrupt priority macro function, only this file call.

参数
[in]pri中断优先级。 Priority of interrupt.

◆ PER_LIB_MCU_MUODEL

#define PER_LIB_MCU_MUODEL   STC8Ax

如果没有定义这个宏,默认为STC8Ax。 If the mirco is undefined,select to STC8Ax

◆ PER_LIB_POWER_CTRL

#define PER_LIB_POWER_CTRL   1

如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"

◆ PER_LIB_POWER_NVIC_CTRL

#define PER_LIB_POWER_NVIC_CTRL   1

如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"

◆ PER_LIB_POWER_WORK_CTRL

#define PER_LIB_POWER_WORK_CTRL   1

如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"

◆ POWER_GET_WORK_MODE

#define POWER_GET_WORK_MODE ( )    (PCON & 0x10)

获取电源工作模式函数。

PGet power mode function.

返回
POWERMode_Type 电源工作模式。

枚举类型说明

◆ POWERMode_Type

电源工作模式枚举体。

Power mode enumerator.

枚举值
POWER_Mode_Normal 

正常模式。 Power normal mode.

POWER_Mode_Stop 

掉电模式。Power down mode.

POWER_Mode_Idle 

空闲模式。Power idle mode.

函数说明

◆ NVIC_LVD_Init()

FSCSTATE NVIC_LVD_Init ( NVICPri_Type  priority,
BOOL  run 
)

低压检测中断初始化函数。

Low-voltage detection interrupt initialization function.

参数
[in]pri中断优先级。Interrupt priority.
[in]run中断运行控制位。Interrupt operation control bit.
返回
FSC_SUCCESS 返回成功。Return to success.
FSC_FAIL 返回失败。Return to fail.

◆ POWER_Mode_Ctrl()

FSCSTATE POWER_Mode_Ctrl ( POWERMode_Type  mode)

电源工作模式控制函数。

Power mode configure function.

参数
[in]mode电源工作模式。Power working mode.
返回
FSC_SUCCESS 返回成功。Return to success.
FSC_FAIL 返回失败。Return to fail.