/* Initializes the RTC module with given configurations. 
Initializes the module, setting up all given configurations to provide the desired functionality of the RTC. */
enum status_code rtc_count_init(struct rtc_module *const module, Rtc *const hw, const struct rtc_count_config *const config)
/* Initializes the RTC module with given configurations. 
Initializes the module, setting up all given configurations to provide the desired functionality of the RTC. */
enum status_code rtc_count_init(struct rtc_module *const module, Rtc *const hw, const struct rtc_count_config *const config)
{
	Assert(module);
	Assert(hw);
	Assert(config);
	module->hw = hw;
	system_apb_clock_set_mask(SYSTEM_CLOCK_APB_APBA, MCLK_APBAMASK_RTC);
	OSC32KCTRL->RTCCTRL.reg = RTC_CLOCK_SOURCE;
	rtc_count_reset(module);
	module->mode                = config->mode;
#  if (RTC_INST_NUM == 1)
	_rtc_instance[0] = module;
#  else
	_rtc_instance[_rtc_get_inst_index(hw)] = module;
#  endif
	return _rtc_count_set_config(module, config);
}