32 #ifndef __STC8x_POWER_H_
33 #define __STC8x_POWER_H_
43 #if (PER_LIB_MCU_MUODEL == STC8Ax)
45 #elif (PER_LIB_MCU_MUODEL == STC8Cx)
47 #elif (PER_LIB_MCU_MUODEL == STC8Fx)
49 #elif (PER_LIB_MCU_MUODEL == STC8Gx)
51 #elif (PER_LIB_MCU_MUODEL == STC8Hx)
59 #ifndef PER_LIB_MCU_MUODEL
62 #define PER_LIB_MCU_MUODEL STC8Ax
66 #ifndef PER_LIB_POWER_CTRL
69 #define PER_LIB_POWER_CTRL 1
73 #ifndef PER_LIB_POWER_NVIC_CTRL
76 #define PER_LIB_POWER_NVIC_CTRL 1
80 #ifndef PER_LIB_POWER_WORK_CTRL
83 #define PER_LIB_POWER_WORK_CTRL 1
101 #if (PER_LIB_POWER_CTRL == 1)
103 #if (PER_LIB_POWER_WORK_CTRL == 1)
119 #define POWER_GET_WORK_MODE() (PCON & 0x10)
127 #define ESH_CURRENT_ENABLE() VOCTRL = 0x80
136 #define ESH_CURRENT_DISABLE() VOCTRL = 0x00
140 #if (PER_LIB_POWER_NVIC_CTRL == 1)
157 #define LVD_GET_FLAG() (PCON & 0x20)
164 #define LVD_CLEAR_FLAG() do{PCON &= 0xDF;}while(0)
171 #define NVIC_LVD_CTRL(run) do{ELVD = run;}while(0)
180 #define NVIC_LVD_PRI(pri) \
182 IPH = (IPH & 0xBF) | ((pri & 0x02) << 5); \
183 IP = (IP & 0xBF) | ((pri & 0x01) << 6); \
NVICPri_Type
Definition: ELL_CORE.h:99
BOOL
Definition: ELL_CORE.h:50
FSCSTATE
Definition: ELL_CORE.h:65
FSCSTATE NVIC_LVD_Init(NVICPri_Type priority, BOOL run)
低压检测中断初始化函数。
Definition: STC8x_POWER.c:65
POWERMode_Type
电源工作模式枚举体。
Definition: STC8x_POWER.h:92
@ POWER_Mode_Normal
Definition: STC8x_POWER.h:93
@ POWER_Mode_Idle
Definition: STC8x_POWER.h:95
@ POWER_Mode_Stop
Definition: STC8x_POWER.h:94
FSCSTATE POWER_Mode_Ctrl(POWERMode_Type mode)
电源工作模式控制函数。
Definition: STC8x_POWER.c:50