AM62x MCU+ SDK  10.01.00
RTC

The basic purpose for the RTC is to keep time of day. The other equally important purpose of RTC is for Digital Rights management. Some degree of tamper proofing is needed to ensure that simply stopping, resetting, or corrupting the RTC does not go unnoticed so that if this occurs, the application can re-acquire the time of day from a trusted source.

Features Supported

  • Supported 15 bit 32768Hz counter.
  • Supported 48 bit seconds counter with +/- 1 30uS upto +/- 1 S drift adjustment every 4048 Seconds.
  • Support for 256 bits of Scratch PAD
  • 1 ON_OFF compare event, 48-bits
  • 1 OFF_ON compare event, 48-bits
  • 2 event outputs OFF_ON and ON_OFF to CORE
  • Functional lockout, unlock by special vbusp sequence
  • HOST PROCESSOR can update MMRs without polling, thanks to HW Shadow/Auto Sync
  • HOST PROCESSOR can read time without polling, thanks to HW Shadow/Auto Sync

SysConfig Features

Note
It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.
  • RTC instance name
  • Input clock frequency to be used for RTC module
  • Enable Freeze Mode for RTC.
  • Enable Interrupt and Assign User Callback
  • Support to attach callback functions to each of the ON_OFF/OFF_ON events

Features NOT Supported

  • PMIC enable support

Example Usage

Include the below file to access the APIs

#include <drivers/rtc.h>

Instance Open Example

RTC_Params params;
/* Initialize parameters */
RTC_Params_init(&params);
params.isfreezemode = true,
params.onOffCallback = false,
params.offOnCallback = false,
/* Update object Parameters mode settings */
gRTCObjects[CONFIG_RTC0].On_OffCallbackFunction = NULL,
gRTCObjects[CONFIG_RTC0].Off_OnCallbackFunction = NULL,
gRTCHandle = RTC_open(CONFIG_RTC0, &params);
DebugP_assert(gRTCHandle != NULL);

Instance Close Example

RTC_close(gRTCHandle);

API

APIs for RTC

RTC_close
void RTC_close(RTC_Handle handle)
Function to close the RTC Peripheral specified by the handle.
RTC_Params::offOnCallback
bool offOnCallback
Definition: rtc/v0/rtc.h:218
RTC_Params::isfreezemode
uint32_t isfreezemode
Definition: rtc/v0/rtc.h:214
NULL
#define NULL
Define NULL if not defined.
Definition: csl_types.h:100
RTC_Params
RTC Parameters.
Definition: rtc/v0/rtc.h:211
RTC_open
RTC_Handle RTC_open(uint32_t idx, const RTC_Params *params)
Open the RTC at index idx with parameters params.
RTC_Params::onOffCallback
bool onOffCallback
Definition: rtc/v0/rtc.h:216
rtc.h
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:175