 |
AM62x MCU+ SDK
10.01.00
|
|
Go to the documentation of this file.
59 #include <drivers/hw_include/cslr_rtc.h>
70 #define OSCILLATOR_FREQ_HZ ((uint32_t) 32768U)
73 #define RTC_FREEZE_MODE ((uint32_t) 0x02000000U)
76 #define O32K_OSC_DEP_EN_MASK (CSL_RTC_GENRAL_CTL_O32K_OSC_DEP_EN_MASK)
79 #define RD_PEND_MASK (CSL_RTC_SYNCPEND_RD_PEND_MASK)
81 #define WR_PEND_MASK (CSL_RTC_SYNCPEND_WR_PEND_MASK)
84 #define O32K_CLK_OBS_BIT_MASK (CSL_RTC_SYNCPEND_O32K_CLK_OBS_MASK)
87 #define RTC_SW_OFF_MASK (CSL_RTC_GENRAL_CTL_SW_OFF_MASK)
90 #define RTC_UNLOCK_MASK (CSL_RTC_GENRAL_CTL_UNLOCK_MASK)
93 #define OSC_LOCK_WAIT (3U)
96 #define KICK0_UNLOCK_VALUE (uint32_t)0x83E70B13U
97 #define KICK1_UNLOCK_VALUE (uint32_t)0x95A4F1E0U
100 #define KICK0_LOCK_VALUE (CSL_RTC_KICK0_RESETVAL)
101 #define KICK1_LOCK_VALUE (CSL_RTC_KICK1_RESETVAL)
104 #define RTC_BASEADDR (uint32_t)0x2B1F0000U
113 #define RTC_TMR_INT_INT0_STATUS_FLAG (CSL_RTC_IRQSTATUS_SYS_EVENT_ON_OFF_MASK)
115 #define RTC_TMR_INT_INT1_STATUS_FLAG (CSL_RTC_IRQSTATUS_SYS_EVENT_OFF_ON_MASK)
118 #define RTC_TMR_INT_INT0_CLEAR_FLAG (CSL_RTC_IRQENABLE_CLR_SYS_EN_EVENT_ON_OFF_MASK)
120 #define RTC_TMR_INT_INT1_CLEAR_FLAG (CSL_RTC_IRQENABLE_CLR_SYS_EN_EVENT_OFF_ON_MASK)
123 #define RTC_TMR_INT_INT0_SET_FLAG (CSL_RTC_IRQENABLE_SET_SYS_EN_EVENT_ON_OFF_MASK)
125 #define RTC_TMR_INT_INT1_SET_FLAG (CSL_RTC_IRQENABLE_SET_SYS_EN_EVENT_OFF_ON_MASK)
128 #define RTC_TMR_INT_INT0_RAW_STATUS_FLAG (CSL_RTC_IRQSTATUS_RAW_SYS_EVENT_ON_OFF_MASK)
130 #define RTC_TMR_INT_INT1_RAW_STATUS_FLAG (CSL_RTC_IRQSTATUS_RAW_SYS_EVENT_OFF_ON_MASK)
133 #define RTC_TMR_INT_STATUS_ALL (RTC_TMR_INT_INT0_STATUS_FLAG | \
134 RTC_TMR_INT_INT1_STATUS_FLAG)
136 #define RTC_TMR_INT_CLEAR_ALL (RTC_TMR_INT_INT0_CLEAR_FLAG | \
137 RTC_TMR_INT_INT1_CLEAR_FLAG)
139 #define RTC_TMR_INT_REQ_ALL (RTC_TMR_INT_INT0_SET_FLAG | \
140 RTC_TMR_INT_INT1_SET_FLAG)
142 #define RTC_TMR_INT_RAW_STATUS_ALL (RTC_TMR_INT_INT0_RAW_STATUS_FLAG | \
143 RTC_TMR_INT_INT1_RAW_STATUS_FLAG)
186 typedef struct RTC_HwAttrs_s
210 typedef struct RTC_Params_s
225 typedef struct RTC_Object_s
256 typedef struct RTC_Config_s
267 typedef struct RTC_Time_s
int32_t RTC_start(RTC_Handle handle)
Start the RTC after it's stopped.
uint32_t baseAddr
Definition: rtc/v0/rtc.h:190
void RTC_close(RTC_Handle handle)
Function to close the RTC Peripheral specified by the handle.
void(* RTC_OffOnCallbackFxn)(RTC_Handle handle)
The definition of a OFF_ON callback function used by the RTC driver.
Definition: rtc/v0/rtc.h:177
int32_t RTC_stop(RTC_Handle handle)
Stop the RTC.
uint32_t inputClk
Definition: rtc/v0/rtc.h:196
bool offOnCallback
Definition: rtc/v0/rtc.h:218
int32_t RTC_setOn_OffTimerEvent(RTC_Handle handle, const RTC_Time *rtc_time)
Set the on-off timer event / Use as timer 2 for RTC.
void RTC_paramsInit(RTC_Params *params)
Function to set default values of RTC_Params in params.
uint32_t isfreezemode
Definition: rtc/v0/rtc.h:214
RTC Hardware attributes.
Definition: rtc/v0/rtc.h:187
uint32_t day
Definition: rtc/v0/rtc.h:276
uint32_t minute
Definition: rtc/v0/rtc.h:272
RTC Parameters.
Definition: rtc/v0/rtc.h:211
SemaphoreP_Object mutex
Definition: rtc/v0/rtc.h:228
uint32_t year
Definition: rtc/v0/rtc.h:280
uint16_t eventId
Definition: rtc/v0/rtc.h:194
uint32_t intNum
Definition: rtc/v0/rtc.h:192
RTC driver object.
Definition: rtc/v0/rtc.h:226
struct RTC_Config_s * RTC_Handle
A handle that is returned from a RTC_open() call.
Definition: rtc/v0/rtc.h:153
int32_t RTC_getTime(RTC_Handle handle, RTC_Time *rtc_time)
Get the current RTC time.
RTC_Params RTC_params
Definition: rtc/v0/rtc.h:234
RTC_Handle RTC_open(uint32_t idx, const RTC_Params *params)
Open the RTC at index idx with parameters params.
uint32_t value
Definition: tisci_otp_revision.h:2
RTC Time Structure.
Definition: rtc/v0/rtc.h:268
RTC_OffOnCallbackFxn Off_OnCallbackFunction
Definition: rtc/v0/rtc.h:243
void RTC_erratumi2327Init(void)
RTC Erratum i2327 Workaround.
uint32_t hour
Definition: rtc/v0/rtc.h:274
uint32_t second
Definition: rtc/v0/rtc.h:270
RTC_OnOffCallbackFxn On_OffCallbackFunction
Definition: rtc/v0/rtc.h:241
bool isOpen
Definition: rtc/v0/rtc.h:232
HwiP_Object hwiObj
Definition: rtc/v0/rtc.h:230
RTC_Object * object
Definition: rtc/v0/rtc.h:259
bool enableIntr
Definition: rtc/v0/rtc.h:198
RTC_Time RTC_calculateElapsedTime(const RTC_Time *startTime, const RTC_Time *endTime)
Calculate Elapsed Time.
uint8_t intrPriority
Definition: rtc/v0/rtc.h:200
int32_t RTC_setOff_OnTimerEvent(RTC_Handle handle, const RTC_Time *rtc_time)
Set the off-on timer event / Use as timer 1 for RTC.
void(* RTC_OnOffCallbackFxn)(RTC_Handle handle)
The definition of a ON_OFF callback function used by the RTC driver.
Definition: rtc/v0/rtc.h:167
void RTC_deinit(void)
De-initialize the RTC module.
uint32_t RTC_readScratchRegister(RTC_Handle handle, uint32_t scratchIndex)
Read a value from a specific RTC scratch register.
RTC_HwAttrs const * hwAttrs
Definition: rtc/v0/rtc.h:261
Opaque Hwi object used with the Hwi APIs.
Definition: HwiP.h:93
RTC Global Configuration.
Definition: rtc/v0/rtc.h:257
void RTC_init(void)
Initialize the RTC module.
Opaque semaphore object used with the semaphore APIs.
Definition: SemaphoreP.h:59
bool onOffCallback
Definition: rtc/v0/rtc.h:216
int32_t RTC_adjustForDrift(RTC_Handle handle, Float32 measuredDriftInSeconds)
Calculate Elapsed Time.
uint32_t month
Definition: rtc/v0/rtc.h:278
int32_t RTC_setTime(RTC_Handle handle, const RTC_Time *rtc_time)
Set the RTC time.
int32_t RTC_writeScratchRegister(RTC_Handle handle, uint32_t scratchIndex, uint32_t value)
Write a value to a specific RTC scratch register.