/* Unregisters callback for the specified callback type. 
When called, the currently registered callback for the given callback type will be removed. */
enum status_code rtc_count_unregister_callback(struct rtc_module *const module, enum rtc_count_callback callback_type)
/* Unregisters callback for the specified callback type. 
When called, the currently registered callback for the given callback type will be removed. */
enum status_code rtc_count_unregister_callback(struct rtc_module *const module, enum rtc_count_callback callback_type)
{
	enum status_code status = STATUS_OK;
	if (callback_type == RTC_COUNT_CALLBACK_OVERFLOW) {
		status = STATUS_OK;
	} else {
		switch (module->mode) {
		case RTC_COUNT_MODE_32BIT:
			if (callback_type > RTC_NUM_OF_COMP32) {
				status = STATUS_ERR_INVALID_ARG;
			}
			break;
		case RTC_COUNT_MODE_16BIT:
			if (callback_type > RTC_NUM_OF_COMP16) {
				status = STATUS_ERR_INVALID_ARG;
			}
			break;
		default:
			status = STATUS_ERR_INVALID_ARG;
		}
	}
	if (status == STATUS_OK) {
		module->callbacks[callback_type] = NULL;
		module->registered_callback &= ~(1 << callback_type);
	}
	return status;
}