cancel
Showing results for 
Search instead for 
Did you mean: 

How can i use Half-Complete and Complete DMA Callbacks with timer in PWM mode?

Caraffa
Associate II

Hi,

I've set up timer in PWM mode with circular DMA in CubeIDE.

I would like to change buffer with halfcplt and cplt callbacks but i have no idea how to do that. I can't find any example on internet neither in documentation.

Should i somehow register those callbacks or maybe there are some weak void functions that i can't find?

I would be very thankful for any code example.

Edit: I'm using stm32f407vg

1 ACCEPTED SOLUTION
4 REPLIES 4
MM..1
Chief III

I mean exist , for example i use ADC DMA, but you need add to code manualy

// Called when first half of buffer is filled
void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc) {
 
//  PWR_LED_GPIO_Port->BSRR = PWR_LED_Pin;
 
}
// Called when buffer is completely filled
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) {
 
//  HAL_GPIO_WritePin(PWR_LED_GPIO_Port, PWR_LED_Pin, GPIO_PIN_RESET);
}

try search CpltCallback.

I've seen callback for ADC and UART several times on google but i can't find such just for timer in pwm mode

as i said above, i can't find it anywhere

edit: ok, hal is confusing