/* Configures, when the DMAy Streamx is disabled, the double buffer mode and the current memory target.  */
void DMA_DoubleBufferModeConfig(DMA_Stream_TypeDef *DMAy_Streamx, uint32_t Memory1BaseAddr, uint32_t DMA_CurrentMemory)
/* Configures, when the DMAy Streamx is disabled, the double buffer mode and the current memory target.  */
void DMA_DoubleBufferModeConfig(DMA_Stream_TypeDef *DMAy_Streamx, uint32_t Memory1BaseAddr, uint32_t DMA_CurrentMemory)
{
  assert_param(IS_DMA_ALL_PERIPH(DMAy_Streamx));
  assert_param(IS_DMA_CURRENT_MEM(DMA_CurrentMemory));
  if (DMA_CurrentMemory != DMA_Memory_0)
  {
    DMAy_Streamx->CR |= (uint32_t)(DMA_SxCR_CT);    
  }
  else
  {
    DMAy_Streamx->CR &= ~(uint32_t)(DMA_SxCR_CT);    
  }
  DMAy_Streamx->M1AR = Memory1BaseAddr;
}