/* Get the current compare value of specified compare. 
Retrieves the current value of the specified compare. */
enum status_code rtc_count_get_compare(struct rtc_module *const module, uint32_t *const comp_value, const enum rtc_count_compare comp_index)
/* Get the current compare value of specified compare. 
Retrieves the current value of the specified compare. */
enum status_code rtc_count_get_compare(struct rtc_module *const module, uint32_t *const comp_value, 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 ((uint32_t)comp_index > RTC_NUM_OF_COMP32) {
				return STATUS_ERR_INVALID_ARG;
			}
			*comp_value = rtc_module->MODE0.COMP[comp_index].reg;
			break;
		case RTC_COUNT_MODE_16BIT:
			if ((uint32_t)comp_index > RTC_NUM_OF_COMP16) {
				return STATUS_ERR_INVALID_ARG;
			}
			*comp_value = (uint32_t)rtc_module->MODE1.COMP[comp_index].reg;
			break;
		default:
			Assert(false);
			return STATUS_ERR_BAD_FORMAT;
	}
	return STATUS_OK;
}