/* Checks whether the specified DMA flag is set or not.  */
uint8_t DMA_ReadStatusFlag(DMA_FLAG_T flag)
/* Checks whether the specified DMA flag is set or not.  */
uint8_t DMA_ReadStatusFlag(DMA_FLAG_T flag)
{
    uint32_t status;
    if ((flag & 0x10000000) == SET)
    {
        status = DMA2->INTSTS & ((uint32_t)flag & 0x000FFFFF);
    }
    else
    {
        status = DMA1->INTSTS & ((uint32_t)flag & 0x0FFFFFFF);
    }
    if (status == flag)
    {
        return SET;
    }
    return RESET;
}