1 /*
2  * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: CC0-1.0
5  */
6 
7 #include "step_motor.h"
8 
step_motor_init(step_motor_t * handle)9 esp_err_t step_motor_init(step_motor_t *handle)
10 {
11     return handle->init(handle);
12 }
13 
step_motor_deinit(step_motor_t * handle)14 esp_err_t step_motor_deinit(step_motor_t *handle)
15 {
16     return handle->deinit(handle);
17 }
18 
step_motor_step(step_motor_t * handle,uint32_t n,uint32_t speed)19 esp_err_t step_motor_step(step_motor_t *handle, uint32_t n, uint32_t speed)
20 {
21     return handle->step(handle, n, speed);
22 }
23 
step_motor_smooth_step(step_motor_t * handle,uint32_t n,uint32_t speed_steps,uint32_t speed_min,uint32_t speed_max)24 esp_err_t step_motor_smooth_step(step_motor_t *handle, uint32_t n, uint32_t speed_steps, uint32_t speed_min, uint32_t speed_max)
25 {
26     return handle->smooth_step(handle, n, speed_steps, speed_min, speed_max);
27 }
28 
step_motor_set_step(step_motor_t * handle,uint16_t microstep,bool direction)29 esp_err_t step_motor_set_step(step_motor_t *handle, uint16_t microstep, bool direction)
30 {
31     return handle->set_step(handle, microstep, direction);
32 }
33