1 /* 2 * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: CC0-1.0 5 */ 6 7 #pragma once 8 9 #include "esp_err.h" 10 #include "step_motor_driver_io.h" 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 /** 17 * @brief A4988 configuration 18 */ 19 typedef struct step_motor_io_a4988_conf_s { 20 gpio_num_t direction_pin; 21 gpio_num_t sleep_pin; 22 gpio_num_t reset_pin; 23 gpio_num_t ms3_pin; 24 gpio_num_t ms2_pin; 25 gpio_num_t ms1_pin; 26 gpio_num_t enable_pin; 27 } step_motor_io_a4988_conf_t; 28 29 /** 30 * @brief A4988 low part driver handle 31 */ 32 typedef struct step_motor_driver_io_a4988_s { 33 step_motor_driver_io_t base; 34 step_motor_io_a4988_conf_t conf; 35 } step_motor_driver_io_a4988_t; 36 37 /** 38 * @brief create an A4988 driver handle 39 */ 40 esp_err_t step_motor_new_a4988_io_driver(const step_motor_io_a4988_conf_t *conf, step_motor_driver_io_handle_t *handle); 41 42 /** 43 * @brief delete an A4988 driver handle 44 */ 45 esp_err_t step_motor_delete_a4988_io_driver(step_motor_driver_io_handle_t handle); 46 47 #ifdef __cplusplus 48 } 49 #endif 50