WXK
2024-10-16 08b03003355d51abd21fdf97dd4a4f0225092dc6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*******************************************************************************
 * 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_ */