1 /*
2  * ==========================================================
3  *
4  *    Copyright (C) 2020 QuickLogic Corporation
5  *    Licensed under the Apache License, Version 2.0 (the "License");
6  *    you may not use this file except in compliance with the License.
7  *    You may obtain a copy of the License at
8  * 		http://www.apache.org/licenses/LICENSE-2.0
9  *    Unless required by applicable law or agreed to in writing, software
10  *    distributed under the License is distributed on an "AS IS" BASIS,
11  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  *    See the License for the specific language governing permissions and
13  *    limitations under the License.
14  *
15  *    File      : eoss3_hal_rtc.h
16  *    Purpose :
17  *
18  * ===========================================================
19  *
20  */
21 #ifndef __EOSS3_HAL_RTC_H__
22 #define __EOSS3_HAL_RTC_H__
23 #include <stdio.h>
24 #include "eoss3_hal_def.h"
25 
26 /*
27  * HAL_RTC_Init : Initializes the rtc with the value uiInitialRTCTimeValueSecs.
28  * This call can happen only once & same is taken care inside this api. Second
29  * time call will not have any effect.
30  * RTC will start counting from this value. This value can be changed in runtime
31  * using API HAL_RTC_SetTime
32  */
33 HAL_StatusTypeDef HAL_RTC_Init(uint32_t uiInitialRTCTimeValueSecs);
34 
35 /*
36  * HAL_RTC_SetupAlarm : Setup RTC to interrupt every "rtc_alarm_interval" seconds & call
37  * rtc_cb
38  */
39 HAL_StatusTypeDef HAL_RTC_SetupAlarm(uint32_t rtc_alarm_interval, void (*rtc_cb)(void));
40 
41 /*
42  * HAL_RTC_SetTime : RTC will start counting from the value uiRTCValueSecs
43  */
44 HAL_StatusTypeDef HAL_RTC_SetTime(uint32_t uiRTCValueSecs);
45 
46 /*
47  * HAL_RTC_GetTime : RTC will return current seconds counted in uiRTCValueSecs
48  */
49 HAL_StatusTypeDef HAL_RTC_GetTime(uint32_t *uiRTCValueSecs);
50 
51 void HAL_RTC_ISR(void);
52 
53 #endif