Lines Matching +full:micro +full:- +full:step +full:- +full:res

9  * SPDX-FileCopyrightText: Copyright (c) 2024 Carl Zeiss Meditec AG
10 * SPDX-FileCopyrightText: Copyright (c) 2024 Jilay Sandeep Pandya
11 * SPDX-License-Identifier: Apache-2.0
32 #define MICRO_STEP_RES_INDEX(res) LOG2(res) argument
35 * @brief Stepper Motor micro step resolution options
38 /** Full step resolution */
40 /** 2 micro steps per full step */
42 /** 4 micro steps per full step */
44 /** 8 micro steps per full step */
46 /** 16 micro steps per full step */
48 /** 32 micro steps per full step */
50 /** 64 micro steps per full step */
52 /** 128 micro steps per full step */
54 /** 256 micro steps per full step */
124 * @brief Set the micro-step resolution
132 * @brief Get the micro-step resolution
215 * @retval -EIO Error during Enabling
222 const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api; in z_impl_stepper_enable()
224 return api->enable(dev, enable); in z_impl_stepper_enable()
231 * This function is non-blocking.
236 * @retval -ECANCELED If the stepper is disabled
237 * @retval -EIO General input / output error
244 const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api; in z_impl_stepper_move_by()
246 return api->move_by(dev, micro_steps); in z_impl_stepper_move_by()
253 * toggle the STEP Pin, the pulse_length would have to be calculated based on this parameter in the
261 * @retval -EIO General input / output error
262 * @retval -EINVAL If the requested velocity is not supported
270 const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api; in z_impl_stepper_set_max_velocity()
272 return api->set_max_velocity(dev, micro_steps_per_second); in z_impl_stepper_set_max_velocity()
281 * @retval -EIO General input / output error
282 * @retval -ENOSYS If not implemented by device driver
283 * @retval -ENOTSUP If the requested resolution is not supported
292 const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api; in z_impl_stepper_set_micro_step_res()
294 if (api->set_micro_step_res == NULL) { in z_impl_stepper_set_micro_step_res()
295 return -ENOSYS; in z_impl_stepper_set_micro_step_res()
297 return api->set_micro_step_res(dev, resolution); in z_impl_stepper_set_micro_step_res()
306 * @retval -EIO General input / output error
307 * @retval -ENOSYS If not implemented by device driver
316 const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api; in z_impl_stepper_get_micro_step_res()
318 if (api->get_micro_step_res == NULL) { in z_impl_stepper_get_micro_step_res()
319 return -ENOSYS; in z_impl_stepper_get_micro_step_res()
321 return api->get_micro_step_res(dev, resolution); in z_impl_stepper_get_micro_step_res()
328 * @param value The reference position to set in micro-steps.
330 * @retval -EIO General input / output error
331 * @retval -ENOSYS If not implemented by device driver
339 const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api; in z_impl_stepper_set_reference_position()
341 if (api->set_reference_position == NULL) { in z_impl_stepper_set_reference_position()
342 return -ENOSYS; in z_impl_stepper_set_reference_position()
344 return api->set_reference_position(dev, value); in z_impl_stepper_set_reference_position()
353 * @retval -EIO General input / output error
354 * @retval -ENOSYS If not implemented by device driver
361 const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api; in z_impl_stepper_get_actual_position()
363 if (api->get_actual_position == NULL) { in z_impl_stepper_get_actual_position()
364 return -ENOSYS; in z_impl_stepper_get_actual_position()
366 return api->get_actual_position(dev, value); in z_impl_stepper_get_actual_position()
373 * This function is non-blocking.
378 * @retval -ECANCELED If the stepper is disabled
379 * @retval -EIO General input / output error
380 * @retval -ENOSYS If not implemented by device driver
387 const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api; in z_impl_stepper_move_to()
389 if (api->move_to == NULL) { in z_impl_stepper_move_to()
390 return -ENOSYS; in z_impl_stepper_move_to()
392 return api->move_to(dev, micro_steps); in z_impl_stepper_move_to()
401 * @retval -EIO General input / output error
402 * @retval -ENOSYS If not implemented by device driver
409 const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api; in z_impl_stepper_is_moving()
411 if (api->is_moving == NULL) { in z_impl_stepper_is_moving()
412 return -ENOSYS; in z_impl_stepper_is_moving()
414 return api->is_moving(dev, is_moving); in z_impl_stepper_is_moving()
422 * This function is non-blocking.
427 * - > 0: Run the stepper with the given velocity in a given direction
428 * - 0: Stop the stepper
430 * @retval -ECANCELED If the stepper is disabled
431 * @retval -EIO General input / output error
432 * @retval -ENOSYS If not implemented by device driver
442 const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api; in z_impl_stepper_run()
444 if (api->run == NULL) { in z_impl_stepper_run()
445 return -ENOSYS; in z_impl_stepper_run()
447 return api->run(dev, direction, velocity); in z_impl_stepper_run()
458 * @retval -ENOSYS If not implemented by device driver
468 const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api; in z_impl_stepper_set_event_callback()
470 if (api->set_event_callback == NULL) { in z_impl_stepper_set_event_callback()
471 return -ENOSYS; in z_impl_stepper_set_event_callback()
473 return api->set_event_callback(dev, callback, user_data); in z_impl_stepper_set_event_callback()