/* Check if RTC compare match has occurred. 
Checks the compare flag to see if a match has occurred. The compare flag is set when there is a compare match between counter and the compare. */
bool rtc_count_is_compare_match(struct rtc_module *const module, const enum rtc_count_compare comp_index)
/* Check if RTC compare match has occurred. 
Checks the compare flag to see if a match has occurred. The compare flag is set when there is a compare match between counter and the compare. */
bool rtc_count_is_compare_match(struct rtc_module *const module, const enum rtc_count_compare comp_index)
{
	Assert(module);
	Assert(module->hw);
	Rtc *const rtc_module = module->hw;
	switch (module->mode) {
		case RTC_COUNT_MODE_32BIT:
			if (comp_index > RTC_NUM_OF_COMP32) {
				return false;
			}
			break;
		case RTC_COUNT_MODE_16BIT:
			if (comp_index > RTC_NUM_OF_COMP16) {
				return false;
			}
			break;
		default:
			Assert(false);
			return false;
	}
	return (rtc_module->MODE0.INTFLAG.reg & (1 << comp_index)) ? true : false;
}