@@ -93,7 +93,6 @@ static int a4979_stepper_disable(const struct device *dev)
9393 return ret ;
9494 }
9595
96- config -> common .timing_source -> stop (dev );
9796 data -> enabled = false;
9897
9998 return 0 ;
@@ -152,42 +151,6 @@ static int a4979_stepper_get_micro_step_res(const struct device *dev,
152151 return 0 ;
153152}
154153
155- static int a4979_move_to (const struct device * dev , int32_t target )
156- {
157- struct a4979_data * data = dev -> data ;
158-
159- if (!data -> enabled ) {
160- LOG_ERR ("Failed to move to target position, device is not enabled" );
161- return - ECANCELED ;
162- }
163-
164- return step_dir_stepper_common_move_to (dev , target );
165- }
166-
167- static int a4979_stepper_move_by (const struct device * dev , const int32_t micro_steps )
168- {
169- struct a4979_data * data = dev -> data ;
170-
171- if (!data -> enabled ) {
172- LOG_ERR ("Failed to move by delta, device is not enabled" );
173- return - ECANCELED ;
174- }
175-
176- return step_dir_stepper_common_move_by (dev , micro_steps );
177- }
178-
179- static int a4979_run (const struct device * dev , enum stepper_direction direction )
180- {
181- struct a4979_data * data = dev -> data ;
182-
183- if (!data -> enabled ) {
184- LOG_ERR ("Failed to run stepper, device is not enabled" );
185- return - ECANCELED ;
186- }
187-
188- return step_dir_stepper_common_run (dev , direction );
189- }
190-
191154static int a4979_init (const struct device * dev )
192155{
193156 const struct a4979_config * config = dev -> config ;
@@ -268,17 +231,10 @@ static int a4979_init(const struct device *dev)
268231static DEVICE_API (stepper , a4979_stepper_api ) = {
269232 .enable = a4979_stepper_enable ,
270233 .disable = a4979_stepper_disable ,
271- .move_by = a4979_stepper_move_by ,
272- .move_to = a4979_move_to ,
273- .is_moving = step_dir_stepper_common_is_moving ,
274- .set_reference_position = step_dir_stepper_common_set_reference_position ,
275- .get_actual_position = step_dir_stepper_common_get_actual_position ,
276- .set_microstep_interval = step_dir_stepper_common_set_microstep_interval ,
277- .run = a4979_run ,
278- .stop = step_dir_stepper_common_stop ,
279234 .set_micro_step_res = a4979_stepper_set_micro_step_res ,
280235 .get_micro_step_res = a4979_stepper_get_micro_step_res ,
281- .set_event_callback = step_dir_stepper_common_set_event_callback ,
236+ .step = step_dir_stepper_common_step ,
237+ .set_direction = step_dir_stepper_common_set_direction ,
282238};
283239
284240#define A4979_DEVICE (inst ) \
0 commit comments