MSPM0G1X0X_G3X0X Driver Library  1.10.01.05
dl_rtc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*!****************************************************************************
33  * @file dl_rtc.h
34  * @brief Real Time Clock (RTC) Peripheral Interface
35  * @defgroup RTC Real Time Clock (RTC)
36  *
37  * @anchor ti_devices_msp_dl_rtc_Overview
38  * # Overview
39  * The RTC Driver Library allows full configuration of the MSPM0 RTC module.
40  * The real-time clock (RTC) module provides clock counters with calendar mode,
41  * a flexible programmable alarm, offset calibration, and a provision for
42  * temperature compensation.
43  *
44  * <hr>
45  ******************************************************************************
46  */
50 #ifndef ti_dl_dl_rtc__include
51 #define ti_dl_dl_rtc__include
52 
53 #include <stdbool.h>
54 #include <stdint.h>
55 
56 #include <ti/devices/msp/msp.h>
57 #include <ti/driverlib/dl_common.h>
58 
59 #ifdef __MSPM0_HAS_RTC__
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
65 /* clang-format off */
66 
74 #define DL_RTC_INTERRUPT_CALENDAR_ALARM1 (RTC_CPU_INT_IMASK_RTCA1_SET)
75 
79 #define DL_RTC_INTERRUPT_CALENDAR_ALARM2 (RTC_CPU_INT_IMASK_RTCA2_SET)
80 
84 #define DL_RTC_INTERRUPT_PRESCALER0 (RTC_CPU_INT_IMASK_RT0PS_SET)
85 
89 #define DL_RTC_INTERRUPT_PRESCALER1 (RTC_CPU_INT_IMASK_RT1PS_SET)
90 
94 #define DL_RTC_INTERRUPT_INTERVAL_ALARM (RTC_CPU_INT_IMASK_RTCTEV_SET)
95 
99 #define DL_RTC_INTERRUPT_READY (RTC_CPU_INT_IMASK_RTCRDY_SET)
100 
110 #define DL_RTC_EVENT_CALENDAR_ALARM1 (RTC_GEN_EVENT_IMASK_RTCA1_SET)
111 
115 #define DL_RTC_EVENT_CALENDAR_ALARM2 (RTC_GEN_EVENT_IMASK_RTCA2_SET)
116 
120 #define DL_RTC_EVENT_PRESCALER0 (RTC_GEN_EVENT_IMASK_RT0PS_SET)
121 
125 #define DL_RTC_EVENT_PRESCALER1 (RTC_GEN_EVENT_IMASK_RT1PS_SET)
126 
130 #define DL_RTC_EVENT_INTERVAL_ALARM (RTC_GEN_EVENT_IMASK_RTCTEV_SET)
131 
135 #define DL_RTC_EVENT_READY (RTC_GEN_EVENT_IMASK_RTCRDY_SET)
136 
137 
141 typedef enum {
143  DL_RTC_STATUS_READY = RTC_STA_RTCRDY_READY,
145  DL_RTC_STATUS_NOT_READY = RTC_STA_RTCRDY_NOT_READY
146 } DL_RTC_STATUS;
147 
149 typedef enum {
151  DL_RTC_COMPENSATION_STATUS_READY = RTC_STA_RTCTCRDY_READY,
153  DL_RTC_COMPENSATION_STATUS_NOT_READY = RTC_STA_RTCTCRDY_NOT_READY
155 
157 typedef enum {
163 
165 typedef enum {
167  DL_RTC_OFFSET_CALIBRATION_SIGN_DOWN = RTC_CAL_RTCOCALS_DOWN,
169  DL_RTC_OFFSET_CALIBRATION_SIGN_UP = RTC_CAL_RTCOCALS_UP
171 
173 typedef enum {
177  DL_RTC_OFFSET_CALIBRATION_FREQUENCY_512 = RTC_CAL_RTCCALFX_F512HZ,
179  DL_RTC_OFFSET_CALIBRATION_FREQUENCY_256 = RTC_CAL_RTCCALFX_F256HZ,
183 
185 typedef enum {
187  DL_RTC_TEMP_CALIBRATION_DOWN1PPM = RTC_TCMP_RTCTCMPS_DOWN,
189  DL_RTC_TEMP_CALIBRATION_UP1PPM = RTC_TCMP_RTCTCMPS_UP
191 
193 typedef enum {
195  DL_RTC_FORMAT_BINARY = RTC_CTL_RTCBCD_BINARY,
197  DL_RTC_FORMAT_BCD = RTC_CTL_RTCBCD_BCD
198 } DL_RTC_FORMAT;
199 
201 typedef enum {
203  DL_RTC_INTERVAL_ALARM_MINUTECHANGE = RTC_CTL_RTCTEVTX_MINUTE,
205  DL_RTC_INTERVAL_ALARM_HOURCHANGE = RTC_CTL_RTCTEVTX_HOUR,
207  DL_RTC_INTERVAL_ALARM_NOON = RTC_CTL_RTCTEVTX_NOON,
209  DL_RTC_INTERVAL_ALARM_MIDNIGHT = RTC_CTL_RTCTEVTX_MIDNIGHT
211 
213 typedef enum {
215  DL_RTC_PRESCALER0_DIVIDE_8 = RTC_PSCTL_RT0IP_DIV8,
217  DL_RTC_PRESCALER0_DIVIDE_16 = RTC_PSCTL_RT0IP_DIV16,
219  DL_RTC_PRESCALER0_DIVIDE_32 = RTC_PSCTL_RT0IP_DIV32,
221  DL_RTC_PRESCALER0_DIVIDE_64 = RTC_PSCTL_RT0IP_DIV64,
223  DL_RTC_PRESCALER0_DIVIDE_128 = RTC_PSCTL_RT0IP_DIV128,
225  DL_RTC_PRESCALER0_DIVIDE_256 = RTC_PSCTL_RT0IP_DIV256
227 
229 typedef enum {
231  DL_RTC_PRESCALER1_DIVIDE_2 = RTC_PSCTL_RT1IP_DIV2,
233  DL_RTC_PRESCALER1_DIVIDE_4 = RTC_PSCTL_RT1IP_DIV4,
235  DL_RTC_PRESCALER1_DIVIDE_8 = RTC_PSCTL_RT1IP_DIV8,
237  DL_RTC_PRESCALER1_DIVIDE_16 = RTC_PSCTL_RT1IP_DIV16,
239  DL_RTC_PRESCALER1_DIVIDE_32 = RTC_PSCTL_RT1IP_DIV32,
241  DL_RTC_PRESCALER1_DIVIDE_64 = RTC_PSCTL_RT1IP_DIV64,
243  DL_RTC_PRESCALER1_DIVIDE_128 = RTC_PSCTL_RT1IP_DIV128,
245  DL_RTC_PRESCALER1_DIVIDE_256 = RTC_PSCTL_RT1IP_DIV256
247 
249 typedef enum {
251  DL_RTC_IIDX_ALARM1 = RTC_CPU_INT_IIDX_STAT_RTCA1,
253  DL_RTC_IIDX_ALARM2 = RTC_CPU_INT_IIDX_STAT_RTCA2,
255  DL_RTC_IIDX_PRESCALER0 = RTC_CPU_INT_IIDX_STAT_RT0PS,
257  DL_RTC_IIDX_PRESCALER1 = RTC_CPU_INT_IIDX_STAT_RT1PS,
259  DL_RTC_IIDX_INTERVAL_TIMER = RTC_CPU_INT_IIDX_STAT_RTCTEV,
261  DL_RTC_IIDX_READY = RTC_CPU_INT_IIDX_STAT_RTCRDY
262 } DL_RTC_IIDX;
263 
264 /* clang-format on */
265 
272 typedef struct {
275  uint8_t minutes;
278  uint8_t hours;
281  uint8_t dayOfWeek;
284  uint8_t dayOfMonth;
286 
293 typedef struct {
296  uint8_t seconds;
299  uint8_t minutes;
302  uint8_t hours;
305  uint8_t dayOfWeek;
308  uint8_t dayOfMonth;
311  uint8_t month;
314  uint16_t year;
316 
323 __STATIC_INLINE void DL_RTC_enablePower(RTC_Regs *rtc)
324 {
325  rtc->GPRCM.PWREN = (RTC_PWREN_KEY_UNLOCK_W | RTC_PWREN_ENABLE_ENABLE);
326 }
327 
334 __STATIC_INLINE void DL_RTC_disablePower(RTC_Regs *rtc)
335 {
336  rtc->GPRCM.PWREN = (RTC_PWREN_KEY_UNLOCK_W | RTC_PWREN_ENABLE_DISABLE);
337 }
338 
347 __STATIC_INLINE bool DL_RTC_isPowerEnabled(RTC_Regs *rtc)
348 {
349  return (
350  (rtc->GPRCM.PWREN & RTC_PWREN_ENABLE_MASK) == RTC_PWREN_ENABLE_ENABLE);
351 }
352 
359 __STATIC_INLINE void DL_RTC_reset(RTC_Regs *rtc)
360 {
361  rtc->GPRCM.RSTCTL =
362  (RTC_RSTCTL_KEY_UNLOCK_W | RTC_RSTCTL_RESETSTKYCLR_CLR |
363  RTC_RSTCTL_RESETASSERT_ASSERT);
364 }
365 
375 __STATIC_INLINE bool DL_RTC_isReset(RTC_Regs *rtc)
376 {
377  return ((rtc->GPRCM.STAT & RTC_STAT_RESETSTKY_MASK) ==
378  RTC_STAT_RESETSTKY_RESET);
379 }
380 
389 __STATIC_INLINE void DL_RTC_enableClockControl(RTC_Regs *rtc)
390 {
391  rtc->CLKCTL = RTC_CLKCTL_MODCLKEN_ENABLE;
392 }
393 
400 __STATIC_INLINE void DL_RTC_disableClockControl(RTC_Regs *rtc)
401 {
402  rtc->CLKCTL = RTC_CLKCTL_MODCLKEN_DISABLE;
403 }
404 
412 __STATIC_INLINE void DL_RTC_enableDebugInterrupts(RTC_Regs *rtc)
413 {
414  rtc->DBGCTL |= RTC_DBGCTL_DBGINT_ON;
415 }
416 
425 __STATIC_INLINE void DL_RTC_disableDebugInterrupts(RTC_Regs *rtc)
426 {
427  rtc->DBGCTL &= ~(RTC_DBGCTL_DBGINT_MASK);
428 }
429 
436 __STATIC_INLINE void DL_RTC_enableDebugMode(RTC_Regs *rtc)
437 {
438  rtc->DBGCTL |= RTC_DBGCTL_DBGRUN_RUN;
439 }
440 
447 __STATIC_INLINE void DL_RTC_disableDebugMode(RTC_Regs *rtc)
448 {
449  rtc->DBGCTL &= ~(RTC_DBGCTL_DBGRUN_MASK);
450 }
451 
461 __STATIC_INLINE void DL_RTC_setClockFormat(
462  RTC_Regs *rtc, DL_RTC_FORMAT formatSelect)
463 {
464  rtc->CTL |= (uint32_t) formatSelect;
465 }
466 
477 __STATIC_INLINE DL_RTC_FORMAT DL_RTC_getClockFormat(RTC_Regs *rtc)
478 {
479  uint32_t format = (rtc->CTL & RTC_CTL_RTCBCD_MASK);
480 
481  return (DL_RTC_FORMAT)(format);
482 }
483 
500 __STATIC_INLINE void DL_RTC_setIntervalAlarm(
501  RTC_Regs *rtc, DL_RTC_INTERVAL_ALARM alarmEvent)
502 {
504  &rtc->CTL, (uint32_t) alarmEvent, RTC_CTL_RTCTEVTX_MASK);
505 }
506 
521 __STATIC_INLINE DL_RTC_INTERVAL_ALARM DL_RTC_getIntervalAlarm(RTC_Regs *rtc)
522 {
523  uint32_t alarm = (rtc->CTL & RTC_CTL_RTCTEVTX_MASK);
524 
525  return (DL_RTC_INTERVAL_ALARM)(alarm);
526 }
527 
545 __STATIC_INLINE bool DL_RTC_isSafetoRead(RTC_Regs *rtc)
546 {
547  return ((rtc->STA & RTC_STA_RTCRDY_MASK) == RTC_STA_RTCRDY_READY);
548 }
549 
559 __STATIC_INLINE bool DL_RTC_isReadyToCalibrate(RTC_Regs *rtc)
560 {
561  return ((rtc->STA & RTC_STA_RTCTCRDY_MASK) == RTC_STA_RTCTCRDY_READY);
562 }
563 
573 __STATIC_INLINE bool DL_RTC_isCalibrationWriteResultOK(RTC_Regs *rtc)
574 {
575  return ((rtc->STA & RTC_STA_RTCTCOK_MASK) == RTC_STA_RTCTCOK_OK);
576 }
577 
591  RTC_Regs *rtc, DL_RTC_OFFSET_CALIBRATION_FREQUENCY offsetFrequency)
592 {
594  &rtc->CAL, (uint32_t) offsetFrequency, RTC_CAL_RTCCALFX_MASK);
595 }
596 
612 __STATIC_INLINE void DL_RTC_setOffsetCalibrationAdjValue(RTC_Regs *rtc,
613  DL_RTC_OFFSET_CALIBRATION_SIGN offsetSign, uint8_t offsetValue)
614 {
615  DL_Common_updateReg(&rtc->CAL,
616  ((uint32_t) offsetSign | (uint32_t) offsetValue),
617  (RTC_CAL_RTCOCALX_MASK | RTC_CAL_RTCOCALS_MASK));
618 }
619 
642 __STATIC_INLINE void DL_RTC_setOffsetCalibration(RTC_Regs *rtc,
643  DL_RTC_OFFSET_CALIBRATION_FREQUENCY offsetFrequency,
644  DL_RTC_OFFSET_CALIBRATION_SIGN offsetSign, uint8_t offsetValue)
645 {
646  rtc->CAL = (offsetValue & RTC_CAL_RTCOCALX_MASK) |
647  (uint32_t) offsetFrequency | (uint32_t) offsetSign;
648 }
649 
659 __STATIC_INLINE DL_RTC_OFFSET_CALIBRATION_FREQUENCY
661 {
662  uint32_t freq = (rtc->CAL & RTC_CAL_RTCCALFX_MASK);
663 
664  return (DL_RTC_OFFSET_CALIBRATION_FREQUENCY)(freq);
665 }
666 
676 __STATIC_INLINE DL_RTC_OFFSET_CALIBRATION_SIGN DL_RTC_getOffsetCalibrationSign(
677  RTC_Regs *rtc)
678 {
679  uint32_t sign = (rtc->CAL & RTC_CAL_RTCOCALS_MASK);
680 
681  return (DL_RTC_OFFSET_CALIBRATION_SIGN)(sign);
682 }
683 
693 __STATIC_INLINE uint32_t DL_RTC_getOffsetCalibrationValue(RTC_Regs *rtc)
694 {
695  return (rtc->CAL & RTC_CAL_RTCOCALX_MASK);
696 }
697 
714 __STATIC_INLINE void DL_RTC_setTemperatureCompensation(RTC_Regs *rtc,
715  DL_RTC_TEMP_CALIBRATION offsetDirection, uint32_t offsetValue)
716 {
717  rtc->TCMP =
718  (offsetValue & RTC_TCMP_RTCTCMPX_MASK) | (uint32_t) offsetDirection;
719 }
720 
732 __STATIC_INLINE uint32_t DL_RTC_getTemperatureCompensation(RTC_Regs *rtc)
733 {
734  return (rtc->TCMP);
735 }
736 
744 __STATIC_INLINE void DL_RTC_setCalendarSecondsBCD(
745  RTC_Regs *rtc, uint8_t seconds)
746 {
747  rtc->SEC = ((uint32_t) seconds << RTC_SEC_SECLOWBCD_OFS) &
748  (RTC_SEC_SECLOWBCD_MASK | RTC_SEC_SECHIGHBCD_MASK);
749 }
750 
765 __STATIC_INLINE uint8_t DL_RTC_getCalendarSecondsBCD(RTC_Regs *rtc)
766 {
767  return (uint8_t)(
768  (rtc->SEC & (RTC_SEC_SECLOWBCD_MASK | RTC_SEC_SECHIGHBCD_MASK)) >>
769  RTC_SEC_SECLOWBCD_OFS);
770 }
771 
779 __STATIC_INLINE void DL_RTC_setCalendarMinutesBCD(
780  RTC_Regs *rtc, uint8_t minutes)
781 {
782  rtc->MIN = ((uint32_t) minutes << RTC_MIN_MINLOWBCD_OFS) &
783  (RTC_MIN_MINLOWBCD_MASK | RTC_MIN_MINHIGHBCD_MASK);
784 }
785 
800 __STATIC_INLINE uint8_t DL_RTC_getCalendarMinutesBCD(RTC_Regs *rtc)
801 {
802  return (uint8_t)(
803  (rtc->MIN & (RTC_MIN_MINLOWBCD_MASK | RTC_MIN_MINHIGHBCD_MASK)) >>
804  RTC_MIN_MINLOWBCD_OFS);
805 }
806 
814 __STATIC_INLINE void DL_RTC_setCalendarHoursBCD(RTC_Regs *rtc, uint8_t hours)
815 {
816  rtc->HOUR = ((uint32_t) hours << RTC_HOUR_HOURLOWBCD_OFS) &
817  (RTC_HOUR_HOURLOWBCD_MASK | RTC_HOUR_HOURHIGHBCD_MASK);
818 }
819 
834 __STATIC_INLINE uint8_t DL_RTC_getCalendarHoursBCD(RTC_Regs *rtc)
835 {
836  return (uint8_t)(
837  (rtc->HOUR & (RTC_HOUR_HOURLOWBCD_MASK | RTC_HOUR_HOURHIGHBCD_MASK)) >>
838  RTC_HOUR_HOURLOWBCD_OFS);
839 }
840 
848 __STATIC_INLINE void DL_RTC_setCalendarDayOfWeekBCD(RTC_Regs *rtc, uint8_t day)
849 {
850  DL_Common_updateReg(&rtc->DAY, day, RTC_DAY_DOW_MASK);
851 }
852 
867 __STATIC_INLINE uint8_t DL_RTC_getCalendarDayOfWeekBCD(RTC_Regs *rtc)
868 {
869  return (uint8_t)(rtc->DAY & RTC_DAY_DOW_MASK);
870 }
871 
879 __STATIC_INLINE void DL_RTC_setCalendarDayOfMonthBCD(
880  RTC_Regs *rtc, uint8_t day)
881 {
882  DL_Common_updateReg(&rtc->DAY, (uint32_t) day << RTC_DAY_DOMLOWBCD_OFS,
883  (RTC_DAY_DOMLOWBCD_MASK | RTC_DAY_DOMHIGHBCD_MASK));
884 }
885 
900 __STATIC_INLINE uint8_t DL_RTC_getCalendarDayOfMonthBCD(RTC_Regs *rtc)
901 {
902  return (uint8_t)(
903  (rtc->DAY & (RTC_DAY_DOMLOWBCD_MASK | RTC_DAY_DOMHIGHBCD_MASK)) >>
904  RTC_DAY_DOMLOWBCD_OFS);
905 }
906 
914 __STATIC_INLINE void DL_RTC_setCalendarMonthBCD(RTC_Regs *rtc, uint8_t month)
915 {
916  rtc->MON = ((uint32_t) month << RTC_MON_MONLOWBCD_OFS) &
917  (RTC_MON_MONLOWBCD_MASK | RTC_MON_MONHIGHBCD_MASK);
918 }
919 
934 __STATIC_INLINE uint8_t DL_RTC_getCalendarMonthBCD(RTC_Regs *rtc)
935 {
936  return (uint8_t)(
937  (rtc->MON & (RTC_MON_MONLOWBCD_MASK | RTC_MON_MONHIGHBCD_MASK)) >>
938  RTC_MON_MONLOWBCD_OFS);
939 }
940 
948 __STATIC_INLINE void DL_RTC_setCalendarYearBCD(RTC_Regs *rtc, uint16_t year)
949 {
950  rtc->YEAR = ((uint32_t) year << RTC_YEAR_YEARLOWESTBCD_OFS) &
951  (RTC_YEAR_YEARLOWESTBCD_MASK | RTC_YEAR_DECADEBCD_MASK |
952  RTC_YEAR_CENTLOWBCD_MASK | RTC_YEAR_CENTHIGHBCD_MASK);
953 }
954 
969 __STATIC_INLINE uint16_t DL_RTC_getCalendarYearBCD(RTC_Regs *rtc)
970 {
971  return (uint16_t)(
972  (rtc->YEAR &
973  (RTC_YEAR_YEARLOWESTBCD_MASK | RTC_YEAR_DECADEBCD_MASK |
974  RTC_YEAR_CENTLOWBCD_MASK | RTC_YEAR_CENTHIGHBCD_MASK)) >>
975  RTC_YEAR_YEARLOWESTBCD_OFS);
976 }
977 
984 __STATIC_INLINE void DL_RTC_enableAlarm1MinutesBCD(RTC_Regs *rtc)
985 {
986  rtc->A1MIN |= RTC_A1MIN_AMINAEBCD_ENABLE;
987 }
988 
995 __STATIC_INLINE void DL_RTC_disableAlarm1MinutesBCD(RTC_Regs *rtc)
996 {
997  rtc->A1MIN &= ~(RTC_A1MIN_AMINAEBCD_MASK);
998 }
999 
1008 __STATIC_INLINE void DL_RTC_setAlarm1MinutesBCD(RTC_Regs *rtc, uint8_t minutes)
1009 {
1010  rtc->A1MIN = ((uint32_t) minutes << RTC_A1MIN_AMINLOWBCD_OFS) &
1011  (RTC_A1MIN_AMINLOWBCD_MASK | RTC_A1MIN_AMINHIGHBCD_MASK);
1012 }
1013 
1024 __STATIC_INLINE uint8_t DL_RTC_getAlarm1MinutesBCD(RTC_Regs *rtc)
1025 {
1026  return (uint8_t)((rtc->A1MIN & (RTC_A1MIN_AMINLOWBCD_MASK |
1027  RTC_A1MIN_AMINHIGHBCD_MASK)) >>
1028  RTC_A1MIN_AMINLOWBCD_OFS);
1029 }
1030 
1037 __STATIC_INLINE void DL_RTC_enableAlarm1HoursBCD(RTC_Regs *rtc)
1038 {
1039  rtc->A1HOUR |= RTC_A1HOUR_AHOURAEBIN_ENABLE;
1040 }
1041 
1048 __STATIC_INLINE void DL_RTC_disableAlarm1HoursBCD(RTC_Regs *rtc)
1049 {
1050  rtc->A1HOUR &= ~(RTC_A1HOUR_AHOURAEBIN_MASK);
1051 }
1052 
1060 __STATIC_INLINE void DL_RTC_setAlarm1HoursBCD(RTC_Regs *rtc, uint8_t hours)
1061 {
1062  rtc->A1HOUR = ((uint32_t) hours << RTC_A1HOUR_AHOURLOWBCD_OFS) &
1063  (RTC_A1HOUR_AHOURLOWBCD_MASK | RTC_A1HOUR_AHOURHIGHBCD_MASK);
1064 }
1065 
1076 __STATIC_INLINE uint8_t DL_RTC_getAlarm1HoursBCD(RTC_Regs *rtc)
1077 {
1078  return (uint8_t)((rtc->A1HOUR & (RTC_A1HOUR_AHOURLOWBCD_MASK |
1079  RTC_A1HOUR_AHOURHIGHBCD_MASK)) >>
1080  RTC_A1HOUR_AHOURLOWBCD_OFS);
1081 }
1082 
1089 __STATIC_INLINE void DL_RTC_enableAlarm1DayOfWeekBCD(RTC_Regs *rtc)
1090 {
1091  rtc->A1DAY |= RTC_A1DAY_ADOWAE_ENABLE;
1092 }
1093 
1100 __STATIC_INLINE void DL_RTC_disableAlarm1DayOfWeekBCD(RTC_Regs *rtc)
1101 {
1102  rtc->A1DAY &= ~(RTC_A1DAY_ADOWAE_MASK);
1103 }
1104 
1112 __STATIC_INLINE void DL_RTC_setAlarm1DayOfWeekBCD(RTC_Regs *rtc, uint8_t day)
1113 {
1114  DL_Common_updateReg(&rtc->A1DAY, day, RTC_A1DAY_ADOW_MASK);
1115 }
1116 
1127 __STATIC_INLINE uint8_t DL_RTC_getAlarm1DayOfWeekBCD(RTC_Regs *rtc)
1128 {
1129  return (uint8_t)(rtc->DAY & RTC_A1DAY_ADOW_MASK);
1130 }
1131 
1138 __STATIC_INLINE void DL_RTC_enableAlarm1DayOfMonthBCD(RTC_Regs *rtc)
1139 {
1140  rtc->A1DAY |= RTC_A1DAY_ADOMAEBCD_ENABLE;
1141 }
1142 
1149 __STATIC_INLINE void DL_RTC_disableAlarm1DayOfMonthBCD(RTC_Regs *rtc)
1150 {
1151  rtc->A1DAY &= ~(RTC_A1DAY_ADOMAEBCD_MASK);
1152 }
1153 
1161 __STATIC_INLINE void DL_RTC_setAlarm1DayOfMonthBCD(RTC_Regs *rtc, uint8_t day)
1162 {
1163  DL_Common_updateReg(&rtc->A1DAY,
1164  (uint32_t) day << RTC_A1DAY_ADOMLOWBCD_OFS,
1165  (RTC_A1DAY_ADOMLOWBCD_MASK | RTC_A1DAY_ADOMHIGHBCD_MASK));
1166 }
1167 
1178 __STATIC_INLINE uint8_t DL_RTC_getAlarm1DayOfMonthBCD(RTC_Regs *rtc)
1179 {
1180  return (uint8_t)((rtc->A1DAY & (RTC_A1DAY_ADOMLOWBCD_MASK |
1181  RTC_A1DAY_ADOMHIGHBCD_MASK)) >>
1182  RTC_A1DAY_ADOMLOWBCD_OFS);
1183 }
1184 
1191 __STATIC_INLINE void DL_RTC_enableAlarm2MinutesBCD(RTC_Regs *rtc)
1192 {
1193  rtc->A2MIN |= RTC_A2MIN_AMINAEBCD_ENABLE;
1194 }
1195 
1202 __STATIC_INLINE void DL_RTC_disableAlarm2MinutesBCD(RTC_Regs *rtc)
1203 {
1204  rtc->A2MIN &= ~(RTC_A2MIN_AMINAEBCD_MASK);
1205 }
1206 
1215 __STATIC_INLINE void DL_RTC_setAlarm2MinutesBCD(RTC_Regs *rtc, uint8_t minutes)
1216 {
1217  rtc->A2MIN = ((uint32_t) minutes << RTC_A2MIN_AMINLOWBCD_OFS) &
1218  (RTC_A2MIN_AMINLOWBCD_MASK | RTC_A2MIN_AMINHIGHBCD_MASK);
1219 }
1220 
1231 __STATIC_INLINE uint8_t DL_RTC_getAlarm2MinutesBCD(RTC_Regs *rtc)
1232 {
1233  return (uint8_t)((rtc->A2MIN & (RTC_A2MIN_AMINLOWBCD_MASK |
1234  RTC_A2MIN_AMINHIGHBCD_MASK)) >>
1235  RTC_A2MIN_AMINLOWBCD_OFS);
1236 }
1237 
1244 __STATIC_INLINE void DL_RTC_enableAlarm2HoursBCD(RTC_Regs *rtc)
1245 {
1246  rtc->A2HOUR |= RTC_A2HOUR_AHOURAEBIN_ENABLE;
1247 }
1248 
1255 __STATIC_INLINE void DL_RTC_disableAlarm2HoursBCD(RTC_Regs *rtc)
1256 {
1257  rtc->A2HOUR &= ~(RTC_A2HOUR_AHOURAEBIN_MASK);
1258 }
1259 
1267 __STATIC_INLINE void DL_RTC_setAlarm2HoursBCD(RTC_Regs *rtc, uint8_t hours)
1268 {
1269  rtc->A2HOUR = ((uint32_t) hours << RTC_A2HOUR_AHOURLOWBCD_OFS) &
1270  (RTC_A2HOUR_AHOURLOWBCD_MASK | RTC_A2HOUR_AHOURHIGHBCD_MASK);
1271 }
1272 
1283 __STATIC_INLINE uint8_t DL_RTC_getAlarm2HoursBCD(RTC_Regs *rtc)
1284 {
1285  return (uint8_t)((rtc->A2HOUR & (RTC_A2HOUR_AHOURLOWBCD_MASK |
1286  RTC_A2HOUR_AHOURHIGHBCD_MASK)) >>
1287  RTC_A2HOUR_AHOURLOWBCD_OFS);
1288 }
1289 
1296 __STATIC_INLINE void DL_RTC_enableAlarm2DayOfWeekBCD(RTC_Regs *rtc)
1297 {
1298  rtc->A2DAY |= RTC_A2DAY_ADOWAE_ENABLE;
1299 }
1300 
1307 __STATIC_INLINE void DL_RTC_disableAlarm2DayOfWeekBCD(RTC_Regs *rtc)
1308 {
1309  rtc->A2DAY &= ~(RTC_A2DAY_ADOWAE_MASK);
1310 }
1311 
1319 __STATIC_INLINE void DL_RTC_setAlarm2DayOfWeekBCD(RTC_Regs *rtc, uint8_t day)
1320 {
1321  DL_Common_updateReg(&rtc->A2DAY, day, RTC_A2DAY_ADOW_MASK);
1322 }
1323 
1334 __STATIC_INLINE uint8_t DL_RTC_getAlarm2DayOfWeekBCD(RTC_Regs *rtc)
1335 {
1336  return (uint8_t)(rtc->DAY & RTC_A2DAY_ADOW_MASK);
1337 }
1338 
1345 __STATIC_INLINE void DL_RTC_enableAlarm2DayOfMonthBCD(RTC_Regs *rtc)
1346 {
1347  rtc->A2DAY |= RTC_A2DAY_ADOMAEBCD_ENABLE;
1348 }
1349 
1356 __STATIC_INLINE void DL_RTC_disableAlarm2DayOfMonthBCD(RTC_Regs *rtc)
1357 {
1358  rtc->A2DAY &= ~(RTC_A2DAY_ADOMAEBCD_MASK);
1359 }
1360 
1368 __STATIC_INLINE void DL_RTC_setAlarm2DayOfMonthBCD(RTC_Regs *rtc, uint8_t day)
1369 {
1370  DL_Common_updateReg(&rtc->A2DAY,
1371  (uint32_t) day << RTC_A2DAY_ADOMLOWBCD_OFS,
1372  (RTC_A2DAY_ADOMLOWBCD_MASK | RTC_A2DAY_ADOMHIGHBCD_MASK));
1373 }
1374 
1385 __STATIC_INLINE uint8_t DL_RTC_getAlarm2DayOfMonthBCD(RTC_Regs *rtc)
1386 {
1387  return (uint8_t)((rtc->A2DAY & (RTC_A2DAY_ADOMLOWBCD_MASK |
1388  RTC_A2DAY_ADOMHIGHBCD_MASK)) >>
1389  RTC_A2DAY_ADOMLOWBCD_OFS);
1390 }
1391 
1399 __STATIC_INLINE void DL_RTC_setCalendarSecondsBinary(
1400  RTC_Regs *rtc, uint8_t seconds)
1401 {
1402  rtc->SEC = (seconds & RTC_SEC_SECBIN_MASK);
1403 }
1404 
1419 __STATIC_INLINE uint8_t DL_RTC_getCalendarSecondsBinary(RTC_Regs *rtc)
1420 {
1421  return (uint8_t)(rtc->SEC & RTC_SEC_SECBIN_MASK);
1422 }
1423 
1431 __STATIC_INLINE void DL_RTC_setCalendarMinutesBinary(
1432  RTC_Regs *rtc, uint8_t minutes)
1433 {
1434  rtc->MIN = (minutes & RTC_MIN_MINBIN_MASK);
1435 }
1436 
1451 __STATIC_INLINE uint8_t DL_RTC_getCalendarMinutesBinary(RTC_Regs *rtc)
1452 {
1453  return (uint8_t)(rtc->MIN & RTC_MIN_MINBIN_MASK);
1454 }
1455 
1463 __STATIC_INLINE void DL_RTC_setCalendarHoursBinary(
1464  RTC_Regs *rtc, uint8_t hours)
1465 {
1466  rtc->HOUR = (hours & RTC_HOUR_HOURBIN_MASK);
1467 }
1468 
1483 __STATIC_INLINE uint8_t DL_RTC_getCalendarHoursBinary(RTC_Regs *rtc)
1484 {
1485  return (uint8_t)(rtc->HOUR & RTC_HOUR_HOURBIN_MASK);
1486 }
1487 
1496  RTC_Regs *rtc, uint8_t day)
1497 {
1498  DL_Common_updateReg(&rtc->DAY, day, RTC_DAY_DOW_MASK);
1499 }
1500 
1515 __STATIC_INLINE uint8_t DL_RTC_getCalendarDayOfWeekBinary(RTC_Regs *rtc)
1516 {
1517  return (uint8_t)(rtc->DAY & RTC_DAY_DOW_MASK);
1518 }
1519 
1528  RTC_Regs *rtc, uint8_t day)
1529 {
1531  &rtc->DAY, (uint32_t) day << RTC_DAY_DOMBIN_OFS, RTC_DAY_DOMBIN_MASK);
1532 }
1533 
1548 __STATIC_INLINE uint8_t DL_RTC_getCalendarDayOfMonthBinary(RTC_Regs *rtc)
1549 {
1550  return (uint8_t)((rtc->DAY & RTC_DAY_DOMBIN_MASK) >> RTC_DAY_DOMBIN_OFS);
1551 }
1552 
1560 __STATIC_INLINE void DL_RTC_setCalendarMonthBinary(
1561  RTC_Regs *rtc, uint8_t month)
1562 {
1563  rtc->MON = (month & RTC_MON_MONBIN_MASK);
1564 }
1565 
1580 __STATIC_INLINE uint8_t DL_RTC_getCalendarMonthBinary(RTC_Regs *rtc)
1581 {
1582  return (uint8_t)(rtc->MON & RTC_MON_MONBIN_MASK);
1583 }
1584 
1592 __STATIC_INLINE void DL_RTC_setCalendarYearBinary(RTC_Regs *rtc, uint16_t year)
1593 {
1594  rtc->YEAR = ((uint32_t) year &
1595  (RTC_YEAR_YEARLOWBIN_MASK | RTC_YEAR_YEARHIGHBIN_MASK));
1596 }
1597 
1612 __STATIC_INLINE uint16_t DL_RTC_getCalendarYearBinary(RTC_Regs *rtc)
1613 {
1614  return (uint16_t)(
1615  rtc->YEAR & (RTC_YEAR_YEARLOWBIN_MASK | RTC_YEAR_YEARHIGHBIN_MASK));
1616 }
1617 
1624 __STATIC_INLINE void DL_RTC_enableAlarm1MinutesBinary(RTC_Regs *rtc)
1625 {
1626  rtc->A1MIN |= RTC_A1MIN_AMINAEBIN_ENABLE;
1627 }
1628 
1635 __STATIC_INLINE void DL_RTC_disableAlarm1MinutesBinary(RTC_Regs *rtc)
1636 {
1637  rtc->A1MIN &= ~(RTC_A1MIN_AMINAEBIN_MASK);
1638 }
1639 
1648 __STATIC_INLINE void DL_RTC_setAlarm1MinutesBinary(
1649  RTC_Regs *rtc, uint8_t minutes)
1650 {
1651  rtc->A1MIN = (minutes & RTC_A1MIN_AMINBIN_MASK);
1652 }
1653 
1664 __STATIC_INLINE uint8_t DL_RTC_getAlarm1MinutesBinary(RTC_Regs *rtc)
1665 {
1666  return (uint8_t)(rtc->A1MIN & RTC_A1MIN_AMINBIN_MASK);
1667 }
1668 
1675 __STATIC_INLINE void DL_RTC_enableAlarm1HoursBinary(RTC_Regs *rtc)
1676 {
1677  rtc->A1HOUR |= RTC_A1HOUR_AHOURAEBIN_ENABLE;
1678 }
1679 
1686 __STATIC_INLINE void DL_RTC_disableAlarm1HoursBinary(RTC_Regs *rtc)
1687 {
1688  rtc->A1HOUR &= ~(RTC_A1HOUR_AHOURAEBIN_MASK);
1689 }
1690 
1698 __STATIC_INLINE void DL_RTC_setAlarm1HoursBinary(RTC_Regs *rtc, uint8_t hours)
1699 {
1700  rtc->A1HOUR = (hours & RTC_A1HOUR_AHOURBIN_MASK);
1701 }
1702 
1713 __STATIC_INLINE uint8_t DL_RTC_getAlarm1HoursBinary(RTC_Regs *rtc)
1714 {
1715  return (uint8_t)(rtc->A1HOUR & RTC_A1HOUR_AHOURBIN_MASK);
1716 }
1717 
1724 __STATIC_INLINE void DL_RTC_enableAlarm1DayOfWeekBinary(RTC_Regs *rtc)
1725 {
1726  rtc->A1DAY |= RTC_A1DAY_ADOWAE_ENABLE;
1727 }
1728 
1735 __STATIC_INLINE void DL_RTC_disableAlarm1DayOfWeekBinary(RTC_Regs *rtc)
1736 {
1737  rtc->A1DAY &= ~(RTC_A1DAY_ADOWAE_MASK);
1738 }
1739 
1747 __STATIC_INLINE void DL_RTC_setAlarm1DayOfWeekBinary(
1748  RTC_Regs *rtc, uint8_t day)
1749 {
1750  DL_Common_updateReg(&rtc->A1DAY, day, RTC_A1DAY_ADOW_MASK);
1751 }
1752 
1763 __STATIC_INLINE uint8_t DL_RTC_getAlarm1DayOfWeekBinary(RTC_Regs *rtc)
1764 {
1765  return (uint8_t)(rtc->A1DAY & RTC_A1DAY_ADOW_MASK);
1766 }
1767 
1774 __STATIC_INLINE void DL_RTC_enableAlarm1DayOfMonthBinary(RTC_Regs *rtc)
1775 {
1776  rtc->A1DAY |= RTC_A1DAY_ADOMAEBIN_ENABLE;
1777 }
1778 
1785 __STATIC_INLINE void DL_RTC_disableAlarm1DayOfMonthBinary(RTC_Regs *rtc)
1786 {
1787  rtc->A1DAY &= ~(RTC_A1DAY_ADOMAEBIN_MASK);
1788 }
1789 
1798  RTC_Regs *rtc, uint8_t day)
1799 {
1800  DL_Common_updateReg(&rtc->A1DAY, (uint32_t) day << RTC_A1DAY_ADOMBIN_OFS,
1801  RTC_A1DAY_ADOMBIN_MASK);
1802 }
1803 
1814 __STATIC_INLINE uint8_t DL_RTC_getAlarm1DayOfMonthBinary(RTC_Regs *rtc)
1815 {
1816  return (uint8_t)(
1817  (rtc->A1DAY & RTC_A1DAY_ADOMBIN_MASK) >> RTC_A1DAY_ADOMBIN_OFS);
1818 }
1819 
1826 __STATIC_INLINE void DL_RTC_enableAlarm2MinutesBinary(RTC_Regs *rtc)
1827 {
1828  rtc->A2MIN |= RTC_A2MIN_AMINAEBIN_ENABLE;
1829 }
1830 
1837 __STATIC_INLINE void DL_RTC_disableAlarm2MinutesBinary(RTC_Regs *rtc)
1838 {
1839  rtc->A2MIN &= ~(RTC_A2MIN_AMINAEBIN_MASK);
1840 }
1841 
1850 __STATIC_INLINE void DL_RTC_setAlarm2MinutesBinary(
1851  RTC_Regs *rtc, uint8_t minutes)
1852 {
1853  rtc->A2MIN = (minutes & RTC_A2MIN_AMINBIN_MASK);
1854 }
1855 
1866 __STATIC_INLINE uint8_t DL_RTC_getAlarm2MinutesBinary(RTC_Regs *rtc)
1867 {
1868  return (uint8_t)(rtc->A2MIN & RTC_A2MIN_AMINBIN_MASK);
1869 }
1870 
1877 __STATIC_INLINE void DL_RTC_enableAlarm2HoursBinary(RTC_Regs *rtc)
1878 {
1879  rtc->A2HOUR |= RTC_A2HOUR_AHOURAEBIN_ENABLE;
1880 }
1881 
1888 __STATIC_INLINE void DL_RTC_disableAlarm2HoursBinary(RTC_Regs *rtc)
1889 {
1890  rtc->A2HOUR &= ~(RTC_A2HOUR_AHOURAEBIN_MASK);
1891 }
1892 
1900 __STATIC_INLINE void DL_RTC_setAlarm2HoursBinary(RTC_Regs *rtc, uint8_t hours)
1901 {
1902  rtc->A2HOUR = (hours & RTC_A2HOUR_AHOURBIN_MASK);
1903 }
1904 
1915 __STATIC_INLINE uint8_t DL_RTC_getAlarm2HoursBinary(RTC_Regs *rtc)
1916 {
1917  return (uint8_t)(rtc->A2HOUR & RTC_A2HOUR_AHOURBIN_MASK);
1918 }
1919 
1926 __STATIC_INLINE void DL_RTC_enableAlarm2DayOfWeekBinary(RTC_Regs *rtc)
1927 {
1928  rtc->A2DAY |= RTC_A2DAY_ADOWAE_ENABLE;
1929 }
1930 
1937 __STATIC_INLINE void DL_RTC_disableAlarm2DayOfWeekBinary(RTC_Regs *rtc)
1938 {
1939  rtc->A2DAY &= ~(RTC_A2DAY_ADOWAE_MASK);
1940 }
1941 
1949 __STATIC_INLINE void DL_RTC_setAlarm2DayOfWeekBinary(
1950  RTC_Regs *rtc, uint8_t day)
1951 {
1952  DL_Common_updateReg(&rtc->A2DAY, day, RTC_A2DAY_ADOW_MASK);
1953 }
1954 
1965 __STATIC_INLINE uint8_t DL_RTC_getAlarm2DayOfWeekBinary(RTC_Regs *rtc)
1966 {
1967  return (uint8_t)(rtc->A2DAY & RTC_A2DAY_ADOW_MASK);
1968 }
1969 
1976 __STATIC_INLINE void DL_RTC_enableAlarm2DayOfMonthBinary(RTC_Regs *rtc)
1977 {
1978  rtc->A2DAY |= RTC_A2DAY_ADOMAEBIN_ENABLE;
1979 }
1980 
1987 __STATIC_INLINE void DL_RTC_disableAlarm2DayOfMonthBinary(RTC_Regs *rtc)
1988 {
1989  rtc->A2DAY &= ~(RTC_A2DAY_ADOMAEBIN_MASK);
1990 }
1991 
2000  RTC_Regs *rtc, uint8_t day)
2001 {
2002  DL_Common_updateReg(&rtc->A2DAY, (uint32_t) day << RTC_A2DAY_ADOMBIN_OFS,
2003  RTC_A2DAY_ADOMBIN_MASK);
2004 }
2005 
2016 __STATIC_INLINE uint8_t DL_RTC_getAlarm2DayOfMonthBinary(RTC_Regs *rtc)
2017 {
2018  return (uint8_t)(
2019  (rtc->A2DAY & RTC_A2DAY_ADOMBIN_MASK) >> RTC_A2DAY_ADOMBIN_OFS);
2020 }
2021 
2038 __STATIC_INLINE void DL_RTC_setPrescalerEvents(RTC_Regs *rtc,
2039  DL_RTC_PRESCALER0_DIVIDE prescaler0Divider,
2040  DL_RTC_PRESCALER1_DIVIDE prescaler1Divider)
2041 {
2042  rtc->PSCTL = (((uint32_t) prescaler0Divider & RTC_PSCTL_RT0IP_MASK) |
2043  ((uint32_t) prescaler1Divider & RTC_PSCTL_RT1IP_MASK));
2044 }
2045 
2055 __STATIC_INLINE void DL_RTC_setPeriodicAlarm0(
2056  RTC_Regs *rtc, DL_RTC_PRESCALER0_DIVIDE prescaler0Divider)
2057 {
2059  &rtc->PSCTL, (uint32_t) prescaler0Divider, RTC_PSCTL_RT0IP_MASK);
2060 }
2061 
2071 __STATIC_INLINE void DL_RTC_setPeriodicAlarm1(
2072  RTC_Regs *rtc, DL_RTC_PRESCALER1_DIVIDE prescaler1Divider)
2073 {
2075  &rtc->PSCTL, (uint32_t) prescaler1Divider, RTC_PSCTL_RT1IP_MASK);
2076 }
2077 
2088 __STATIC_INLINE DL_RTC_PRESCALER0_DIVIDE DL_RTC_getPrescaler0(RTC_Regs *rtc)
2089 {
2090  uint32_t prescaler = (rtc->PSCTL & RTC_PSCTL_RT0IP_MASK);
2091 
2092  return (DL_RTC_PRESCALER0_DIVIDE)(prescaler);
2093 }
2094 
2104 __STATIC_INLINE DL_RTC_PRESCALER1_DIVIDE DL_RTC_getPrescaler1(RTC_Regs *rtc)
2105 {
2106  uint32_t prescaler = (rtc->PSCTL & RTC_PSCTL_RT1IP_MASK);
2107 
2108  return (DL_RTC_PRESCALER1_DIVIDE)(prescaler);
2109 }
2110 
2119 __STATIC_INLINE void DL_RTC_enableInterrupt(
2120  RTC_Regs *rtc, uint32_t interruptMask)
2121 {
2122  rtc->CPU_INT.IMASK |= interruptMask;
2123 }
2124 
2133 __STATIC_INLINE void DL_RTC_disableInterrupt(
2134  RTC_Regs *rtc, uint32_t interruptMask)
2135 {
2136  rtc->CPU_INT.IMASK &= ~(interruptMask);
2137 }
2138 
2151 __STATIC_INLINE uint32_t DL_RTC_getEnabledInterrupts(
2152  RTC_Regs *rtc, uint32_t interruptMask)
2153 {
2154  return (rtc->CPU_INT.IMASK & interruptMask);
2155 }
2156 
2174 __STATIC_INLINE uint32_t DL_RTC_getEnabledInterruptStatus(
2175  RTC_Regs *rtc, uint32_t interruptMask)
2176 {
2177  return (rtc->CPU_INT.MIS & interruptMask);
2178 }
2179 
2195 __STATIC_INLINE uint32_t DL_RTC_getRawInterruptStatus(
2196  RTC_Regs *rtc, uint32_t interruptMask)
2197 {
2198  return (rtc->CPU_INT.RIS & interruptMask);
2199 }
2200 
2213 __STATIC_INLINE DL_RTC_IIDX DL_RTC_getPendingInterrupt(RTC_Regs *rtc)
2214 {
2215  return (DL_RTC_IIDX)(rtc->CPU_INT.IIDX);
2216 }
2217 
2226 __STATIC_INLINE void DL_RTC_clearInterruptStatus(
2227  RTC_Regs *rtc, uint32_t interruptMask)
2228 {
2229  rtc->CPU_INT.ICLR = interruptMask;
2230 }
2231 
2239 __STATIC_INLINE void DL_RTC_enableEvent(RTC_Regs *rtc, uint32_t eventMask)
2240 {
2241  rtc->GEN_EVENT.IMASK |= (eventMask);
2242 }
2243 
2251 __STATIC_INLINE void DL_RTC_disableEvent(RTC_Regs *rtc, uint32_t eventMask)
2252 {
2253  rtc->GEN_EVENT.IMASK &= ~(eventMask);
2254 }
2255 
2267 __STATIC_INLINE uint32_t DL_RTC_getEnabledEvents(
2268  RTC_Regs *rtc, uint32_t eventMask)
2269 {
2270  return ((rtc->GEN_EVENT.IMASK) & (eventMask));
2271 }
2272 
2289 __STATIC_INLINE uint32_t DL_RTC_getEnabledEventStatus(
2290  RTC_Regs *rtc, uint32_t eventMask)
2291 {
2292  return ((rtc->GEN_EVENT.MIS) & eventMask);
2293 }
2294 
2309 __STATIC_INLINE uint32_t DL_RTC_getRawEventsStatus(
2310  RTC_Regs *rtc, uint32_t eventMask)
2311 {
2312  return ((rtc->GEN_EVENT.RIS) & eventMask);
2313 }
2314 
2322 __STATIC_INLINE void DL_RTC_clearEventsStatus(
2323  RTC_Regs *rtc, uint32_t eventMask)
2324 {
2325  rtc->GEN_EVENT.ICLR |= (eventMask);
2326 }
2327 
2336 __STATIC_INLINE void DL_RTC_setPublisherChanID(RTC_Regs *rtc, uint8_t chanID)
2337 {
2338  rtc->FPUB_0 = (chanID & RTC_FPUB_0_CHANID_MAXIMUM);
2339 }
2340 
2350 __STATIC_INLINE uint8_t DL_RTC_getPublisherChanID(RTC_Regs *rtc)
2351 {
2352  return (uint8_t)(rtc->FPUB_0 & RTC_FPUB_0_CHANID_MAXIMUM);
2353 }
2354 
2367 extern void DL_RTC_initCalendar(
2368  RTC_Regs *rtc, DL_RTC_Calendar calendarTime, DL_RTC_FORMAT formatSelect);
2369 
2383 extern DL_RTC_Calendar DL_RTC_getCalendarTime(RTC_Regs *rtc);
2384 
2394 extern void DL_RTC_setCalendarAlarm1(
2395  RTC_Regs *rtc, DL_RTC_CalendarAlarm alarmTime);
2396 
2406 extern DL_RTC_CalendarAlarm DL_RTC_getCalendarAlarm1(RTC_Regs *rtc);
2407 
2415 extern void DL_RTC_enableCalendarAlarm1(RTC_Regs *rtc);
2416 
2424 extern void DL_RTC_disableCalendarAlarm1(RTC_Regs *rtc);
2425 
2435 extern void DL_RTC_setCalendarAlarm2(
2436  RTC_Regs *rtc, DL_RTC_CalendarAlarm alarmTime);
2437 
2447 extern DL_RTC_CalendarAlarm DL_RTC_getCalendarAlarm2(RTC_Regs *rtc);
2448 
2456 extern void DL_RTC_enableCalendarAlarm2(RTC_Regs *rtc);
2457 
2465 extern void DL_RTC_disableCalendarAlarm2(RTC_Regs *rtc);
2466 
2467 #ifdef __cplusplus
2468 }
2469 #endif
2470 #endif /* __MSPM0_HAS_RTC__ */
2471 
2472 #endif /* ti_dl_dl_rtc__include */
2473 
__STATIC_INLINE void DL_RTC_disableAlarm2HoursBCD(RTC_Regs *rtc)
Disable hours in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1255
uint8_t hours
Definition: dl_rtc.h:278
__STATIC_INLINE void DL_RTC_enableAlarm1HoursBCD(RTC_Regs *rtc)
Enable hours in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1037
__STATIC_INLINE void DL_RTC_disableAlarm1DayOfMonthBCD(RTC_Regs *rtc)
Disable day of the month in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1149
uint16_t year
Definition: dl_rtc.h:314
Definition: dl_rtc.h:225
__STATIC_INLINE void DL_Common_updateReg(volatile uint32_t *reg, uint32_t val, uint32_t mask)
Writes value to specified register - retaining bits unaffected by mask.
Definition: dl_common.h:63
Definition: dl_rtc.h:259
Definition: dl_rtc.h:241
uint8_t dayOfMonth
Definition: dl_rtc.h:284
__STATIC_INLINE uint8_t DL_RTC_getCalendarSecondsBCD(RTC_Regs *rtc)
Get the seconds in in BCD the RTC calendar.
Definition: dl_rtc.h:765
void DL_RTC_disableCalendarAlarm1(RTC_Regs *rtc)
Disable calendar alarm 1.
__STATIC_INLINE void DL_RTC_setAlarm1DayOfWeekBinary(RTC_Regs *rtc, uint8_t day)
Set the day of the week in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1747
__STATIC_INLINE void DL_RTC_disableEvent(RTC_Regs *rtc, uint32_t eventMask)
Disable RTC event.
Definition: dl_rtc.h:2251
__STATIC_INLINE void DL_RTC_setAlarm2DayOfMonthBCD(RTC_Regs *rtc, uint8_t day)
Set the day of the month in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1368
DL_RTC_OFFSET_CALIBRATION_FREQUENCY
Definition: dl_rtc.h:173
Definition: dl_rtc.h:159
Calendar struct to use in DL_RTC_initCalendar()
Definition: dl_rtc.h:293
__STATIC_INLINE void DL_RTC_disableAlarm2DayOfMonthBinary(RTC_Regs *rtc)
Disable day of the month in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1987
__STATIC_INLINE DL_RTC_INTERVAL_ALARM DL_RTC_getIntervalAlarm(RTC_Regs *rtc)
Gets the interval alarm event condition.
Definition: dl_rtc.h:521
__STATIC_INLINE void DL_RTC_setAlarm2HoursBinary(RTC_Regs *rtc, uint8_t hours)
Set the hours in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1900
Definition: dl_rtc.h:145
__STATIC_INLINE uint8_t DL_RTC_getAlarm1DayOfWeekBCD(RTC_Regs *rtc)
Get the day of the week in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1127
Definition: dl_rtc.h:203
void DL_RTC_initCalendar(RTC_Regs *rtc, DL_RTC_Calendar calendarTime, DL_RTC_FORMAT formatSelect)
Initializes the settings to operate the RTC in Calendar mode.
__STATIC_INLINE void DL_RTC_disableAlarm2HoursBinary(RTC_Regs *rtc)
Disable hours in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1888
__STATIC_INLINE uint8_t DL_RTC_getAlarm1DayOfMonthBinary(RTC_Regs *rtc)
Get the day of the month in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1814
Definition: dl_rtc.h:197
__STATIC_INLINE uint8_t DL_RTC_getPublisherChanID(RTC_Regs *rtc)
Gets the event publisher channel ID.
Definition: dl_rtc.h:2350
Definition: dl_rtc.h:245
__STATIC_INLINE DL_RTC_FORMAT DL_RTC_getClockFormat(RTC_Regs *rtc)
Get the format currently being used for counting the real-time clock.
Definition: dl_rtc.h:477
Definition: dl_rtc.h:235
__STATIC_INLINE DL_RTC_OFFSET_CALIBRATION_FREQUENCY DL_RTC_getOffsetCalibrationFrequency(RTC_Regs *rtc)
Gets the offset calibration frequency.
Definition: dl_rtc.h:660
__STATIC_INLINE void DL_RTC_setAlarm1DayOfMonthBCD(RTC_Regs *rtc, uint8_t day)
Set the day of the month in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1161
__STATIC_INLINE uint8_t DL_RTC_getCalendarMinutesBinary(RTC_Regs *rtc)
Get the minutes in binary in the RTC calendar.
Definition: dl_rtc.h:1451
Definition: dl_rtc.h:151
__STATIC_INLINE uint16_t DL_RTC_getCalendarYearBCD(RTC_Regs *rtc)
Get the year in in BCD the RTC calendar.
Definition: dl_rtc.h:969
__STATIC_INLINE void DL_RTC_disableAlarm1HoursBCD(RTC_Regs *rtc)
Disable hours in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1048
Definition: dl_rtc.h:187
Definition: dl_rtc.h:217
__STATIC_INLINE void DL_RTC_setAlarm2HoursBCD(RTC_Regs *rtc, uint8_t hours)
Set the hours in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1267
__STATIC_INLINE void DL_RTC_setPrescalerEvents(RTC_Regs *rtc, DL_RTC_PRESCALER0_DIVIDE prescaler0Divider, DL_RTC_PRESCALER1_DIVIDE prescaler1Divider)
Set prescale interrupt interval for timer 0 and 1.
Definition: dl_rtc.h:2038
__STATIC_INLINE void DL_RTC_enableAlarm1MinutesBinary(RTC_Regs *rtc)
Enable minutes in binary in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1624
Definition: dl_rtc.h:153
__STATIC_INLINE void DL_RTC_disableAlarm1DayOfWeekBinary(RTC_Regs *rtc)
Disable day of the week in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1735
__STATIC_INLINE void DL_RTC_setAlarm2MinutesBCD(RTC_Regs *rtc, uint8_t minutes)
Set the minutes in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1215
__STATIC_INLINE void DL_RTC_setAlarm2MinutesBinary(RTC_Regs *rtc, uint8_t minutes)
Set the minutes in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1850
DL_RTC_Calendar DL_RTC_getCalendarTime(RTC_Regs *rtc)
Returns the Calendar Time.
Definition: dl_rtc.h:231
__STATIC_INLINE uint32_t DL_RTC_getTemperatureCompensation(RTC_Regs *rtc)
Get the RTC temperature compensation.
Definition: dl_rtc.h:732
__STATIC_INLINE void DL_RTC_setAlarm1HoursBCD(RTC_Regs *rtc, uint8_t hours)
Set the hours in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1060
Definition: dl_rtc.h:143
__STATIC_INLINE void DL_RTC_enableAlarm2MinutesBinary(RTC_Regs *rtc)
Enable minutes in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1826
uint8_t minutes
Definition: dl_rtc.h:275
DL_RTC_PRESCALER1_DIVIDE
Definition: dl_rtc.h:229
__STATIC_INLINE void DL_RTC_disableAlarm2MinutesBCD(RTC_Regs *rtc)
Disable minutes in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1202
__STATIC_INLINE uint8_t DL_RTC_getCalendarDayOfWeekBCD(RTC_Regs *rtc)
Get the day of the week in BCD in the RTC calendar.
Definition: dl_rtc.h:867
__STATIC_INLINE uint8_t DL_RTC_getAlarm1MinutesBCD(RTC_Regs *rtc)
Get the minutes in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1024
__STATIC_INLINE void DL_RTC_setCalendarDayOfMonthBinary(RTC_Regs *rtc, uint8_t day)
Set the day of the month in binary in the RTC calendar.
Definition: dl_rtc.h:1527
Definition: dl_rtc.h:237
void DL_RTC_setCalendarAlarm1(RTC_Regs *rtc, DL_RTC_CalendarAlarm alarmTime)
Set calendar alarm 1.
Definition: dl_rtc.h:233
void DL_RTC_disableCalendarAlarm2(RTC_Regs *rtc)
Disable calendar alarm 2.
DL_RTC_CalendarAlarm DL_RTC_getCalendarAlarm1(RTC_Regs *rtc)
Get calendar alarm 1.
__STATIC_INLINE bool DL_RTC_isReadyToCalibrate(RTC_Regs *rtc)
Checks if RTC is ready to get new calibration values.
Definition: dl_rtc.h:559
DL_RTC_COMPENSATION_STATUS
Definition: dl_rtc.h:149
__STATIC_INLINE uint8_t DL_RTC_getCalendarHoursBinary(RTC_Regs *rtc)
Get the hours in binary in the RTC calendar.
Definition: dl_rtc.h:1483
__STATIC_INLINE uint8_t DL_RTC_getAlarm2HoursBinary(RTC_Regs *rtc)
Get the hours in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1915
__STATIC_INLINE void DL_RTC_enableAlarm1DayOfWeekBCD(RTC_Regs *rtc)
Enable day of the week in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1089
__STATIC_INLINE uint32_t DL_RTC_getOffsetCalibrationValue(RTC_Regs *rtc)
Gets the offset error calibration value.
Definition: dl_rtc.h:693
__STATIC_INLINE uint8_t DL_RTC_getAlarm2DayOfMonthBCD(RTC_Regs *rtc)
Get the day of the month in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1385
__STATIC_INLINE uint32_t DL_RTC_getRawInterruptStatus(RTC_Regs *rtc, uint32_t interruptMask)
Check interrupt flag of any RTC interrupt.
Definition: dl_rtc.h:2195
DriverLib Common APIs.
DL_RTC_OFFSET_CALIBRATION_SIGN
Definition: dl_rtc.h:165
__STATIC_INLINE uint16_t DL_RTC_getCalendarYearBinary(RTC_Regs *rtc)
Get the year in binary in the RTC calendar.
Definition: dl_rtc.h:1612
__STATIC_INLINE void DL_RTC_setCalendarDayOfWeekBCD(RTC_Regs *rtc, uint8_t day)
Set the day of the week in BCD in the RTC calendar.
Definition: dl_rtc.h:848
__STATIC_INLINE void DL_RTC_setCalendarHoursBCD(RTC_Regs *rtc, uint8_t hours)
Set the hours in in BCD the RTC calendar.
Definition: dl_rtc.h:814
__STATIC_INLINE void DL_RTC_setCalendarSecondsBCD(RTC_Regs *rtc, uint8_t seconds)
Set the seconds in BCD in the RTC calendar.
Definition: dl_rtc.h:744
Definition: dl_rtc.h:167
__STATIC_INLINE void DL_RTC_enableAlarm2DayOfWeekBinary(RTC_Regs *rtc)
Enable day of the week in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1926
__STATIC_INLINE void DL_RTC_clearInterruptStatus(RTC_Regs *rtc, uint32_t interruptMask)
Clear pending RTC interrupts.
Definition: dl_rtc.h:2226
__STATIC_INLINE void DL_RTC_disableClockControl(RTC_Regs *rtc)
Disables the supply of the 32kHz clock to the RTC.
Definition: dl_rtc.h:400
__STATIC_INLINE void DL_RTC_setCalendarDayOfWeekBinary(RTC_Regs *rtc, uint8_t day)
Set the day of the week in binary in the RTC calendar.
Definition: dl_rtc.h:1495
Definition: dl_rtc.h:195
__STATIC_INLINE void DL_RTC_setAlarm1HoursBinary(RTC_Regs *rtc, uint8_t hours)
Set the hours in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1698
__STATIC_INLINE void DL_RTC_setPeriodicAlarm0(RTC_Regs *rtc, DL_RTC_PRESCALER0_DIVIDE prescaler0Divider)
Set periodic alarm 0.
Definition: dl_rtc.h:2055
__STATIC_INLINE void DL_RTC_setCalendarHoursBinary(RTC_Regs *rtc, uint8_t hours)
Set the hours in binary in the RTC calendar.
Definition: dl_rtc.h:1463
Definition: dl_rtc.h:219
Definition: dl_rtc.h:215
__STATIC_INLINE uint8_t DL_RTC_getAlarm1HoursBinary(RTC_Regs *rtc)
Get the hours in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1713
uint8_t seconds
Definition: dl_rtc.h:296
void DL_RTC_enableCalendarAlarm1(RTC_Regs *rtc)
Enable calendar alarm 1.
uint8_t dayOfWeek
Definition: dl_rtc.h:281
__STATIC_INLINE void DL_RTC_setCalendarMinutesBinary(RTC_Regs *rtc, uint8_t minutes)
Set the minutes in binary in the RTC calendar.
Definition: dl_rtc.h:1431
DL_RTC_COMPENSATION_WRITE_RESULT
Definition: dl_rtc.h:157
__STATIC_INLINE void DL_RTC_enableAlarm2DayOfMonthBinary(RTC_Regs *rtc)
Enable day of the month in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1976
__STATIC_INLINE uint8_t DL_RTC_getCalendarDayOfWeekBinary(RTC_Regs *rtc)
Get the day of the week in binary in the RTC calendar.
Definition: dl_rtc.h:1515
__STATIC_INLINE void DL_RTC_reset(RTC_Regs *rtc)
Resets all registers in the RTC module.
Definition: dl_rtc.h:359
__STATIC_INLINE uint8_t DL_RTC_getAlarm2DayOfWeekBCD(RTC_Regs *rtc)
Get the day of the week in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1334
__STATIC_INLINE void DL_RTC_enableAlarm1HoursBinary(RTC_Regs *rtc)
Enable hours in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1675
Definition: dl_rtc.h:205
__STATIC_INLINE void DL_RTC_setCalendarSecondsBinary(RTC_Regs *rtc, uint8_t seconds)
Set the seconds in binary the RTC calendar.
Definition: dl_rtc.h:1399
__STATIC_INLINE void DL_RTC_disableDebugMode(RTC_Regs *rtc)
Disables the RTC modules debug mode.
Definition: dl_rtc.h:447
__STATIC_INLINE uint8_t DL_RTC_getAlarm1DayOfWeekBinary(RTC_Regs *rtc)
Get the day of the week in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1763
Definition: dl_rtc.h:257
Definition: dl_rtc.h:243
__STATIC_INLINE uint8_t DL_RTC_getAlarm1MinutesBinary(RTC_Regs *rtc)
Get the minutes in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1664
__STATIC_INLINE void DL_RTC_setPublisherChanID(RTC_Regs *rtc, uint8_t chanID)
Sets the event publisher channel ID.
Definition: dl_rtc.h:2336
__STATIC_INLINE void DL_RTC_setPeriodicAlarm1(RTC_Regs *rtc, DL_RTC_PRESCALER1_DIVIDE prescaler1Divider)
Set periodic alarm 1.
Definition: dl_rtc.h:2071
uint8_t dayOfMonth
Definition: dl_rtc.h:308
__STATIC_INLINE void DL_RTC_enableAlarm1DayOfMonthBinary(RTC_Regs *rtc)
Enable day of the month in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1774
DL_RTC_INTERVAL_ALARM
Definition: dl_rtc.h:201
__STATIC_INLINE void DL_RTC_setAlarm2DayOfWeekBinary(RTC_Regs *rtc, uint8_t day)
Set the day of the week in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1949
__STATIC_INLINE void DL_RTC_setCalendarMonthBinary(RTC_Regs *rtc, uint8_t month)
Set the month in binary in the RTC calendar.
Definition: dl_rtc.h:1560
Definition: dl_rtc.h:251
__STATIC_INLINE void DL_RTC_disableAlarm2DayOfWeekBCD(RTC_Regs *rtc)
Disable day of the week in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1307
uint8_t minutes
Definition: dl_rtc.h:299
__STATIC_INLINE DL_RTC_IIDX DL_RTC_getPendingInterrupt(RTC_Regs *rtc)
Get highest priority pending RTC interrupt.
Definition: dl_rtc.h:2213
__STATIC_INLINE uint8_t DL_RTC_getAlarm2MinutesBCD(RTC_Regs *rtc)
Get the minutes in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1231
Definition: dl_rtc.h:261
__STATIC_INLINE void DL_RTC_setOffsetCalibrationFrequency(RTC_Regs *rtc, DL_RTC_OFFSET_CALIBRATION_FREQUENCY offsetFrequency)
Sets output frequency for offset calibration.
Definition: dl_rtc.h:590
__STATIC_INLINE void DL_RTC_enableAlarm1MinutesBCD(RTC_Regs *rtc)
Enable minutes in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:984
DL_RTC_PRESCALER0_DIVIDE
Definition: dl_rtc.h:213
__STATIC_INLINE bool DL_RTC_isCalibrationWriteResultOK(RTC_Regs *rtc)
Checks if RTC new calibration values were written OK.
Definition: dl_rtc.h:573
__STATIC_INLINE void DL_RTC_disableAlarm1HoursBinary(RTC_Regs *rtc)
Disable hours in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1686
__STATIC_INLINE void DL_RTC_enableAlarm2MinutesBCD(RTC_Regs *rtc)
Enable minutes in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1191
__STATIC_INLINE void DL_RTC_setAlarm1MinutesBinary(RTC_Regs *rtc, uint8_t minutes)
Set the minutes in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1648
__STATIC_INLINE void DL_RTC_setCalendarMinutesBCD(RTC_Regs *rtc, uint8_t minutes)
Set the minutes in in BCD the RTC calendar.
Definition: dl_rtc.h:779
__STATIC_INLINE void DL_RTC_disablePower(RTC_Regs *rtc)
Disable power to the RTC module.
Definition: dl_rtc.h:334
__STATIC_INLINE void DL_RTC_setCalendarMonthBCD(RTC_Regs *rtc, uint8_t month)
Set the month in in BCD the RTC calendar.
Definition: dl_rtc.h:914
__STATIC_INLINE void DL_RTC_setAlarm1DayOfMonthBinary(RTC_Regs *rtc, uint8_t day)
Set the day of the month in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1797
__STATIC_INLINE uint8_t DL_RTC_getAlarm2DayOfMonthBinary(RTC_Regs *rtc)
Get the day of the month in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:2016
void DL_RTC_setCalendarAlarm2(RTC_Regs *rtc, DL_RTC_CalendarAlarm alarmTime)
Set calendar alarm 2.
DL_RTC_IIDX
Definition: dl_rtc.h:249
__STATIC_INLINE void DL_RTC_enableDebugInterrupts(RTC_Regs *rtc)
Enables interrupts when the CPU is in debug mode. Interrupt requests are signaled to the interrupt co...
Definition: dl_rtc.h:412
Alarm struct to use in DL_RTC_setCalendarAlarm.
Definition: dl_rtc.h:272
__STATIC_INLINE uint32_t DL_RTC_getRawEventsStatus(RTC_Regs *rtc, uint32_t eventMask)
Check interrupt flag of any RTC event.
Definition: dl_rtc.h:2309
__STATIC_INLINE uint32_t DL_RTC_getEnabledEventStatus(RTC_Regs *rtc, uint32_t eventMask)
Check event flag of enabled RTC event.
Definition: dl_rtc.h:2289
uint8_t hours
Definition: dl_rtc.h:302
__STATIC_INLINE uint8_t DL_RTC_getCalendarDayOfMonthBinary(RTC_Regs *rtc)
Get the day of the month in binary in the RTC calendar.
Definition: dl_rtc.h:1548
__STATIC_INLINE bool DL_RTC_isReset(RTC_Regs *rtc)
Returns if the RTC module was reset.
Definition: dl_rtc.h:375
__STATIC_INLINE void DL_RTC_disableAlarm2MinutesBinary(RTC_Regs *rtc)
Disable minutes in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1837
Definition: dl_rtc.h:189
__STATIC_INLINE void DL_RTC_disableAlarm2DayOfWeekBinary(RTC_Regs *rtc)
Disable day of the week in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1937
__STATIC_INLINE bool DL_RTC_isSafetoRead(RTC_Regs *rtc)
Checks if RTC is safe for reading.
Definition: dl_rtc.h:545
void DL_RTC_enableCalendarAlarm2(RTC_Regs *rtc)
Enable calendar alarm 2.
__STATIC_INLINE uint8_t DL_RTC_getAlarm1DayOfMonthBCD(RTC_Regs *rtc)
Get the day of the month in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1178
__STATIC_INLINE void DL_RTC_enableDebugMode(RTC_Regs *rtc)
Enables the RTC modules debug mode.
Definition: dl_rtc.h:436
__STATIC_INLINE void DL_RTC_setCalendarYearBinary(RTC_Regs *rtc, uint16_t year)
Set the year in binary in the RTC calendar.
Definition: dl_rtc.h:1592
__STATIC_INLINE void DL_RTC_disableInterrupt(RTC_Regs *rtc, uint32_t interruptMask)
Disable RTC interrupts.
Definition: dl_rtc.h:2133
__STATIC_INLINE uint8_t DL_RTC_getCalendarSecondsBinary(RTC_Regs *rtc)
Get the seconds in binary in the RTC calendar.
Definition: dl_rtc.h:1419
__STATIC_INLINE uint32_t DL_RTC_getEnabledEvents(RTC_Regs *rtc, uint32_t eventMask)
Check which RTC events are enabled.
Definition: dl_rtc.h:2267
__STATIC_INLINE uint32_t DL_RTC_getEnabledInterruptStatus(RTC_Regs *rtc, uint32_t interruptMask)
Check interrupt flag of enabled RTC interrupts.
Definition: dl_rtc.h:2174
__STATIC_INLINE uint8_t DL_RTC_getAlarm2DayOfWeekBinary(RTC_Regs *rtc)
Get the day of the week in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1965
__STATIC_INLINE void DL_RTC_setAlarm2DayOfMonthBinary(RTC_Regs *rtc, uint8_t day)
Set the day of the month in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1999
__STATIC_INLINE void DL_RTC_disableAlarm1DayOfWeekBCD(RTC_Regs *rtc)
Disable day of the week in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1100
__STATIC_INLINE void DL_RTC_disableAlarm1MinutesBinary(RTC_Regs *rtc)
Disable minutes in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1635
__STATIC_INLINE void DL_RTC_clearEventsStatus(RTC_Regs *rtc, uint32_t eventMask)
Clear pending RTC events.
Definition: dl_rtc.h:2322
Definition: dl_rtc.h:239
__STATIC_INLINE void DL_RTC_enablePower(RTC_Regs *rtc)
Enable power to the RTC module.
Definition: dl_rtc.h:323
__STATIC_INLINE void DL_RTC_enableInterrupt(RTC_Regs *rtc, uint32_t interruptMask)
Enable RTC interrupts.
Definition: dl_rtc.h:2119
__STATIC_INLINE void DL_RTC_setClockFormat(RTC_Regs *rtc, DL_RTC_FORMAT formatSelect)
Set the format of the real-time clock.
Definition: dl_rtc.h:461
DL_RTC_TEMP_CALIBRATION
Definition: dl_rtc.h:185
DL_RTC_FORMAT
Definition: dl_rtc.h:193
__STATIC_INLINE void DL_RTC_disableAlarm1MinutesBCD(RTC_Regs *rtc)
Disable minutes in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:995
__STATIC_INLINE uint32_t DL_RTC_getEnabledInterrupts(RTC_Regs *rtc, uint32_t interruptMask)
Check which RTC interrupts are enabled.
Definition: dl_rtc.h:2151
__STATIC_INLINE void DL_RTC_disableAlarm2DayOfMonthBCD(RTC_Regs *rtc)
Disable day of the month in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1356
__STATIC_INLINE uint8_t DL_RTC_getAlarm2HoursBCD(RTC_Regs *rtc)
Get the hours in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1283
Definition: dl_rtc.h:255
__STATIC_INLINE DL_RTC_PRESCALER0_DIVIDE DL_RTC_getPrescaler0(RTC_Regs *rtc)
Get prescaler 0 interrupt interval.
Definition: dl_rtc.h:2088
__STATIC_INLINE void DL_RTC_enableClockControl(RTC_Regs *rtc)
Enables the supply of the 32kHz clock to the RTC. It will not power up the 32kHz crystal oscillator...
Definition: dl_rtc.h:389
__STATIC_INLINE void DL_RTC_setOffsetCalibrationAdjValue(RTC_Regs *rtc, DL_RTC_OFFSET_CALIBRATION_SIGN offsetSign, uint8_t offsetValue)
Sets the offset error calibration adjustment value.
Definition: dl_rtc.h:612
__STATIC_INLINE uint8_t DL_RTC_getCalendarMinutesBCD(RTC_Regs *rtc)
Get the minutes in in BCD the RTC calendar.
Definition: dl_rtc.h:800
__STATIC_INLINE void DL_RTC_setTemperatureCompensation(RTC_Regs *rtc, DL_RTC_TEMP_CALIBRATION offsetDirection, uint32_t offsetValue)
Set the specified RTC temperature compensation.
Definition: dl_rtc.h:714
__STATIC_INLINE void DL_RTC_enableAlarm2HoursBCD(RTC_Regs *rtc)
Enable hours in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1244
Definition: dl_rtc.h:253
__STATIC_INLINE void DL_RTC_setCalendarDayOfMonthBCD(RTC_Regs *rtc, uint8_t day)
Set the day of the month in BCD in the RTC calendar.
Definition: dl_rtc.h:879
__STATIC_INLINE void DL_RTC_setAlarm1DayOfWeekBCD(RTC_Regs *rtc, uint8_t day)
Set the day of the week in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1112
__STATIC_INLINE uint8_t DL_RTC_getCalendarHoursBCD(RTC_Regs *rtc)
Get the hours in in BCD the RTC calendar.
Definition: dl_rtc.h:834
Definition: dl_rtc.h:209
uint8_t month
Definition: dl_rtc.h:311
__STATIC_INLINE void DL_RTC_enableAlarm2DayOfMonthBCD(RTC_Regs *rtc)
Enable day of the month in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1345
__STATIC_INLINE void DL_RTC_disableDebugInterrupts(RTC_Regs *rtc)
Disables interrupts when the CPU is in debug mode. Interrupts of the RTC module will not be captured...
Definition: dl_rtc.h:425
Definition: dl_rtc.h:169
__STATIC_INLINE void DL_RTC_enableAlarm1DayOfMonthBCD(RTC_Regs *rtc)
Enable day of the month in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1138
__STATIC_INLINE void DL_RTC_enableAlarm2HoursBinary(RTC_Regs *rtc)
Enable hours in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1877
__STATIC_INLINE uint8_t DL_RTC_getAlarm1HoursBCD(RTC_Regs *rtc)
Get the hours in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1076
Definition: dl_rtc.h:221
__STATIC_INLINE uint8_t DL_RTC_getCalendarDayOfMonthBCD(RTC_Regs *rtc)
Get the day of the month in BCD in the RTC calendar.
Definition: dl_rtc.h:900
__STATIC_INLINE bool DL_RTC_isPowerEnabled(RTC_Regs *rtc)
Returns if power is enabled for the RTC module.
Definition: dl_rtc.h:347
__STATIC_INLINE void DL_RTC_setAlarm2DayOfWeekBCD(RTC_Regs *rtc, uint8_t day)
Set the day of the week in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1319
__STATIC_INLINE DL_RTC_PRESCALER1_DIVIDE DL_RTC_getPrescaler1(RTC_Regs *rtc)
Get prescaler 1 interrupt interval.
Definition: dl_rtc.h:2104
__STATIC_INLINE void DL_RTC_setIntervalAlarm(RTC_Regs *rtc, DL_RTC_INTERVAL_ALARM alarmEvent)
Sets the interval alarm event condition.
Definition: dl_rtc.h:500
__STATIC_INLINE void DL_RTC_disableAlarm1DayOfMonthBinary(RTC_Regs *rtc)
Disable day of the month in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1785
__STATIC_INLINE DL_RTC_OFFSET_CALIBRATION_SIGN DL_RTC_getOffsetCalibrationSign(RTC_Regs *rtc)
Gets the offset calibration sign.
Definition: dl_rtc.h:676
__STATIC_INLINE void DL_RTC_setAlarm1MinutesBCD(RTC_Regs *rtc, uint8_t minutes)
Set the minutes in BCD for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1008
DL_RTC_CalendarAlarm DL_RTC_getCalendarAlarm2(RTC_Regs *rtc)
Get calendar alarm 2.
__STATIC_INLINE void DL_RTC_enableAlarm2DayOfWeekBCD(RTC_Regs *rtc)
Enable day of the week in BCD for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1296
uint8_t dayOfWeek
Definition: dl_rtc.h:305
DL_RTC_STATUS
Definition: dl_rtc.h:141
__STATIC_INLINE void DL_RTC_enableEvent(RTC_Regs *rtc, uint32_t eventMask)
Enable RTC event.
Definition: dl_rtc.h:2239
Definition: dl_rtc.h:223
Definition: dl_rtc.h:207
__STATIC_INLINE uint8_t DL_RTC_getCalendarMonthBCD(RTC_Regs *rtc)
Get the month of the year in BCD in the RTC calendar.
Definition: dl_rtc.h:934
__STATIC_INLINE void DL_RTC_enableAlarm1DayOfWeekBinary(RTC_Regs *rtc)
Enable day of the week in binary for RTC Calendar Alarm 1.
Definition: dl_rtc.h:1724
__STATIC_INLINE void DL_RTC_setOffsetCalibration(RTC_Regs *rtc, DL_RTC_OFFSET_CALIBRATION_FREQUENCY offsetFrequency, DL_RTC_OFFSET_CALIBRATION_SIGN offsetSign, uint8_t offsetValue)
Sets the offset error calibration.
Definition: dl_rtc.h:642
__STATIC_INLINE void DL_RTC_setCalendarYearBCD(RTC_Regs *rtc, uint16_t year)
Set the year in in BCD the RTC calendar.
Definition: dl_rtc.h:948
__STATIC_INLINE uint8_t DL_RTC_getCalendarMonthBinary(RTC_Regs *rtc)
Get the month of the year in binary in the RTC calendar.
Definition: dl_rtc.h:1580
__STATIC_INLINE uint8_t DL_RTC_getAlarm2MinutesBinary(RTC_Regs *rtc)
Get the minutes in binary for RTC Calendar Alarm 2.
Definition: dl_rtc.h:1866
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale