36 #define SECONDS_IN_A_DAY (86400UL)
37 #define SECONDS_IN_A_HOUR (3600U)
38 #define SECONDS_IN_A_MIN (60U)
39 #define MINS_IN_A_HOUR (60U)
40 #define HOURS_IN_A_DAY (24U)
41 #define DAYS_IN_A_YEAR (365U)
42 #define DAYS_IN_A_LEAP_YEAR (366U)
43 #define YEAR_RANGE_START (1970U)
44 #define YEAR_RANGE_END (2099U)
134 void (* alarmCallback)(
void * callbackParam);
147 void (* rtcCallback)(
void * callbackParam);
159 void (* rtcSecondsCallback)(
void * callbackParam);
179 #if defined(__cplusplus)
422 #if defined(__cplusplus)
rtc_interrupt_config_t * intConfig
bool nonSupervisorAccessEnable
RTC Initialization structure Implements : rtc_init_config_t_Class.
bool timeInvalidIntEnable
status_t RTC_DRV_StartCounter(uint32_t instance)
Start RTC instance counter. Before calling this function the user should use RTC_DRV_SetTimeDate to c...
status_t RTC_DRV_StopCounter(uint32_t instance)
Disable RTC instance counter.
RTC interrupt configuration. It is used to configure interrupt other than Time Alarm and Time Seconds...
status_t RTC_DRV_ConfigureRegisterLock(uint32_t instance, const rtc_register_lock_config_t *const lockConfig)
This method configures register lock for the corresponding RTC instance. Remember that all the regist...
void RTC_DRV_GetTimeCompensation(uint32_t instance, uint8_t *compInterval, int8_t *compensation)
This retrieves the time compensation coefficients and saves them on the variables referenced by the p...
status_t RTC_DRV_GetCurrentTimeDate(uint32_t instance, rtc_timedate_t *const currentTime)
Get current time and date from RTC instance.
void RTC_DRV_GetAlarmConfig(uint32_t instance, rtc_alarm_config_t *alarmConfig)
Get alarm configuration for RTC instance.
status_t RTC_DRV_Init(uint32_t instance, const rtc_init_config_t *const rtcUserCfg)
This function initializes the RTC instance with the settings provided by the user via the rtcUserCfg ...
void RTC_DRV_ConvertSecondsToTimeDate(const uint32_t *seconds, rtc_timedate_t *const timeDate)
Convert seconds to rtc_timedate_t structure.
RTC alarm configuration Implements : rtc_alarm_config_t_Class.
rtc_alarm_config_t * alarmConfig
rtc_lock_register_select_t
RTC register lock Implements : rtc_lock_register_select_t_Class.
bool RTC_DRV_IsTimeDateCorrectFormat(const rtc_timedate_t *const timeDate)
Check if the date time struct is configured properly.
status_t RTC_DRV_ConfigureTimeCompensation(uint32_t instance, uint8_t compInterval, int8_t compensation)
This method configures time compensation. Data is passed by the compInterval and compensation paramet...
RTC Seconds Interrupt Configuration Implements : rtc_seconds_int_config_t_Class.
rtc_clk_out_config_t clockOutConfig
RTC Register Lock Configuration Implements : rtc_register_lock_config_t_Class.
rtc_second_int_cfg_t
RTC Seconds interrupt configuration Implements : rtc_second_int_cfg_t_Class.
void RTC_DRV_SecondsIRQHandler(uint32_t instance)
This method is the API's Interrupt handler for RTC Second interrupt. This ISR will call the user call...
status_t RTC_DRV_GetNextAlarmTime(uint32_t instance, rtc_timedate_t *const alarmTime)
Gets the next alarm time.
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
uint8_t compensationInterval
uint32_t repetitionInterval
void RTC_DRV_ConfigureFaultInt(uint32_t instance, rtc_interrupt_config_t *const intConfig)
This method configures fault interrupts such as:
void RTC_DRV_ConfigureSecondsInt(uint32_t instance, rtc_seconds_int_config_t *const intConfig)
This method configures the Time Seconds Interrupt with the configuration from the intConfig parameter...
bool RTC_DRV_IsYearLeap(uint16_t year)
Check if the current year is leap.
rtc_second_int_cfg_t secondIntConfig
void RTC_DRV_GetRegisterLock(uint32_t instance, rtc_register_lock_config_t *const lockConfig)
Get which registers are locked for RTC instance.
bool RTC_DRV_IsAlarmPending(uint32_t instance)
Check if alarm is pending.
void RTC_DRV_IRQHandler(uint32_t instance)
This method is the API's Interrupt handler for generic and alarm IRQ. It will handle the alarm repeti...
void * secondsCallbackParams
RTC Time Date structure Implements : rtc_timedate_t_Class.
rtc_clk_select_t clockSelect
void RTC_DRV_GetDefaultConfig(rtc_init_config_t *const config)
This function will set the default configuration values into the structure passed as a parameter...
status_t RTC_DRV_Deinit(uint32_t instance)
This function deinitializes the RTC instance. If the Control register is locked then this method retu...
status_t RTC_DRV_ConfigureAlarm(uint32_t instance, rtc_alarm_config_t *const alarmConfig)
This method configures the alarm with the configuration from the alarmConfig parameter.
rtc_clk_select_t
RTC clock select Implements : rtc_clk_select_t_Class.
bool timeCompensationRegisterLock
status_t RTC_DRV_SetTimeDate(uint32_t instance, const rtc_timedate_t *const time)
Set time and date for RTC instance. The user must stop the counter before using this function...
void RTC_DRV_ConvertTimeDateToSeconds(const rtc_timedate_t *const timeDate, uint32_t *const seconds)
Convert seconds to rtc_timedate_t structure.
rtc_clk_out_config_t
RTC CLKOUT pin configuration Implements : rtc_clk_out_config_t_Class.