Is there impossible to start PWM DMA on several channels of same timer in HAL?
I want to start PWM DMA on channels 2 and 3 of TIM2, but I've found that it is possible to start only one DMA per timer. My MCU is stm32f103 series and my code is:
HAL_TIM_PWM_Start_DMA(&htim2, TIM_CHANNEL_2, (uint32_t*)&send_buff_one , 16);
HAL_TIM_PWM_Start_DMA(&htim2, TIM_CHANNEL_3, (uint32_t*)&send_buff_two , 16);HAL_TIM_PWM_Start_DMA() is impemented in HAL by this way:
HAL_StatusTypeDef HAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)
{
uint32_t tmpsmcr;
/* Check the parameters */
assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel));
if (htim->State == HAL_TIM_STATE_BUSY)
{
return HAL_BUSY;
}
else if (htim->State == HAL_TIM_STATE_READY)
{
if ((pData == NULL) && (Length > 0U))
{
return HAL_ERROR;
}
else
{
htim->State = HAL_TIM_STATE_BUSY;
}
}so, after first call of HAL_TIM_PWM_Start_DMA() htim2->State will HAL_TIM_STATE_BUSY and second call of HAL_TIM_PWM_Start_DMA() for htim2 will fail with HAL_BUSY result.
Is this implementaion reflects hardware limitation of MCU or is it just lack of HAL implementation?
