/* Set the given value to the period. 
Sets the given value to the period. */
enum status_code rtc_count_set_period(struct rtc_module *const module, const uint16_t period_value)
/* Set the given value to the period. 
Sets the given value to the period. */
enum status_code rtc_count_set_period(struct rtc_module *const module, const uint16_t period_value)
{
	Assert(module);
	Assert(module->hw);
	Rtc *const rtc_module = module->hw;
	if (module->mode != RTC_COUNT_MODE_16BIT) {
		return STATUS_ERR_UNSUPPORTED_DEV;
	}
	while (rtc_count_is_syncing(module)) {
	}
	rtc_module->MODE1.PER.reg = period_value;
	return STATUS_OK;
}