/* Retrieves the current module status. 
Retrieves the status of the module, giving overall state information. */
uint32_t adc_get_status(struct adc_module *const module_inst)
/* Retrieves the current module status. 
Retrieves the status of the module, giving overall state information. */
uint32_t adc_get_status(struct adc_module *const module_inst)
{
	Assert(module_inst);
	Assert(module_inst->hw);
	Adc *const adc_module = module_inst->hw;
	uint32_t int_flags = adc_module->INTFLAG.reg;
	uint32_t status_flags = 0;
	if (int_flags & ADC_INTFLAG_RESRDY) {
		status_flags |= ADC_STATUS_RESULT_READY;
	}
	if (int_flags & ADC_INTFLAG_WINMON) {
		status_flags |= ADC_STATUS_WINDOW;
	}
	if (int_flags & ADC_INTFLAG_OVERRUN) {
		status_flags |= ADC_STATUS_OVERRUN;
	}
	return status_flags;
}