/** ****************************************************************************** * @file : main.c * @author : Auto-generated by STM32CubeIDE * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ #include #include void dma2_mem_to_mem_config(void) { //clock enable for dma2 RCC->AHB1ENR=(1<<22); //disable dmastream DMA2_Stream0->CR=0; //keep stream0 untill disbaling over while(DMA2_Stream0->CR &1) { } //configure DMA params //Memory size to half word 14,13 bit(0 1) DMA2_Stream0->CR|=(1<<13); } int main(void) { /* Loop forever */ for(;;); }