您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

70 行
1.8KB

  1. #ifndef STEPPER_PARAMS_H
  2. #define STEPPER_PARAMS_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include "board.h"
  7. #ifndef STEPPER_STEP_PIN
  8. #define STEPPER_STEP_PIN GPIO_PIN(0, 0)
  9. #endif
  10. #ifndef STEPPER_DIR_PIN
  11. #define STEPPER_DIR_PIN GPIO_PIn(0, 1)
  12. #endif
  13. #ifndef STEPPER_UART
  14. #define STEPPER_UART UART(0)
  15. #endif
  16. #ifndef STEPPER_VEL_MAX
  17. #define STEPPER_VEL_MAX STEPPER_VEL_MAX_DEFAULT
  18. #endif
  19. #ifndef STEPPER_ACC_MAX
  20. #define STEPPER_ACC_MAX STEPPER_ACC_MAX_DEFAULT
  21. #endif
  22. #ifndef STEPPER_MICROSTEP
  23. #define STEPPER_MICROSTEP STEPPER_MICROSTEP_DEFAULT
  24. #endif
  25. #ifndef STEPPER_DIVISION
  26. #define STEPPER_DIVISION STEPPER_DIVISION_DEFAULT
  27. #endif
  28. #ifndef STEPPER_ANGLE
  29. #define STEPPER_ANGLE STEPPER_ANGLE_DEFAULT
  30. #endif
  31. #ifndef STEPPER_VELOCITY
  32. #define STEPPER_VELOCITY STEPPER_VELOCITY_DEFAULT
  33. #endif
  34. #ifndef STEPPER_SENSOR
  35. #define STEPPER_SENSOR STEPPER_SENSOR_DEFAULT
  36. #endif
  37. #ifndef STEPPER_HOMING_ANGLE
  38. #define STEPPER_HOMING_ANGLE STEPPER_HOMING_ANGLE_DEFAULT
  39. #endif
  40. #ifndef STEPPER_PARAMS
  41. #define STEPPER_PARAMS \
  42. { .step_pin = stepper_param_step_pin, \
  43. .dir_pin = stepper_param_dir_pin, \
  44. .addr = stepper_param_addr, \
  45. .vel_max = stepper_param_vel_max, \
  46. .acc_max = stepper_param_acc_max, \
  47. .microstep = stepper_param_microstep, \
  48. .division = stepper_param_division, \
  49. .angle = stepper_param_angle, \
  50. .velocity = stepper_param_velocity, \
  51. .sensor = stepper_param_sensor, \
  52. .homing_angle = stepper_param_homing_angle, \
  53. }
  54. #endif
  55. static const stepper_params_t stepper_params[] = {
  56. STEPPER_PARAMS
  57. };
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #endif /* STEPPER_PARAMS_H */