7 #ifndef __MSP430WARE_RTC_A_H__ 8 #define __MSP430WARE_RTC_A_H__ 10 #include "inc/hw_memmap.h" 12 #ifdef __MSP430_HAS_RTC__ 25 #include "inc/hw_memmap.h" 81 #define RTC_A_CALIBRATIONFREQ_OFF (RTCCALF_0) 82 #define RTC_A_CALIBRATIONFREQ_512HZ (RTCCALF_1) 83 #define RTC_A_CALIBRATIONFREQ_256HZ (RTCCALF_2) 84 #define RTC_A_CALIBRATIONFREQ_1HZ (RTCCALF_3) 92 #define RTC_A_CALIBRATION_DOWN2PPM (!(RTCCALS)) 93 #define RTC_A_CALIBRATION_UP4PPM (RTCCALS) 101 #define RTC_A_FORMAT_BINARY (!(RTCBCD)) 102 #define RTC_A_FORMAT_BCD (RTCBCD) 111 #define RTC_A_ALARMCONDITION_OFF (0x80) 119 #define RTC_A_CALENDAREVENT_MINUTECHANGE (RTCTEV_0) 120 #define RTC_A_CALENDAREVENT_HOURCHANGE (RTCTEV_1) 121 #define RTC_A_CALENDAREVENT_NOON (RTCTEV_2) 122 #define RTC_A_CALENDAREVENT_MIDNIGHT (RTCTEV_3) 132 #define RTC_A_PRESCALE_0 (0x0) 133 #define RTC_A_PRESCALE_1 (0x2) 141 #define RTC_A_CLOCKSELECT_ACLK (RTCSSEL_0) 142 #define RTC_A_CLOCKSELECT_SMCLK (RTCSSEL_1) 143 #define RTC_A_CLOCKSELECT_RT1PS (RTCSSEL_2) 151 #define RTC_A_PSCLOCKSELECT_ACLK (RT1SSEL_0) 152 #define RTC_A_PSCLOCKSELECT_SMCLK (RT1SSEL_1) 153 #define RTC_A_PSCLOCKSELECT_RT0PS (RT1SSEL_2) 161 #define RTC_A_COUNTERSIZE_8BIT (RTCTEV_0) 162 #define RTC_A_COUNTERSIZE_16BIT (RTCTEV_1) 163 #define RTC_A_COUNTERSIZE_24BIT (RTCTEV_2) 164 #define RTC_A_COUNTERSIZE_32BIT (RTCTEV_3) 172 #define RTC_A_PSDIVIDER_2 (RT0PSDIV_0) 173 #define RTC_A_PSDIVIDER_4 (RT0PSDIV_1) 174 #define RTC_A_PSDIVIDER_8 (RT0PSDIV_2) 175 #define RTC_A_PSDIVIDER_16 (RT0PSDIV_3) 176 #define RTC_A_PSDIVIDER_32 (RT0PSDIV_4) 177 #define RTC_A_PSDIVIDER_64 (RT0PSDIV_5) 178 #define RTC_A_PSDIVIDER_128 (RT0PSDIV_6) 179 #define RTC_A_PSDIVIDER_256 (RT0PSDIV_7) 187 #define RTC_A_PSEVENTDIVIDER_2 (RT0IP_0) 188 #define RTC_A_PSEVENTDIVIDER_4 (RT0IP_1) 189 #define RTC_A_PSEVENTDIVIDER_8 (RT0IP_2) 190 #define RTC_A_PSEVENTDIVIDER_16 (RT0IP_3) 191 #define RTC_A_PSEVENTDIVIDER_32 (RT0IP_4) 192 #define RTC_A_PSEVENTDIVIDER_64 (RT0IP_5) 193 #define RTC_A_PSEVENTDIVIDER_128 (RT0IP_6) 194 #define RTC_A_PSEVENTDIVIDER_256 (RT0IP_7) 205 #define RTC_A_TIME_EVENT_INTERRUPT RTCTEVIE 206 #define RTC_A_CLOCK_ALARM_INTERRUPT RTCAIE 207 #define RTC_A_CLOCK_READ_READY_INTERRUPT RTCRDYIE 208 #define RTC_A_PRESCALE_TIMER0_INTERRUPT 0x02 209 #define RTC_A_PRESCALE_TIMER1_INTERRUPT 0x01 268 uint16_t frequencySelect);
296 uint8_t offsetDirection,
297 uint8_t offsetValue);
326 uint16_t clockSelect,
327 uint16_t counterSizeSelect);
359 uint16_t formatSelect);
418 uint16_t eventSelect);
449 uint32_t counterValue);
489 uint8_t prescaleSelect,
490 uint16_t prescaleClockSelect,
491 uint16_t prescaleDivider);
513 uint8_t prescaleSelect);
532 uint8_t prescaleSelect);
564 uint8_t prescaleSelect,
565 uint8_t prescaleEventDivider);
585 uint8_t prescaleSelect);
607 uint8_t prescaleSelect,
608 uint8_t prescaleCounterValue);
637 uint8_t interruptMask);
666 uint8_t interruptMask);
707 uint8_t interruptFlagMask);
736 uint8_t interruptFlagMask);
748 #endif // __MSP430WARE_RTC_A_H__ void RTC_A_setCalibrationData(uint16_t baseAddress, uint8_t offsetDirection, uint8_t offsetValue)
Sets the specified calibration for the RTC.
Definition: rtc_a.c:38
uint8_t RTC_A_getInterruptStatus(uint16_t baseAddress, uint8_t interruptFlagMask)
Returns the status of the selected interrupts flags.
Definition: rtc_a.c:219
uint8_t Hours
Hour of day between 0-23.
Definition: rtc_a.h:63
uint32_t RTC_A_getCounterValue(uint16_t baseAddress)
Returns the value of the Counter register.
Definition: rtc_a.c:108
void RTC_A_initCalendar(uint16_t baseAddress, Calendar *CalendarTime, uint16_t formatSelect)
Initializes the settings to operate the RTC in calendar mode.
Definition: rtc_a.c:56
void RTC_A_setPrescaleValue(uint16_t baseAddress, uint8_t prescaleSelect, uint8_t prescaleCounterValue)
Sets the selected prescaler value.
Definition: rtc_a.c:174
void RTC_A_clearInterrupt(uint16_t baseAddress, uint8_t interruptFlagMask)
Clears selected RTC interrupt flags.
Definition: rtc_a.c:248
uint16_t Year
Year between 0-4095.
Definition: rtc_a.h:71
uint8_t DayOfWeek
Day of week between 0-6.
Definition: rtc_a.h:65
uint8_t Minutes
Minutes of hour between 0-59.
Definition: rtc_a.h:61
void RTC_A_holdCounterPrescale(uint16_t baseAddress, uint8_t prescaleSelect)
Holds the selected Prescaler.
Definition: rtc_a.c:137
void RTC_A_enableInterrupt(uint16_t baseAddress, uint8_t interruptMask)
Enables selected RTC interrupt sources.
Definition: rtc_a.c:185
uint8_t Month
Month between 1-12.
Definition: rtc_a.h:69
uint8_t DayOfMonth
Day of month between 1-31.
Definition: rtc_a.h:67
Used in the RTC_A_initCalendar() function as the CalendarTime parameter.
Definition: rtc_a.h:57
void RTC_A_startCounterPrescale(uint16_t baseAddress, uint8_t prescaleSelect)
Starts the selected Prescaler.
Definition: rtc_a.c:143
Calendar RTC_A_getCalendarTime(uint16_t baseAddress)
Returns the Calendar Time stored in the Calendar registers of the RTC.
Definition: rtc_a.c:74
void RTC_A_setCalibrationFrequency(uint16_t baseAddress, uint16_t frequencySelect)
Allows and Sets the frequency output to RTCCLK pin for calibration measurement.
Definition: rtc_a.c:31
void RTC_A_definePrescaleEvent(uint16_t baseAddress, uint8_t prescaleSelect, uint8_t prescaleEventDivider)
Sets up an interrupt condition for the selected Prescaler.
Definition: rtc_a.c:149
void RTC_A_configureCalendarAlarm(uint16_t baseAddress, RTC_A_configureCalendarAlarmParam *param)
Sets and Enables the desired Calendar Alarm settings.
Definition: rtc_a.c:91
uint8_t RTC_A_getPrescaleValue(uint16_t baseAddress, uint8_t prescaleSelect)
Returns the selected prescaler value.
Definition: rtc_a.c:158
void RTC_A_initCounter(uint16_t baseAddress, uint16_t clockSelect, uint16_t counterSizeSelect)
Initializes the settings to operate the RTC in Counter mode.
Definition: rtc_a.c:45
void RTC_A_startClock(uint16_t baseAddress)
Starts the RTC.
Definition: rtc_a.c:21
void RTC_A_holdClock(uint16_t baseAddress)
Holds the RTC.
Definition: rtc_a.c:26
void RTC_A_setCalendarEvent(uint16_t baseAddress, uint16_t eventSelect)
Sets a single specified Calendar interrupt condition.
Definition: rtc_a.c:101
void RTC_A_disableInterrupt(uint16_t baseAddress, uint8_t interruptMask)
Disables selected RTC interrupt sources.
Definition: rtc_a.c:202
void RTC_A_setCounterValue(uint16_t baseAddress, uint32_t counterValue)
Sets the value of the Counter register.
Definition: rtc_a.c:120
void RTC_A_initCounterPrescale(uint16_t baseAddress, uint8_t prescaleSelect, uint16_t prescaleClockSelect, uint16_t prescaleDivider)
Initializes the Prescaler for Counter mode.
Definition: rtc_a.c:127
uint8_t Seconds
Seconds of minute between 0-59.
Definition: rtc_a.h:59