2015-12-21 05:09 AM
I spend the last 2 days getting an example to work for DMA transfer from the GPIOC inputs to memory triggered by a timer and based on the HAL-library and thats with a project generated by STM32CubeMX !
This forum helps me a lot, so I thought I could give s.th back and share my code with you. What does the code?/* configure DMA */
HAL_DMA_Start(&hdma_tim1_ch4_trig_com, (uint32_t)&GPIOC->IDR, (uint32_t)&gSamples[0], GSAMPLES_SIZE);
/* TIM1: connect Capture Compare Interrupt of Channel 4 as DMA Request */
__HAL_TIM_ENABLE_DMA(&htim1, TIM_DMA_CC4);
/* TIM1: Channel 4 output enable */
HAL_TIM_OC_Start(&htim1, TIM_CHANNEL_4);
/* TIM1: start timer */
HAL_TIM_Base_Start(&htim1);
#stm32cubemx #hal #dma #tim