Software/StNucleo/Drivers/BSP/X-NUCLEO-IHMxx/x_nucleo_ihm03a1_stm32f4xx.c
void Powerstep01_Board_StepClockInit(void)
{
  TIM_OC_InitTypeDef sConfigOC;
  TIM_MasterConfigTypeDef sMasterConfig;
  TIM_ClockConfigTypeDef sClockSourceConfig;
  
  hTimStepClock.Instance = BSP_MOTOR_CONTROL_BOARD_TIMER_STEP_CLOCK;
  hTimStepClock.Init.Prescaler = TIMER_PRESCALER -1;
  hTimStepClock.Init.CounterMode = TIM_COUNTERMODE_UP;
  hTimStepClock.Init.Period = 0;
  hTimStepClock.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
  HAL_TIM_PWM_Init(&hTimStepClock);

  sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
  HAL_TIM_ConfigClockSource(&hTimStepClock, &sClockSourceConfig);
  
  sConfigOC.OCMode = TIM_OCMODE_PWM1;
  sConfigOC.Pulse = 0;
  sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
  sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
  HAL_TIM_PWM_ConfigChannel(&hTimStepClock, &sConfigOC, BSP_MOTOR_CONTROL_BOARD_CHAN_TIMER_STEP_CLOCK);
  
  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
  HAL_TIMEx_MasterConfigSynchronization(&hTimStepClock, &sMasterConfig);
}
/******************************************************/
/**
 * @brief  Initialises the step clock by setting 
 * corresponding GPIO, Timer, Pwm,...
 * @retval None
 **********************************************************/
@brief  Initialises the step clock by setting
corresponding GPIO, Timer, Pwm,
@retval None
@brief Initialises the step clock by setting corresponding GPIO Timer Pwm @retval None
void Powerstep01_Board_StepClockInit(void)
{
  TIM_OC_InitTypeDef sConfigOC;
  TIM_MasterConfigTypeDef sMasterConfig;
  TIM_ClockConfigTypeDef sClockSourceConfig;
  hTimStepClock.Instance = BSP_MOTOR_CONTROL_BOARD_TIMER_STEP_CLOCK;
  hTimStepClock.Init.Prescaler = TIMER_PRESCALER -1;
  hTimStepClock.Init.CounterMode = TIM_COUNTERMODE_UP;
  hTimStepClock.Init.Period = 0;
  hTimStepClock.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
  HAL_TIM_PWM_Init(&hTimStepClock);
  sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
  HAL_TIM_ConfigClockSource(&hTimStepClock, &sClockSourceConfig);
  sConfigOC.OCMode = TIM_OCMODE_PWM1;
  sConfigOC.Pulse = 0;
  sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
  sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
  HAL_TIM_PWM_ConfigChannel(&hTimStepClock, &sConfigOC, BSP_MOTOR_CONTROL_BOARD_CHAN_TIMER_STEP_CLOCK);
  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
  HAL_TIMEx_MasterConfigSynchronization(&hTimStepClock, &sMasterConfig);
}
void Powerstep01_Board_StepClockInit ( void ) { TIM_OC_InitTypeDef sConfigOC ; TIM_MasterConfigTypeDef sMasterConfig ; TIM_ClockConfigTypeDef sClockSourceConfig ; hTimStepClock . Instance = BSP_MOTOR_CONTROL_BOARD_TIMER_STEP_CLOCK ; hTimStepClock . Init . Prescaler = TIMER_PRESCALER - 1 ; hTimStepClock . Init . CounterMode = TIM_COUNTERMODE_UP ; hTimStepClock . Init . Period = 0 ; hTimStepClock . Init . ClockDivision = TIM_CLOCKDIVISION_DIV1 ; HAL_TIM_PWM_Init ( & hTimStepClock ) ; sClockSourceConfig . ClockSource = TIM_CLOCKSOURCE_INTERNAL ; HAL_TIM_ConfigClockSource ( & hTimStepClock , & sClockSourceConfig ) ; sConfigOC . OCMode = TIM_OCMODE_PWM1 ; sConfigOC . Pulse = 0 ; sConfigOC . OCPolarity = TIM_OCPOLARITY_HIGH ; sConfigOC . OCFastMode = TIM_OCFAST_DISABLE ; HAL_TIM_PWM_ConfigChannel ( & hTimStepClock , & sConfigOC , BSP_MOTOR_CONTROL_BOARD_CHAN_TIMER_STEP_CLOCK ) ; sMasterConfig . MasterOutputTrigger = TIM_TRGO_RESET ; sMasterConfig . MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE ; HAL_TIMEx_MasterConfigSynchronization ( & hTimStepClock , & sMasterConfig ) ; }
@brief  Initialises the step clock by setting
 corresponding GPIO, Timer, Pwm,...
 @retval None
@brief Initialises the step clock by setting corresponding GPIO Timer Pwm ... @retval None