2.93 Real-time Clock (RTC)

This Plib implements software abstraction for RTC Peripheral.

Library Interface

Real-time Clock peripheral library provides the following interfaces:

Functions

NameDescription
RTC_InitializeInitializes given instance of the RTC peripheral
RTC_TimeSetSets the Time for the RTC peripheral
RTC_TimeGetReads the current time
RTC_AlarmSetSets up the Alarm
RTC_FirstTimeStampGetReads the timestamp for first occurrence of given tamper input
RTC_LastTimeStampGetReads the timestamp for last occurrence of given tamper input
RTC_InterruptDisableDisables the specified RTC interrupt
RTC_InterruptEnableEnables the specified RTC interrupt
RTC_FrequencyCorrectCalibrate for too-slow or too-fast oscillator
RTC_Timer16CounterHasOverflowedChecks if the 16-bit counter has overflowed
RTC_Timer16Compare0HasMatchedReturns true if the 16-bit Timer Compare 0 value has matched the counter
RTC_Timer16Compare1HasMatchedReturns true if the 16-bit Timer Compare 1 value has matched the counter
RTC_Timer16Compare2HasMatchedReturns true if the 16-bit Timer Compare 2 value has matched the counter
RTC_Timer16Compare3HasMatchedReturns true if the 16-bit Timer Compare 3 value has matched the counter
RTC_Timer16StartStarts the 16-bit timer
RTC_Timer16StopStops the 16-bit timer from counting
RTC_Timer16CounterSetSet the 16-bit Timer Counter Value
RTC_Timer16PeriodSetSet the 16-bit timer period value
RTC_Timer16PeriodGetGet 16-bit timer period Value
RTC_Timer16CounterGetGet the current 16-bit counter value
RTC_Timer16FrequencyGetReturns the frequency at which the 16-bit timer counter is operating
RTC_Timer16InterruptEnableEnable Selected RTC interrupt
RTC_Timer16InterruptDisableDisable Selected RTC Interrupt
RTC_Timer16Compare0SetSet the 16-Bit Counter Compare 0 Value
RTC_Timer16Compare1SetSet the 16-Bit Counter Compare 1 Value
RTC_Timer16Compare2SetSet the 16-Bit Counter Compare 2 Value
RTC_Timer16Compare3SetSet the 16-Bit Counter Compare 3 Value
RTC_Timer16TimeStampGetGet the Time stamp of Tamper Detection
RTC_Timer16CallbackRegisterRegister the callback function to be called when an 16-bit Timer Interrupt occurs
RTC_Timer32CompareHasMatchedCheck for 32-bit Timer Compare match
RTC_Timer32Compare0HasMatchedCheck for 32-bit Timer Compare match
RTC_Timer32Compare1HasMatchedCheck for 32-bit Timer Compare match
RTC_Timer32CounterHasOverflowedCheck if the 32-bit counter overflow
RTC_Timer32StartStarts the 32-bit timer
RTC_Timer32StopStops the 32-bit timer from counting
RTC_Timer32CounterSetSet the 32-bit Timer Counter Value
RTC_Timer32CompareSetSet the 32-bit timer period value
RTC_Timer32Compare0SetSet the 32-bit timer period value
RTC_Timer32Compare1SetSet the 32-bit timer period value
RTC_Timer32PeriodGetGet 32-bit timer period Value
RTC_Timer32CounterGetGet the current 32-bit counter value
RTC_Timer32FrequencyGetReturns the frequency at which the 32-bit timer counter is operating
RTC_Timer32InterruptEnableEnable selected RTC interrupt
RTC_Timer32InterruptDisableDisable selected RTC interrupt
RTC_Timer32CallbackRegisterRegister the callback function to be called when an 32-bit Timer Interrupt occurs
RTC_Timer32TimeStampGetGet the Time stamp of Tamper Detection
RTC_PeriodicIntervalHasCompletedCheck if the configured periodic interval has expired
RTC_RTCCTimeGetGets the current time and date
RTC_RTCCTimeSetSets the Real Time Clock Calendar time and date
RTC_RTCCAlarmSetSet an alarm
RTC_RTCCCallbackRegisterRegister the callback function to be called when an RTCC Interrupt occurs
RTC_BackupRegisterSetSet the value for the selected Backup Register
RTC_BackupRegisterGetGet the value stored in the selected Backup Register
RTC_TamperSourceGetGet the Tamper source
RTC_RTCCTimeStampGetGet the Time stamp of Tamper Detection
RTC_CallbackRegisterSets the pointer to the function (and it's context) to be called when the Timeout events occur

Data types and constants

NameTypeDescription
RTC_ALARM_MASKEnumDefines the data type for the RTC Alarm Mask
RTC_INT_MASKEnumDefines the Interrupt mask for RTC events
RTC_TAMP_INPUTEnumDefines the Tamper input
RTC_TIMER16_INT_MASKEnumPossible RTC 16-bit Timer Counter Mode Events
RTC_TIMER16_CALLBACKTypedefDefines the data type and function signature of the RTC 16-bit Timer Counter callback function
RTC_TIMER32_INT_MASKEnumPossible RTC 32-bit Timer Counter Mode Events
RTC_TIMER32_CALLBACKTypedefDefines the data type and function signature of the RTC 32-bit Timer Counter callback function
RTC_PERIODIC_INT_MASKEnumPossible Periodic Interrupt Mask
RTC_CLOCK_EVENTEnumPossible RTC RTCC Mode Events
BACKUP_REGISTEREnumPossible Backup Register Mask
TAMPER_CHANNELEnumPossible Tamper Channel Mask
RTC_CLOCK_INT_MASKEnumPossible RTC Clock Mode Events
RTC_CALLBACKTypedefDefines the data type and function signature for the RTC peripheral callback function
Note: Not all APIs maybe implemented. See the specific device family section for available APIs.