/* Configure pins as Analog Input Output EVENT_OUT EXTI  */
void MY_PWM_Init(void)
/* Configure pins as Analog Input Output EVENT_OUT EXTI  */
void MY_PWM_Init(void)
{
	hpwm.Instance = PWM;
	hpwm.Init.AutoReloadPreload = PWM_AUTORELOAD_PRELOAD_ENABLE;
	hpwm.Init.CounterMode = PWM_COUNTERMODE_EDGEALIGNED_DOWN;
	hpwm.Init.Prescaler = 4;
	hpwm.Init.Period = 2000 -1;
	hpwm.Init.Pulse = 50 -1;
	hpwm.Init.OutMode = PWM_OUT_MODE_5SYNC;
	hpwm.Channel = ch;
	HAL_PWM_Init(&hpwm);
	HAL_PWM_Start(&hpwm, ch);
	HAL_PWM_Duty_Set(&hpwm, ch, 50);
}