@@ -164,13 +164,12 @@ typedef int (*stepper_set_target_position_t)(const struct device *dev, const int
164164typedef int (* stepper_is_moving_t )(const struct device * dev , bool * is_moving );
165165
166166/**
167- * @brief Enable constant velocity mode for the stepper with a given velocity
167+ * @brief Run the stepper with a given velocity in a given direction
168168 *
169- * @see stepper_enable_constant_velocity_mode () for details.
169+ * @see stepper_run () for details.
170170 */
171- typedef int (* stepper_enable_constant_velocity_mode_t )(const struct device * dev ,
172- const enum stepper_direction direction ,
173- const uint32_t value );
171+ typedef int (* stepper_run_t )(const struct device * dev , const enum stepper_direction direction ,
172+ const uint32_t value );
174173
175174/**
176175 * @brief Callback function for stepper events
@@ -199,7 +198,7 @@ __subsystem struct stepper_driver_api {
199198 stepper_get_actual_position_t get_actual_position ;
200199 stepper_set_target_position_t set_target_position ;
201200 stepper_is_moving_t is_moving ;
202- stepper_enable_constant_velocity_mode_t enable_constant_velocity_mode ;
201+ stepper_run_t run ;
203202 stepper_set_event_callback_t set_event_callback ;
204203};
205204
@@ -408,36 +407,34 @@ static inline int z_impl_stepper_is_moving(const struct device *dev, bool *is_mo
408407}
409408
410409/**
411- * @brief Enable constant velocity mode for the stepper with a given velocity
410+ * @brief Run the stepper with a given velocity in a given direction
412411 *
413- * @details activate constant velocity mode with the given velocity in micro_steps_per_second.
414- * If velocity > 0, motor shall be set into motion and run incessantly until and unless stalled or
415- * stopped using some other command, for instance, motor_enable(false).
412+ * @details If velocity > 0, motor shall be set into motion and run incessantly until and unless
413+ * stalled or stopped using some other command, for instance, motor_enable(false).
416414 *
417415 * @param dev pointer to the stepper motor controller instance
418416 * @param direction The direction to set
419- * @param value The velocity to set in steps per second where one step is dependent on the current
420- * microstepping resolution:
421- * > 0: Enable constant velocity mode with the given velocity in a given direction
422- * 0: Disable constant velocity mode
417+ * @param velocity The velocity to set in microsteps per second
418+ * - > 0: Run the stepper with the given velocity in a given direction
419+ * - 0: Stop the stepper
423420 *
424421 * @retval -EIO General input / output error
425422 * @retval -ENOSYS If not implemented by device driver
426423 * @retval 0 Success
427424 */
428- __syscall int stepper_enable_constant_velocity_mode (const struct device * dev ,
429- enum stepper_direction direction ,
430- uint32_t value );
425+ __syscall int stepper_run (const struct device * dev , enum stepper_direction direction ,
426+ uint32_t velocity );
431427
432- static inline int z_impl_stepper_enable_constant_velocity_mode (
433- const struct device * dev , const enum stepper_direction direction , const uint32_t value )
428+ static inline int z_impl_stepper_run (const struct device * dev ,
429+ const enum stepper_direction direction ,
430+ const uint32_t velocity )
434431{
435432 const struct stepper_driver_api * api = (const struct stepper_driver_api * )dev -> api ;
436433
437- if (api -> enable_constant_velocity_mode == NULL ) {
434+ if (api -> run == NULL ) {
438435 return - ENOSYS ;
439436 }
440- return api -> enable_constant_velocity_mode (dev , direction , value );
437+ return api -> run (dev , direction , velocity );
441438}
442439
443440/**
0 commit comments