7 #ifndef __MSP430WARE_RTC_C_H__
8 #define __MSP430WARE_RTC_C_H__
10 #include "inc/hw_memmap.h"
12 #ifdef __MSP430_HAS_RTC_C__
25 #include "inc/hw_memmap.h"
81 #define RTC_C_CALIBRATIONFREQ_OFF (RTCCALF_0)
82 #define RTC_C_CALIBRATIONFREQ_512HZ (RTCCALF_1)
83 #define RTC_C_CALIBRATIONFREQ_256HZ (RTCCALF_2)
84 #define RTC_C_CALIBRATIONFREQ_1HZ (RTCCALF_3)
92 #define RTC_C_CALIBRATION_DOWN1PPM (!(RTCCALS))
93 #define RTC_C_CALIBRATION_UP1PPM (RTCCALS)
101 #define RTC_C_COMPENSATION_DOWN1PPM (!(RTCTCMPS))
102 #define RTC_C_COMPENSATION_UP1PPM (RTCTCMPS)
110 #define RTC_C_CLOCKSELECT_32KHZ_OSC (RTCSSEL_0)
111 #define RTC_C_CLOCKSELECT_RT1PS (RTCSSEL_2)
119 #define RTC_C_COUNTERSIZE_8BIT (RTCTEV_0)
120 #define RTC_C_COUNTERSIZE_16BIT (RTCTEV_1)
121 #define RTC_C_COUNTERSIZE_24BIT (RTCTEV_2)
122 #define RTC_C_COUNTERSIZE_32BIT (RTCTEV_3)
130 #define RTC_C_FORMAT_BINARY (!(RTCBCD))
131 #define RTC_C_FORMAT_BCD (RTCBCD)
140 #define RTC_C_ALARMCONDITION_OFF (0x80)
148 #define RTC_C_CALENDAREVENT_MINUTECHANGE (RTCTEV_0)
149 #define RTC_C_CALENDAREVENT_HOURCHANGE (RTCTEV_1)
150 #define RTC_C_CALENDAREVENT_NOON (RTCTEV_2)
151 #define RTC_C_CALENDAREVENT_MIDNIGHT (RTCTEV_3)
159 #define RTC_C_PSDIVIDER_2 (RT0PSDIV_0)
160 #define RTC_C_PSDIVIDER_4 (RT0PSDIV_1)
161 #define RTC_C_PSDIVIDER_8 (RT0PSDIV_2)
162 #define RTC_C_PSDIVIDER_16 (RT0PSDIV_3)
163 #define RTC_C_PSDIVIDER_32 (RT0PSDIV_4)
164 #define RTC_C_PSDIVIDER_64 (RT0PSDIV_5)
165 #define RTC_C_PSDIVIDER_128 (RT0PSDIV_6)
166 #define RTC_C_PSDIVIDER_256 (RT0PSDIV_7)
174 #define RTC_C_PSCLOCKSELECT_ACLK (RT1SSEL_0)
175 #define RTC_C_PSCLOCKSELECT_SMCLK (RT1SSEL_1)
176 #define RTC_C_PSCLOCKSELECT_RT0PS (RT1SSEL_2)
184 #define RTC_C_PSEVENTDIVIDER_2 (RT0IP_0)
185 #define RTC_C_PSEVENTDIVIDER_4 (RT0IP_1)
186 #define RTC_C_PSEVENTDIVIDER_8 (RT0IP_2)
187 #define RTC_C_PSEVENTDIVIDER_16 (RT0IP_3)
188 #define RTC_C_PSEVENTDIVIDER_32 (RT0IP_4)
189 #define RTC_C_PSEVENTDIVIDER_64 (RT0IP_5)
190 #define RTC_C_PSEVENTDIVIDER_128 (RT0IP_6)
191 #define RTC_C_PSEVENTDIVIDER_256 (RT0IP_7)
201 #define RTC_C_PRESCALE_0 (0x0)
202 #define RTC_C_PRESCALE_1 (0x2)
213 #define RTC_C_TIME_EVENT_INTERRUPT RTCTEVIE
214 #define RTC_C_CLOCK_ALARM_INTERRUPT RTCAIE
215 #define RTC_C_CLOCK_READ_READY_INTERRUPT RTCRDYIE
216 #define RTC_C_PRESCALE_TIMER0_INTERRUPT 0x02
217 #define RTC_C_PRESCALE_TIMER1_INTERRUPT 0x01
218 #define RTC_C_OSCILLATOR_FAULT_INTERRUPT RTCOFIE
277 uint16_t frequencySelect);
303 uint8_t offsetDirection,
304 uint8_t offsetValue);
332 uint16_t clockSelect,
333 uint16_t counterSizeSelect);
359 uint16_t offsetDirection,
360 uint8_t offsetValue);
391 uint16_t formatSelect);
450 uint16_t eventSelect);
481 uint32_t counterValue);
521 uint8_t prescaleSelect,
522 uint16_t prescaleClockSelect,
523 uint16_t prescaleDivider);
545 uint8_t prescaleSelect);
564 uint8_t prescaleSelect);
596 uint8_t prescaleSelect,
597 uint8_t prescaleEventDivider);
617 uint8_t prescaleSelect);
639 uint8_t prescaleSelect,
640 uint8_t prescaleCounterValue);
671 uint8_t interruptMask);
702 uint8_t interruptMask);
747 uint8_t interruptFlagMask);
778 uint8_t interruptFlagMask);
795 uint16_t valueToConvert);
812 uint16_t valueToConvert);
824 #endif // __MSP430WARE_RTC_C_H__
void RTC_C_setCounterValue(uint16_t baseAddress, uint32_t counterValue)
Sets the value of the Counter register.
Definition: rtc_c.c:151
uint8_t Hours
Hour of day between 0-23.
Definition: rtc_b.h:38
void RTC_C_setCalendarEvent(uint16_t baseAddress, uint16_t eventSelect)
Sets a single specified Calendar interrupt condition.
Definition: rtc_c.c:130
void RTC_C_initCounter(uint16_t baseAddress, uint16_t clockSelect, uint16_t counterSizeSelect)
Initializes the settings to operate the RTC in Counter mode.
Definition: rtc_c.c:53
uint8_t RTC_C_getInterruptStatus(uint16_t baseAddress, uint8_t interruptFlagMask)
Returns the status of the selected interrupts flags.
Definition: rtc_c.c:262
void RTC_C_holdClock(uint16_t baseAddress)
Holds the RTC.
Definition: rtc_c.c:28
void RTC_C_setCalibrationData(uint16_t baseAddress, uint8_t offsetDirection, uint8_t offsetValue)
Sets the specified calibration for the RTC.
Definition: rtc_c.c:44
uint32_t RTC_C_getCounterValue(uint16_t baseAddress)
Returns the value of the Counter register.
Definition: rtc_c.c:139
uint16_t RTC_C_convertBinaryToBCD(uint16_t baseAddress, uint16_t valueToConvert)
Convert the given binary value to BCD format.
Definition: rtc_c.c:324
uint16_t Year
Year between 0-4095.
Definition: rtc_b.h:46
uint16_t RTC_C_convertBCDToBinary(uint16_t baseAddress, uint16_t valueToConvert)
Convert the given BCD value to binary format.
Definition: rtc_c.c:317
void RTC_C_startCounterPrescale(uint16_t baseAddress, uint8_t prescaleSelect)
Starts the selected Prescaler.
Definition: rtc_c.c:183
uint8_t DayOfWeek
Day of week between 0-6.
Definition: rtc_b.h:40
uint8_t RTC_C_getPrescaleValue(uint16_t baseAddress, uint8_t prescaleSelect)
Returns the selected prescaler value.
Definition: rtc_c.c:198
uint8_t Minutes
Minutes of hour between 0-59.
Definition: rtc_b.h:36
Calendar RTC_C_getCalendarTime(uint16_t baseAddress)
Returns the Calendar Time stored in the Calendar registers of the RTC.
Definition: rtc_c.c:103
uint8_t Month
Month between 0-11.
Definition: rtc_b.h:44
uint8_t DayOfMonth
Day of month between 1-31.
Definition: rtc_b.h:42
Used in the RTC_B_initCalendar() function as the CalendarTime parameter.
Definition: rtc_b.h:32
bool RTC_C_setTemperatureCompensation(uint16_t baseAddress, uint16_t offsetDirection, uint8_t offsetValue)
Sets the specified temperature compensation for the RTC.
Definition: rtc_c.c:64
void RTC_C_definePrescaleEvent(uint16_t baseAddress, uint8_t prescaleSelect, uint8_t prescaleEventDivider)
Sets up an interrupt condition for the selected Prescaler.
Definition: rtc_c.c:189
void RTC_C_initCounterPrescale(uint16_t baseAddress, uint8_t prescaleSelect, uint16_t prescaleClockSelect, uint16_t prescaleDivider)
Initializes the Prescaler for Counter mode.
Definition: rtc_c.c:167
void RTC_C_clearInterrupt(uint16_t baseAddress, uint8_t interruptFlagMask)
Clears selected RTC interrupt flags.
Definition: rtc_c.c:291
void RTC_C_startClock(uint16_t baseAddress)
Starts the RTC.
Definition: rtc_c.c:21
void RTC_C_initCalendar(uint16_t baseAddress, Calendar *CalendarTime, uint16_t formatSelect)
Initializes the settings to operate the RTC in calendar mode.
Definition: rtc_c.c:80
void RTC_C_setCalibrationFrequency(uint16_t baseAddress, uint16_t frequencySelect)
Allows and Sets the frequency output to RTCCLK pin for calibration measurement.
Definition: rtc_c.c:35
void RTC_C_enableInterrupt(uint16_t baseAddress, uint8_t interruptMask)
Enables selected RTC interrupt sources.
Definition: rtc_c.c:223
void RTC_C_disableInterrupt(uint16_t baseAddress, uint8_t interruptMask)
Disables selected RTC interrupt sources.
Definition: rtc_c.c:242
void RTC_C_setPrescaleValue(uint16_t baseAddress, uint8_t prescaleSelect, uint8_t prescaleCounterValue)
Sets the selected Prescaler value.
Definition: rtc_c.c:210
void RTC_C_holdCounterPrescale(uint16_t baseAddress, uint8_t prescaleSelect)
Holds the selected Prescaler.
Definition: rtc_c.c:177
void RTC_C_configureCalendarAlarm(uint16_t baseAddress, RTC_C_configureCalendarAlarmParam *param)
Sets and Enables the desired Calendar Alarm settings.
Definition: rtc_c.c:120
uint8_t Seconds
Seconds of minute between 0-59.
Definition: rtc_b.h:34