Index: yc_power.h
===================================================================
--- /YC3121_SDK/fw/sdk/yc_power.h	(nonexistent)
+++ /YC3121_SDK/fw/sdk/yc_power.h	(working copy)
@@ -0,0 +1,21 @@
+/*
+File Name    : yc_adc.h
+Author       : Yichip
+Version      : V1.0
+Date         : 2020/03/10
+Description  : POWER encapsulation.
+*/
+
+#ifndef __YC_POWER_H__
+#define __YC_POWER_H__
+
+#include "yc3121.h"
+#include "type.h"
+#include "yc_timer.h"
+#include "yc_lpm.h"
+
+Boolean Power_Keyscan(void);
+
+Boolean Power_off(void);
+
+#endif

Index: yc_power.c
===================================================================
--- /YC3121_SDK/fw/sdk/yc_power.c	(nonexistent)
+++ /YC3121_SDK/fw/sdk/yc_power.c	(working copy)
@@ -0,0 +1,31 @@
+#include "yc_power.h"
+
+#define POWER_GPIO_WEAKUP_BIT 31
+#define POWER_CHRG_WEAKUP_BIT 30
+
+Boolean Power_Keyscan(void)
+{
+	uint32_t powerkeystat = SYSCTRL_STATUS;
+	
+	if (powerkeystat & ((uint32_t)0x1 << POWER_GPIO_WEAKUP_BIT))
+	{
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+Boolean Power_off(void)
+{
+	uint32_t data;
+	uint32_t powerkeystat = SYSCTRL_STATUS;
+	
+	if(!(powerkeystat & ((uint32_t)0x1 << POWER_CHRG_WEAKUP_BIT)))
+	{
+		while(Power_Keyscan());
+		data = lpm_bt_read(LPMBT_CONTROL0);
+		lpm_bt_write(LPMBT_CONTROL0, data & 0xfffbffff);
+	}
+
+	return FALSE;
+}
