/*******************************************************************************
|
* File Name : RTC.c
|
* Description :
|
* Created on : 2019Äê3ÔÂ10ÈÕ
|
* Author : ¶Å¼ü
|
*******************************************************************************/
|
|
/*******************************************************************************
|
* Include Files *
|
*******************************************************************************/
|
#include "RTC.h"
|
#include "stm32f4xx_hal.h"
|
|
/*******************************************************************************
|
* Macro *
|
*******************************************************************************/
|
|
/*******************************************************************************
|
* Type Definition *
|
*******************************************************************************/
|
|
/*******************************************************************************
|
* Local Variable *
|
*******************************************************************************/
|
|
|
/*******************************************************************************
|
* Local Function Declaration *
|
*******************************************************************************/
|
|
/*******************************************************************************
|
* Local Function *
|
*******************************************************************************/
|
|
/*******************************************************************************
|
* Global Function *
|
*******************************************************************************/
|
|
/*******************************************************************************
|
* Function Name : RTC_GetDateTime
|
* Description : ´ÓRTCÖлñÈ¡ÈÕÆÚ¼°Ê±¼ä
|
* Input : None
|
* Output : _pstDateTime ÈÕÆÚʱ¼ä
|
* Return : HIDO_RESULT_ERR ʧ°Ü
|
* HIDO_RESULT_OK ³É¹¦
|
* Author : www.hido-studio.com
|
* Modified Date: : 2017-09-22
|
*******************************************************************************/
|
|
/*******************************************************************************
|
* Function Name : RTC_GetDSeconds
|
* Description :
|
* Input : None
|
* : None
|
* Output : None
|
* Return : ÃëÊý
|
* Author : www.hido-studio.com
|
* Modified Date: : 2017-09-22
|
*******************************************************************************/
|
HIDO_UINT32 RTC_GetSeconds(void)
|
{
|
ST_RTCDateTime stDataTime;
|
|
// RTC_GetDateTime(&stDataTime);
|
|
//return RTC_MakeTime(&stDataTime);
|
return 0;
|
}
|
|
/*******************************************************************************
|
* Function Name : RTC_SetWakeUp
|
* Description :
|
* Input :
|
* Output :
|
* Return :
|
* Author : www.hido-studio.com
|
* Modified Date: : 2017-09-22
|
*******************************************************************************/
|
HIDO_INT32 RTC_SetWakeUp(HIDO_UINT32 _u32Ms)
|
{
|
#if 0
|
/*
|
* DIV(16) / LSI(32.768K);
|
* 60s / (DVI / LSI) = 122880
|
*/
|
//__HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG();
|
if (HAL_RTCEx_SetWakeUpTimer_IT(l_pstRTC, _u32Ms / (16 / 32.768), RTC_WAKEUPCLOCK_RTCCLK_DIV16) != HAL_OK)
|
{
|
return HIDO_ERR;
|
}
|
#endif
|
|
return HIDO_OK;
|
}
|
|
/*******************************************************************************
|
* Function Name : RTC_Init
|
* Description : RTC³õʼ»¯
|
* Input : _pRTC RTCÃèÊöÖ¸Õë
|
* Output : None
|
* Return : None
|
* Author : www.hido-studio.com
|
* Modified Date: : 2017-09-22
|
*******************************************************************************/
|