The RTC APIs provide a set of functions for using the Quessence™ Real time clock modules. Functions are provided to configure and control the RTC modules and to configure and retrieve the time.

RSI_RTC_Init:

Prototype
void RSI_RTC_Init(MCU_Calendar_t   *Cal)
Input Arguments Cal : pointer to the rtc register instance
Return Value None
Description This API is used to init the rtc block
Example Usage RSI_RTC_Init(RTC);

 

RSI_RTC_Start:

Prototype
void RSI_RTC_Start(MCU_RTC_t *Cal
Input Arguments Cal :pointer to the rtc register instance
Return Value None
Description This API is used to init the rtc block
Example Usage RSI_RTC_Start(RTC);

 

RSI_RTC_SetDateTime:

Prototype
error_t RSI_RTC_SetDateTime(MCU_RTC_t *Cal , RTC_TIME_CONFIG_T *date)
Input Arguments

Cal   : pointer to the rtc register instance

date  : pointer to the rtc configuration structure

Return Value Non zero on success and error code on failure
Description This API is used to set the rtc configuration
Example Usage     RSI_RTC_SetDateTime(RTC ,&rtcConfig);

 

RSI_RTC_IntrUnMask:

Prototype
void RSI_RTC_IntrUnMask(uint32_t intr)
Input Arguments

intr  : value of interrupt to be enabled/Un-mask

RTC_MSEC_INTR  : Use this macro to enable msec interrupt

RTC_SEC_INTR   : Use this macro to enable sec interrupt

RTC_ALARM_INTR : Use this macro to enable alarm interrupt

Return Value None
Description This API is used to init the rtc block
Example Usage RSI_RTC_IntrUnMask( RTC_SEC_INTR | RTC_MSEC_INTR);


RSI_RTC_SetAlarmDateTime:

Prototype
error_t RSI_RTC_SetAlarmDateTime(MCU_RTC_t *Cal , RTC_TIME_CONFIG_T *alarm)
Input Arguments

Cal   : pointer to the rtc register instance

alarm : pointer to alarm configuration structure
Return Value None
Description This API is used to Set the alarm for RTC module
Example Usage
RSI_RTC_SetAlarmDateTime(CALENDER , &alarmConfig);

 

RSI_RTC_GetAlarmDateTime:

Prototype
error_t RSI_RTC_GetAlarmDateTime(MCU_RTC_t *Cal , RTC_TIME_CONFIG_T *alarm)
Input Arguments

Cal   : pointer to the rtc register instance

alarm : pointer to alarm configuration structure
Return Value None
Description This API is used to Get alarm configurations for RTC
Example Usage
RSI_RTC_GetAlarmDateTime(CALENDAR , &readAlarmConfig);

 

RSI_RTC_GetDateTime:

Prototype
error_t RSI_RTC_GetDateTime(MCU_RTC_t *Cal ,  RTC_TIME_CONFIG_T *date)
Input Arguments

Cal   : pointer to the rtc register instance

date : pointer to the rtc structure to hold the current time parameters
Return Value None
Description This API is used to Get the RTC time
Example Usage
RSI_RTC_GetDateTime(CALENDAR , &readTime);

 

RSI_RTC_Stop:

 

Prototype
void RSI_RTC_Stop(MCU_RTC_t *Cal)
Input Arguments

Cal   : pointer to the rtc register instance

Return Value None
Description This API is used to stop the rtc operation
Example Usage
RSI_RTC_Stop(CALENDAR);

 

RSI_RTC_AlamEnable:

Prototype
void RSI_RTC_AlamEnable(MCU_RTC_t *Cal , boolean_t val)
Input Arguments

Cal   : pointer to the rtc register instance

val    : to enable or disable the alarm
Return Value None
Description This API is used to Enable alarm in RTC
Example Usage
RSI_RTC_AlamEnable(CALENDAR ,ENABLE);