7 #ifndef __MSP430WARE_RTC_C_H__ 8 #define __MSP430WARE_RTC_C_H__ 10 #include "inc/hw_memmap.h" 12 #if defined(__MSP430_HAS_RTC_C__) || defined(__MSP430_HAS_RTC_CE__) 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);
392 uint16_t formatSelect);
451 uint16_t eventSelect);
482 uint32_t counterValue);
522 uint8_t prescaleSelect,
523 uint16_t prescaleClockSelect,
524 uint16_t prescaleDivider);
546 uint8_t prescaleSelect);
565 uint8_t prescaleSelect);
597 uint8_t prescaleSelect,
598 uint8_t prescaleEventDivider);
618 uint8_t prescaleSelect);
640 uint8_t prescaleSelect,
641 uint8_t prescaleCounterValue);
672 uint8_t interruptMask);
703 uint8_t interruptMask);
748 uint8_t interruptFlagMask);
779 uint8_t interruptFlagMask);
796 uint16_t valueToConvert);
813 uint16_t valueToConvert);
825 #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:155
uint8_t Hours
Hour of day between 0-23.
Definition: rtc_a.h:63
void RTC_C_setCalendarEvent(uint16_t baseAddress, uint16_t eventSelect)
Sets a single specified Calendar interrupt condition.
Definition: rtc_c.c:134
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:270
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:143
uint16_t RTC_C_convertBinaryToBCD(uint16_t baseAddress, uint16_t valueToConvert)
Convert the given binary value to BCD format.
Definition: rtc_c.c:332
uint16_t Year
Year between 0-4095.
Definition: rtc_a.h:71
uint16_t RTC_C_convertBCDToBinary(uint16_t baseAddress, uint16_t valueToConvert)
Convert the given BCD value to binary format.
Definition: rtc_c.c:325
void RTC_C_startCounterPrescale(uint16_t baseAddress, uint8_t prescaleSelect)
Starts the selected Prescaler.
Definition: rtc_c.c:191
uint8_t DayOfWeek
Day of week between 0-6.
Definition: rtc_a.h:65
uint8_t RTC_C_getPrescaleValue(uint16_t baseAddress, uint8_t prescaleSelect)
Returns the selected prescaler value.
Definition: rtc_c.c:206
uint8_t Minutes
Minutes of hour between 0-59.
Definition: rtc_a.h:61
Calendar RTC_C_getCalendarTime(uint16_t baseAddress)
Returns the Calendar Time stored in the Calendar registers of the RTC.
Definition: rtc_c.c:107
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
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:68
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:197
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:171
void RTC_C_clearInterrupt(uint16_t baseAddress, uint8_t interruptFlagMask)
Clears selected RTC interrupt flags.
Definition: rtc_c.c:299
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:84
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:231
void RTC_C_disableInterrupt(uint16_t baseAddress, uint8_t interruptMask)
Disables selected RTC interrupt sources.
Definition: rtc_c.c:250
void RTC_C_setPrescaleValue(uint16_t baseAddress, uint8_t prescaleSelect, uint8_t prescaleCounterValue)
Sets the selected Prescaler value.
Definition: rtc_c.c:218
void RTC_C_holdCounterPrescale(uint16_t baseAddress, uint8_t prescaleSelect)
Holds the selected Prescaler.
Definition: rtc_c.c:185
void RTC_C_configureCalendarAlarm(uint16_t baseAddress, RTC_C_configureCalendarAlarmParam *param)
Sets and Enables the desired Calendar Alarm settings.
Definition: rtc_c.c:124
uint8_t Seconds
Seconds of minute between 0-59.
Definition: rtc_a.h:59