cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F1xx HAL UserManual __HAL_DMA_GET_IT_SOURCE confused me

calltherain
Associate II
Posted on January 31, 2015 at 13:42

#define __HAL_DMA_GET_IT_SOURCE ( __HANDLE__, __INTERRUPT__ ) ((((__HANDLE__)->Instance->CCR & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)

The documentation has such a definition for this macro: Checks whether the specified DMA Channel interrupt has occurred or not. And the documentation said the __INTERRUPT__ can be one of the following values:

•DMA_IT_TC: Transfer complete interrupt mask 
•DMA_IT_HT: Half transfer complete interrupt mask 
•DMA_IT_TE: Transfer error interrupt mask 

But I'm thinking this macro actually checks if the specified DMA Interrupt is enabled or not. If I want to check which interrupt is signalled I should check DMA Inerrupt status register (DMA_ISR) instead of DMA channel x configuration register ( DMA_CCRx)? Please correct me if I made any mistake here. Many thanks.
2 REPLIES 2
Posted on February 02, 2015 at 09:38

Yes you are right, this is obviously a documentation error (reproduced by copy/paste in the other chips' ''libraries'' too). There is a different macro for checking the current interrupt status (I don't care to post its name here, whoever wants to waste his/her time using Cube can look it up him/herself).

You should be pestering the Cube crew through any support channel you have to ST; they appear to only randomly pick and answer posts here.

JW

Posted on March 04, 2015 at 18:02

Hi shawn,

Actually, we confirm that it’s an error in documentation, it will be fixed in the next document release.

thanks for your feedbacks.

Regards,

Heisenberg.