2022-07-09 03:17 AM
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
Solved! Go to Solution.
2022-07-09 04:05 AM
Search on disk HAL not google...
How to enable HalfTransferCompleted and Transfer Completed. Using Cube MX and HAL (st.com)
2022-07-09 03:57 AM
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.
2022-07-09 04:00 AM
I've seen callback for ADC and UART several times on google but i can't find such just for timer in pwm mode
2022-07-09 04:05 AM
Search on disk HAL not google...
How to enable HalfTransferCompleted and Transfer Completed. Using Cube MX and HAL (st.com)
2022-07-09 04:07 AM
as i said above, i can't find it anywhere
edit: ok, hal is confusing