cancel
Showing results for 
Search instead for 
Did you mean: 

When is HAL_ADC_ConvCpltCallback called in both DMA and Interrupt modes?

C.East2
Associate III

I have multiple channels that I am trying to read from. I want to try both DMA and Interrupt mode.

Does the callback follow the EOC flag, and therefore follow the 'End of Conversion Selection' setting in Cube (to which I have set to 'at the end of single channel conversion')? If so, does that mean when I call HAL_ADC_GetValue (say from this callback), I will be getting the result of the channel that has just been converted?

For DMA I understand that HAL_ADC_ConvHalfCpltCallback is called when the chosen buffer I have given it is half full. So does that mean HAL_ADC_ConvCpltCallback is called when the buffer is completely full and not when a singular channel or all channels has been converted?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

In DMA mode, the EOC flag isn't used. HAL_ADC_Conv(Half)CpltCallback is called on the DMA's HT and TC flags.

Unsure about IT mode offhand, but you could look at HAL_ADC_IRQHandler and follow the logic.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Guru

In DMA mode, the EOC flag isn't used. HAL_ADC_Conv(Half)CpltCallback is called on the DMA's HT and TC flags.

Unsure about IT mode offhand, but you could look at HAL_ADC_IRQHandler and follow the logic.

If you feel a post has answered your question, please click "Accept as Solution".