/* Get the current alarm time of specified alarm. 
Retrieves the current alarm time for the specified alarm. */
enum status_code rtc_calendar_get_alarm(struct rtc_module *const module, struct rtc_calendar_alarm_time *const alarm, const enum rtc_calendar_alarm alarm_index)
/* Get the current alarm time of specified alarm. 
Retrieves the current alarm time for the specified alarm. */
enum status_code rtc_calendar_get_alarm(struct rtc_module *const module, struct rtc_calendar_alarm_time *const alarm, const enum rtc_calendar_alarm alarm_index)
{
	Assert(module);
	Assert(module->hw);
	Rtc *const rtc_module = module->hw;
	if ((uint32_t)alarm_index > RTC_NUM_OF_ALARMS) {
		return STATUS_ERR_INVALID_ARG;
	}
	uint32_t register_value =
			rtc_module->MODE2.Mode2Alarm[alarm_index].ALARM.reg;
	rtc_calendar_register_value_to_time(module, register_value, &(alarm->time));
	alarm->mask = (enum rtc_calendar_alarm_mask)rtc_module->MODE2.Mode2Alarm[alarm_index].MASK.reg;
	return STATUS_OK;
}