MAX32655 Peripheral Driver API
Peripheral Driver API for the MAX32655
rtc.h
1 
6 /* ****************************************************************************
7  * Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved.
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a
10  * copy of this software and associated documentation files (the "Software"),
11  * to deal in the Software without restriction, including without limitation
12  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13  * and/or sell copies of the Software, and to permit persons to whom the
14  * Software is furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
23  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  *
27  * Except as contained in this notice, the name of Maxim Integrated
28  * Products, Inc. shall not be used except as stated in the Maxim Integrated
29  * Products, Inc. Branding Policy.
30  *
31  * The mere transfer of this software does not imply any licenses
32  * of trade secrets, proprietary technology, copyrights, patents,
33  * trademarks, maskwork rights, or any other form of intellectual
34  * property whatsoever. Maxim Integrated Products, Inc. retains all
35  * ownership rights.
36  *
37  *
38  * $Date: 2018-08-28 17:03:02 -0500 (Tue, 28 Aug 2018) $
39  * $Revision: 37424 $
40  *************************************************************************** */
41 
42 /* Define to prevent redundant inclusion */
43 #ifndef _RTC_H_
44 #define _RTC_H_
45 
46 /* **** Includes **** */
47 #include <stdint.h>
48 #include "mxc_device.h"
49 #include "rtc_regs.h"
50 #include "mxc_sys.h"
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
62 /* **** Definitions **** */
66 typedef enum {
72 
76 typedef enum {
81 
85 typedef enum {
90 
96 int MXC_RTC_SetTimeofdayAlarm (uint32_t ras);
97 
104 int MXC_RTC_SetSubsecondAlarm (uint32_t rssa);
105 
110 int MXC_RTC_Start (void);
115 int MXC_RTC_Stop (void);
116 
123 int MXC_RTC_Init (uint32_t sec, uint8_t ssec);
124 
131 
136 int MXC_RTC_SquareWaveStop (void);
137 
143 int MXC_RTC_Trim (int8_t trm);
144 
151 int MXC_RTC_EnableInt (uint32_t mask);
152 
159 int MXC_RTC_DisableInt (uint32_t mask);
160 
167 int MXC_RTC_GetFlags (void);
168 
175 int MXC_RTC_ClearFlags (int flags);
176 
181 int MXC_RTC_GetSubSecond (void);
182 
187 int MXC_RTC_GetSecond (void);
188 
195 int MXC_RTC_GetTime (uint32_t* sec, uint32_t* subsec);
196 
198 #ifdef __cplusplus
199 }
200 #endif
201 
202 #endif /* _RTC_H_ */
int MXC_RTC_GetSubSecond(void)
Get SubSecond.
int MXC_RTC_SetSubsecondAlarm(uint32_t rssa)
Set Sub-Second alarm value and enable interrupt,.
#define MXC_F_RTC_CTRL_RDY
Definition: rtc_regs.h:179
Definition: rtc.h:79
int MXC_RTC_ClearFlags(int flags)
Clear interrupt flags.
int MXC_RTC_SetTimeofdayAlarm(uint32_t ras)
Set Time-of-Day alarm value and enable Interrupt.
Definition: rtc.h:70
int MXC_RTC_GetTime(uint32_t *sec, uint32_t *subsec)
Get the time using nuclear fusion. Or atomically. Something like that.
#define MXC_F_RTC_CTRL_TOD_ALARM_IE
Definition: rtc_regs.h:170
#define MXC_F_RTC_CTRL_RDY_IE
Definition: rtc_regs.h:182
mxc_rtc_freq_sel_t
Definition: rtc.h:66
int MXC_RTC_Start(void)
Start the Real Time Clock.
#define MXC_S_RTC_CTRL_SQW_SEL_FREQ512HZ
Definition: rtc_regs.h:198
int MXC_RTC_Init(uint32_t sec, uint8_t ssec)
Initialize the sec and ssec registers and enable RTC.
int MXC_RTC_SquareWaveStop(void)
Stop the generation of square wave.
Definition: rtc.h:77
Definition: rtc.h:68
int MXC_RTC_EnableInt(uint32_t mask)
Enable Interurpts.
Definition: rtc.h:67
#define MXC_S_RTC_CTRL_SQW_SEL_FREQ1HZ
Definition: rtc_regs.h:196
#define MXC_F_RTC_CTRL_TOD_ALARM
Definition: rtc_regs.h:185
#define MXC_F_RTC_CTRL_SSEC_ALARM
Definition: rtc_regs.h:188
int MXC_RTC_DisableInt(uint32_t mask)
Disable Interurpts.
Definition: rtc.h:69
int MXC_RTC_GetSecond(void)
Get Second.
Definition: rtc.h:87
int MXC_RTC_GetFlags(void)
Gets interrupt flags.
mxc_rtc_int_fl_t
Bitmasks for each of the RTC&#39;s interrupt flags.
Definition: rtc.h:85
int MXC_RTC_Stop(void)
Stop the Real Time Clock.
int MXC_RTC_Trim(int8_t trm)
Set Trim register value.
mxc_rtc_int_en_t
Bitmasks for each of the RTC&#39;s interrupt enables.
Definition: rtc.h:76
Definition: rtc.h:78
Definition: rtc.h:86
int MXC_RTC_SquareWaveStart(mxc_rtc_freq_sel_t fq)
Allow generation of Square Wave on the SQW pin.
#define MXC_S_RTC_CTRL_SQW_SEL_FREQ4KHZ
Definition: rtc_regs.h:200
Definition: rtc.h:88
#define MXC_F_RTC_CTRL_SSEC_ALARM_IE
Definition: rtc_regs.h:173