Functions | |
void | RTC_B_startClock (uint16_t baseAddress) |
Starts the RTC. More... | |
void | RTC_B_holdClock (uint16_t baseAddress) |
Holds the RTC. More... | |
void | RTC_B_setCalibrationFrequency (uint16_t baseAddress, uint16_t frequencySelect) |
Allows and Sets the frequency output to RTCCLK pin for calibration measurement. More... | |
void | RTC_B_setCalibrationData (uint16_t baseAddress, uint8_t offsetDirection, uint8_t offsetValue) |
Sets the specified calibration for the RTC. More... | |
void | RTC_B_initCalendar (uint16_t baseAddress, Calendar *CalendarTime, uint16_t formatSelect) |
Initializes the settings to operate the RTC in calendar mode. More... | |
Calendar | RTC_B_getCalendarTime (uint16_t baseAddress) |
Returns the Calendar Time stored in the Calendar registers of the RTC. More... | |
void | RTC_B_configureCalendarAlarm (uint16_t baseAddress, RTC_B_configureCalendarAlarmParam *param) |
Sets and Enables the desired Calendar Alarm settings. More... | |
void | RTC_B_setCalendarEvent (uint16_t baseAddress, uint16_t eventSelect) |
Sets a single specified Calendar interrupt condition. More... | |
void | RTC_B_definePrescaleEvent (uint16_t baseAddress, uint8_t prescaleSelect, uint8_t prescaleEventDivider) |
Sets up an interrupt condition for the selected Prescaler. More... | |
uint8_t | RTC_B_getPrescaleValue (uint16_t baseAddress, uint8_t prescaleSelect) |
Returns the selected prescaler value. More... | |
void | RTC_B_setPrescaleValue (uint16_t baseAddress, uint8_t prescaleSelect, uint8_t prescaleCounterValue) |
Sets the selected prescaler value. More... | |
void | RTC_B_enableInterrupt (uint16_t baseAddress, uint8_t interruptMask) |
Enables selected RTC interrupt sources. More... | |
void | RTC_B_disableInterrupt (uint16_t baseAddress, uint8_t interruptMask) |
Disables selected RTC interrupt sources. More... | |
uint8_t | RTC_B_getInterruptStatus (uint16_t baseAddress, uint8_t interruptFlagMask) |
Returns the status of the selected interrupts flags. More... | |
void | RTC_B_clearInterrupt (uint16_t baseAddress, uint8_t interruptFlagMask) |
Clears selected RTC interrupt flags. More... | |
uint16_t | RTC_B_convertBCDToBinary (uint16_t baseAddress, uint16_t valueToConvert) |
Convert the given BCD value to binary format. More... | |
uint16_t | RTC_B_convertBinaryToBCD (uint16_t baseAddress, uint16_t valueToConvert) |
Convert the given binary value to BCD format. More... | |
void RTC_B_clearInterrupt | ( | uint16_t | baseAddress, |
uint8_t | interruptFlagMask | ||
) |
Clears selected RTC interrupt flags.
This function clears the RTC interrupt flag is cleared, so that it no longer asserts.
baseAddress | is the base address of the RTC_B module. |
interruptFlagMask | is a bit mask of the interrupt flags to be cleared. Mask value is the logical OR of any of the following:
|
void RTC_B_configureCalendarAlarm | ( | uint16_t | baseAddress, |
RTC_B_configureCalendarAlarmParam * | param | ||
) |
Sets and Enables the desired Calendar Alarm settings.
This function sets a Calendar interrupt condition to assert the RTCAIFG interrupt flag. The condition is a logical and of all of the parameters. For example if the minutes and hours alarm is set, then the interrupt will only assert when the minutes AND the hours change to the specified setting. Use the RTC_B_ALARM_OFF for any alarm settings that should not be apart of the alarm condition.
baseAddress | is the base address of the RTC_B module. |
param | is the pointer to struct for calendar alarm configuration. |
References RTC_B_configureCalendarAlarmParam::dayOfMonthAlarm, RTC_B_configureCalendarAlarmParam::dayOfWeekAlarm, RTC_B_configureCalendarAlarmParam::hoursAlarm, and RTC_B_configureCalendarAlarmParam::minutesAlarm.
uint16_t RTC_B_convertBCDToBinary | ( | uint16_t | baseAddress, |
uint16_t | valueToConvert | ||
) |
Convert the given BCD value to binary format.
This function converts BCD values to binary format. This API uses the hardware registers to perform the conversion rather than a software method.
baseAddress | is the base address of the RTC_B module. |
valueToConvert | is the raw value in BCD format to convert to Binary. Modified bits are BCD2BIN of BCD2BIN register. |
uint16_t RTC_B_convertBinaryToBCD | ( | uint16_t | baseAddress, |
uint16_t | valueToConvert | ||
) |
Convert the given binary value to BCD format.
This function converts binary values to BCD format. This API uses the hardware registers to perform the conversion rather than a software method.
baseAddress | is the base address of the RTC_B module. |
valueToConvert | is the raw value in Binary format to convert to BCD. Modified bits are BIN2BCD of BIN2BCD register. |
void RTC_B_definePrescaleEvent | ( | uint16_t | baseAddress, |
uint8_t | prescaleSelect, | ||
uint8_t | prescaleEventDivider | ||
) |
Sets up an interrupt condition for the selected Prescaler.
This function sets the condition for an interrupt to assert based on the individual prescalers.
baseAddress | is the base address of the RTC_B module. |
prescaleSelect | is the prescaler to define an interrupt for. Valid values are:
|
prescaleEventDivider | is a divider to specify when an interrupt can occur based on the clock source of the selected prescaler. (Does not affect timer of the selected prescaler). Valid values are:
|
void RTC_B_disableInterrupt | ( | uint16_t | baseAddress, |
uint8_t | interruptMask | ||
) |
Disables selected RTC interrupt sources.
This function disables the selected RTC interrupt source. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
baseAddress | is the base address of the RTC_B module. |
interruptMask | is a bit mask of the interrupts to disable. Mask value is the logical OR of any of the following:
|
void RTC_B_enableInterrupt | ( | uint16_t | baseAddress, |
uint8_t | interruptMask | ||
) |
Enables selected RTC interrupt sources.
This function enables the selected RTC interrupt source. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor. Does not clear interrupt flags.
baseAddress | is the base address of the RTC_B module. |
interruptMask | is a bit mask of the interrupts to enable. Mask value is the logical OR of any of the following:
|
Calendar RTC_B_getCalendarTime | ( | uint16_t | baseAddress | ) |
Returns the Calendar Time stored in the Calendar registers of the RTC.
This function returns the current Calendar time in the form of a Calendar structure. The RTCRDY polling is used in this function to prevent reading invalid time.
baseAddress | is the base address of the RTC_B module. |
References Calendar::DayOfMonth, Calendar::DayOfWeek, Calendar::Hours, Calendar::Minutes, Calendar::Month, Calendar::Seconds, and Calendar::Year.
uint8_t RTC_B_getInterruptStatus | ( | uint16_t | baseAddress, |
uint8_t | interruptFlagMask | ||
) |
Returns the status of the selected interrupts flags.
This function returns the status of the interrupt flag for the selected channel.
baseAddress | is the base address of the RTC_B module. |
interruptFlagMask | is a bit mask of the interrupt flags to return the status of. Mask value is the logical OR of any of the following:
|
uint8_t RTC_B_getPrescaleValue | ( | uint16_t | baseAddress, |
uint8_t | prescaleSelect | ||
) |
Returns the selected prescaler value.
This function returns the value of the selected prescale counter register. Note that the counter value should be held by calling RTC_B_holdClock() before calling this API.
baseAddress | is the base address of the RTC_B module. |
prescaleSelect | is the prescaler to obtain the value of. Valid values are:
|
void RTC_B_holdClock | ( | uint16_t | baseAddress | ) |
Holds the RTC.
This function sets the RTC main hold bit to disable RTC functionality.
baseAddress | is the base address of the RTC_B module. |
void RTC_B_initCalendar | ( | uint16_t | baseAddress, |
Calendar * | CalendarTime, | ||
uint16_t | formatSelect | ||
) |
Initializes the settings to operate the RTC in calendar mode.
This function initializes the Calendar mode of the RTC module. To prevent potential erroneous alarm conditions from occurring, the alarm should be disabled by clearing the RTCAIE, RTCAIFG and AE bits with APIs: RTC_B_disableInterrupt(), RTC_B_clearInterrupt() and RTC_B_configureCalendarAlarm() before calendar initialization.
baseAddress | is the base address of the RTC_B module. |
CalendarTime | is the pointer to the structure containing the values for the Calendar to be initialized to. Valid values should be of type pointer to Calendar and should contain the following members and corresponding values: Seconds between 0-59 Minutes between 0-59 Hours between 0-23 DayOfWeek between 0-6 DayOfMonth between 1-31 Year between 0-4095 NOTE: Values beyond the ones specified may result in erratic behavior. |
formatSelect | is the format for the Calendar registers to use. Valid values are:
|
References Calendar::DayOfMonth, Calendar::DayOfWeek, Calendar::Hours, Calendar::Minutes, Calendar::Month, Calendar::Seconds, and Calendar::Year.
void RTC_B_setCalendarEvent | ( | uint16_t | baseAddress, |
uint16_t | eventSelect | ||
) |
Sets a single specified Calendar interrupt condition.
This function sets a specified event to assert the RTCTEVIFG interrupt. This interrupt is independent from the Calendar alarm interrupt.
baseAddress | is the base address of the RTC_B module. |
eventSelect | is the condition selected. Valid values are:
|
void RTC_B_setCalibrationData | ( | uint16_t | baseAddress, |
uint8_t | offsetDirection, | ||
uint8_t | offsetValue | ||
) |
Sets the specified calibration for the RTC.
This function sets the calibration offset to make the RTC as accurate as possible. The offsetDirection can be either +4-ppm or -2-ppm, and the offsetValue should be from 1-63 and is multiplied by the direction setting (i.e. +4-ppm * 8 (offsetValue) = +32-ppm). Please note, when measuring the frequency after setting the calibration, you will only see a change on the 1Hz frequency.
baseAddress | is the base address of the RTC_B module. |
offsetDirection | is the direction that the calibration offset will go. Valid values are:
|
offsetValue | is the value that the offset will be a factor of; a valid value is any integer from 1-63. Modified bits are RTCCAL of RTCCTL2 register. |
void RTC_B_setCalibrationFrequency | ( | uint16_t | baseAddress, |
uint16_t | frequencySelect | ||
) |
Allows and Sets the frequency output to RTCCLK pin for calibration measurement.
This function sets a frequency to measure at the RTCCLK output pin. After testing the set frequency, the calibration could be set accordingly.
baseAddress | is the base address of the RTC_B module. |
frequencySelect | is the frequency output to RTCCLK. Valid values are:
|
void RTC_B_setPrescaleValue | ( | uint16_t | baseAddress, |
uint8_t | prescaleSelect, | ||
uint8_t | prescaleCounterValue | ||
) |
Sets the selected prescaler value.
This function sets the prescale counter value. Before setting the prescale counter, it should be held by calling RTC_B_holdClock().
baseAddress | is the base address of the RTC_B module. |
prescaleSelect | is the prescaler to set the value for. Valid values are:
|
prescaleCounterValue | is the specified value to set the prescaler to. Valid values are any integer between 0-255 Modified bits are RTxPS of RTxPS register. |
void RTC_B_startClock | ( | uint16_t | baseAddress | ) |
Starts the RTC.
This function clears the RTC main hold bit to allow the RTC to function.
baseAddress | is the base address of the RTC_B module. |