Previously we worked with the LWADC driver, but the "wait_next" function gives a delay, so I'm searching for an improved method to access the ADC.
My question is:
How can I make the ADC interrupt driven (interrupt on conversion complete)?
I've checked the datasheet and there should be AIEN-Flag in the ADCx_HC0/1 registers, which might play a role here.
已解决! 转到解答。
I found the answer myself. You can use the MQX functions:
_int_install_isr(NVIC_ADC0, iADC_ISR, 0);
_bsp_int_init(NVIC_ADC0, 3, 0, TRUE);
_int_install_isr(NVIC_ADC1, iADC_ISR, 0);
_bsp_int_init(NVIC_ADC1, 3, 0, TRUE);
with iADC_ISR is the function pointer to the ISR: iADC_ISR(void*ptr).
And then make sure to have the AIEN flag enabled in the ADCx_HC0 registers!
I found the answer myself. You can use the MQX functions:
_int_install_isr(NVIC_ADC0, iADC_ISR, 0);
_bsp_int_init(NVIC_ADC0, 3, 0, TRUE);
_int_install_isr(NVIC_ADC1, iADC_ISR, 0);
_bsp_int_init(NVIC_ADC1, 3, 0, TRUE);
with iADC_ISR is the function pointer to the ISR: iADC_ISR(void*ptr).
And then make sure to have the AIEN flag enabled in the ADCx_HC0 registers!
timesyssupport can you help to review this case?