/* DMA Stream Set the Base Memory Address 0. 
This is the default base memory address used in direct mode. */
void dma_set_memory_address(uint32_t dma, uint8_t stream, uint32_t address)
/* DMA Stream Set the Base Memory Address 0. 
This is the default base memory address used in direct mode. */
void dma_set_memory_address(uint32_t dma, uint8_t stream, uint32_t address)
{
	uint32_t reg32 = DMA_SCR(dma, stream);
	if (!(reg32 & DMA_SxCR_EN) ||
	     ((reg32 & DMA_SxCR_CT) && (reg32 & DMA_SxCR_DBM))) {
		DMA_SM0AR(dma, stream) = (uint32_t *) address;
	}
}