Index: yc_rtc.h
===================================================================
--- /YC3121_SDK/fw/sdk/yc_rtc.h	(revision 590)
+++ /YC3121_SDK/fw/sdk/yc_rtc.h	(working copy)
@@ -13,31 +13,31 @@
 #include "yc_lpm.h"
 
 /**
- * @brief  Reset RTC Counter
+ * @brief set RTC reference Register
  *
- * @param  none
+ * @param RefRegValue:reference Register value
  *
  * @retval none
  */
-void RTC_ResetCounter(void);
+void RTC_SetRefRegister(uint32_t RefRegValue);
 
 /**
- * @brief  get RTC Counter
+ * @brief Get RTC reference Register
  *
- * @param  none
+ * @param RefRegValue:reference Register value
  *
- * @retval RTC Count
+ * @retval RTC reference Register
  */
-uint32_t RTC_GetCounter(void);
+uint32_t RTC_GetRefRegister(void);
 
 /**
- * @brief  set RTC reference Register
+ * @brief set RTC WakeUp time(s)
  *
- * @param  RefRegValue : reference Register value
+ * @param wake_RefRegValue:when RefRegValue==wake_RefRegValue WakeUp and into interrupt
  *
  * @retval none
  */
-void RTC_SetRefRegister(uint32_t RefRegValue);
+void RTC_SetWakeUpCounter(uint32_t wake_RefRegValue);
 
 /**
  * @brief clear RTC interrupt
@@ -77,12 +77,12 @@
 void RTC_Config(FunctionalState NewState);
 
 /**
- * @brief Get the value of timeout count seted.
+ * @brief Get RTC SecMax through 24M crystal.
  *
  * @param none
  *
- * @retval none
+ * @retval SecMax
  */
-uint32_t RTC_GetRefRegister(void);
+uint16_t RTC_Get_SexMax(void);
 
 #endif   /* __YC_RTC_H__ */

Index: yc_rtc.c
===================================================================
--- /YC3121_SDK/fw/sdk/yc_rtc.c	(revision 590)
+++ /YC3121_SDK/fw/sdk/yc_rtc.c	(working copy)
@@ -2,7 +2,7 @@
 File Name    : yc_rtc.c
 Author       : Yichip
 Version      : V1.0
-Date         : 2019/12/13
+Date         : 2020/02/19
 Description  : RTC encapsulation.
 */
 #include "yc_rtc.h"
@@ -10,24 +10,19 @@
 #define RTC_TIMER_ENABLE_BIT        17
 #define RTC_TIMEOUT_INTR_STATUS_BIT 31
 
-void RTC_ResetCounter(void)
+void RTC_SetRefRegister(uint32_t RefRegValue)
 {
-	lpm_write(LPM_RTC_CNT,0);
+	lpm_write(LPM_RTC_CNT, RefRegValue);
 }
 
-uint32_t  RTC_GetCounter(void)
+uint32_t RTC_GetRefRegister(void)
 {
 	return (lpm_read(LPM_RTC_CNT));
 }
 
-void RTC_SetRefRegister(uint32_t RefRegValue)
-{
-	lpm_write(LPM_WKUP_TIMER,RefRegValue);
-}
-
-uint32_t RTC_GetRefRegister(void)
+void RTC_SetWakeUpCounter(uint32_t cnt)
 {
-	return (lpm_read(LPM_WKUP_TIMER));
+	lpm_write(LPM_WKUP_TIMER, cnt);
 }
 
 void RTC_Config(FunctionalState NewState)
@@ -71,3 +66,14 @@
 	temp |= 0x6c;
 	lpm_write(LPM_CLR_INTR,temp);
 }
+
+uint16_t RTC_Get_SexMax(void)
+{
+	*(volatile byte*)0xc8042 = 0xc4;
+	*(volatile byte*)0xc800a = 0x80;
+	delay(10000000);
+	int mem_810a = *(volatile byte*)0xc810a;
+	mem_810a += (*(volatile byte*)0xc810b) << 8;
+	mem_810a += (*(volatile byte*)0xc810c) << 16;
+	return 49152000000 / mem_810a;
+}
