chen
2024-09-20 292ed46c6066d47289f1330b1c2bcc6d74761f95
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
/*******************************************************************************
 * 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
 *******************************************************************************/