/******************************************************************************* * File Name : RTC.h * Description : * Created on : 2018Äê4ÔÂ25ÈÕ * Author : ¶Å¼ü *******************************************************************************/ #ifndef HAL_RTC_H_ #define HAL_RTC_H_ /******************************************************************************* * Include Files * *******************************************************************************/ #include "stm32l0xx_hal.h" #include "HIDO_TypeDef.h" /******************************************************************************* * Macro * *******************************************************************************/ /******************************************************************************* * Type Definition * *******************************************************************************/ typedef struct { HIDO_UINT32 m_u32Year; /* Äê */ HIDO_UINT8 m_u8Month; /* Ô */ HIDO_UINT8 m_u8Day; /* ÈÕ */ HIDO_UINT8 m_u8Hour; /* ʱ */ HIDO_UINT8 m_u8Min; /* ·Ö */ HIDO_UINT8 m_u8Sec; /* Ãë */ } ST_RTCDateTime; /******************************************************************************* * Global Function * *******************************************************************************/ /******************************************************************************* * Function Name : RTC_Init * Description : RTC³õʼ»¯ * Input : _pRTC RTCÃèÊöÖ¸Õë * Output : None * Return : None * Author : hido.ltd *******************************************************************************/ void RTC_Init(void *_pRTC); /******************************************************************************* * Function Name : RTC_MakeTime * Description : ½«ÄêÔÂÈÕʱ·ÖÃëת³ÉUTCÃëÊý£¬²ÉÓÃLINUXÄÚºËËã·¨ * Input : _pstDateTime ÈÕÆÚʱ¼ä * Output : None * Return : UTCÃëÊý * Author : hido.ltd * Modified Date: : 2017-09-22 *******************************************************************************/ HIDO_UINT32 RTC_MakeTime(ST_RTCDateTime *_pstDateTime); /******************************************************************************* * Function Name : RTC_GetDateTime * Description : ´ÓRTCÖлñÈ¡ÈÕÆÚ¼°Ê±¼ä * Input : None * Output : _pstDateTime ÈÕÆÚʱ¼ä * Return : HIDO_ERR ʧ°Ü * HIDO_OK ³É¹¦ * Author : hido.ltd *******************************************************************************/ HIDO_INT32 RTC_GetDateTime(ST_RTCDateTime *_pstDateTime); /******************************************************************************* * Function Name : RTC_SetDateTime * Description : ÉèÖÃÈÕÆÚ¼°Ê±¼ä * Input : _pstDateTime ÈÕÆÚʱ¼ä * Output : None * Return : HIDO_ERR ʧ°Ü * HIDO_OK ³É¹¦ * Author : hido.ltd *******************************************************************************/ HIDO_INT32 RTC_SetDateTime(ST_RTCDateTime *_pstDateTime); /******************************************************************************* * Function Name : RTC_GetDiffSeconds * Description : ¼ÆËãʱ¼ä_pstDateTime0ºÍʱ¼ä_pstDateTime1µÄÃëÊý²îÖµ * Input : _pstDateTime0 ÈÕÆÚʱ¼ä0 * : _pstDateTime1 ÈÕÆÚʱ¼ä1 * Output : None * Return : ÃëÊý * Author : hido.ltd * Modified Date: : 2017-09-22 *******************************************************************************/ HIDO_UINT32 RTC_GetDiffSeconds(ST_RTCDateTime *_pstDateTime0, ST_RTCDateTime *_pstDateTime1); /******************************************************************************* * Function Name : RTC_GetDiffSeconds * Description : ¼ÆËãʱ¼ä_pstDateTime0ºÍʱ¼ä_pstDateTime1µÄÃëÊý²îÖµ * Input : _pstDateTime0 ÈÕÆÚʱ¼ä0 * : _pstDateTime1 ÈÕÆÚʱ¼ä1 * Output : None * Return : ÃëÊý * Author : hido.ltd *******************************************************************************/ HIDO_UINT32 RTC_GetTimeStamp(void); /******************************************************************************* * Function Name : RTC_SetWakeUp * Description : * Input : * Output : * Return : * Author : hido.ltd *******************************************************************************/ HIDO_INT32 RTC_SetWakeUp(HIDO_UINT32 _u32Ms); #endif /* HAL_RTC_H_ */