Skip to main content
C.East2
Associate III
April 5, 2022
Solved

When is HAL_ADC_ConvCpltCallback called in both DMA and Interrupt modes?

  • April 5, 2022
  • 1 reply
  • 3129 views

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?

This topic has been closed for replies.
Best answer by TDK

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.

1 reply

TDK
TDKBest answer
April 7, 2022

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""."