|
|
|
@@ -7,53 +7,52 @@ extern "C" { |
|
|
|
|
|
|
|
#include "board.h" |
|
|
|
|
|
|
|
#ifndef STEPPER_STEP_PIN |
|
|
|
#define STEPPER_STEP_PIN GPIO_PIN(0, 0) |
|
|
|
#ifndef STEPPER_PARAM_STEP_PIN |
|
|
|
#define STEPPER_PARAM_STEP_PIN GPIO_PIN(0, 0) |
|
|
|
#endif |
|
|
|
#ifndef STEPPER_DIR_PIN |
|
|
|
#define STEPPER_DIR_PIN GPIO_PIn(0, 1) |
|
|
|
#ifndef STEPPER_PARAM_DIR_PIN |
|
|
|
#define STEPPER_PARAM_DIR_PIN GPIO_PIN(0, 1) |
|
|
|
#endif |
|
|
|
#ifndef STEPPER_UART |
|
|
|
#define STEPPER_UART UART(0) |
|
|
|
#ifndef STEPPER_PARAM_UART |
|
|
|
#define STEPPER_PARAM_UART UART_DEV(0) |
|
|
|
#endif |
|
|
|
#ifndef STEPPER_VEL_MAX |
|
|
|
#define STEPPER_VEL_MAX STEPPER_VEL_MAX_DEFAULT |
|
|
|
#ifndef STEPPER_PARAM_VEL_MAX |
|
|
|
#define STEPPER_PARAM_VEL_MAX STEPPER_PARAM_VEL_MAX_DEFAULT |
|
|
|
#endif |
|
|
|
#ifndef STEPPER_ACC_MAX |
|
|
|
#define STEPPER_ACC_MAX STEPPER_ACC_MAX_DEFAULT |
|
|
|
#ifndef STEPPER_PARAM_ACC_MAX |
|
|
|
#define STEPPER_PARAM_ACC_MAX STEPPER_PARAM_ACC_MAX_DEFAULT |
|
|
|
#endif |
|
|
|
#ifndef STEPPER_MICROSTEP |
|
|
|
#define STEPPER_MICROSTEP STEPPER_MICROSTEP_DEFAULT |
|
|
|
#ifndef STEPPER_PARAM_MICROSTEP |
|
|
|
#define STEPPER_PARAM_MICROSTEP STEPPER_PARAM_MICROSTEP_DEFAULT |
|
|
|
#endif |
|
|
|
#ifndef STEPPER_DIVISION |
|
|
|
#define STEPPER_DIVISION STEPPER_DIVISION_DEFAULT |
|
|
|
#ifndef STEPPER_PARAM_DIVISION |
|
|
|
#define STEPPER_PARAM_DIVISION STEPPER_PARAM_DIVISION_DEFAULT |
|
|
|
#endif |
|
|
|
#ifndef STEPPER_ANGLE |
|
|
|
#define STEPPER_ANGLE STEPPER_ANGLE_DEFAULT |
|
|
|
#ifndef STEPPER_PARAM_ANGLE |
|
|
|
#define STEPPER_PARAM_ANGLE STEPPER_PARAM_ANGLE_DEFAULT |
|
|
|
#endif |
|
|
|
#ifndef STEPPER_VELOCITY |
|
|
|
#define STEPPER_VELOCITY STEPPER_VELOCITY_DEFAULT |
|
|
|
#ifndef STEPPER_PARAM_VELOCITY |
|
|
|
#define STEPPER_PARAM_VELOCITY STEPPER_PARAM_VELOCITY_DEFAULT |
|
|
|
#endif |
|
|
|
#ifndef STEPPER_SENSOR |
|
|
|
#define STEPPER_SENSOR STEPPER_SENSOR_DEFAULT |
|
|
|
#ifndef STEPPER_PARAM_SENSOR |
|
|
|
#define STEPPER_PARAM_SENSOR STEPPER_PARAM_SENSOR_DEFAULT |
|
|
|
#endif |
|
|
|
#ifndef STEPPER_HOMING_ANGLE |
|
|
|
#define STEPPER_HOMING_ANGLE STEPPER_HOMING_ANGLE_DEFAULT |
|
|
|
#ifndef STEPPER_PARAM_HOMING_ANGLE |
|
|
|
#define STEPPER_PARAM_HOMING_ANGLE STEPPER_PARAM_HOMING_ANGLE_DEFAULT |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifndef STEPPER_PARAMS |
|
|
|
#define STEPPER_PARAMS \ |
|
|
|
{ .step_pin = stepper_param_step_pin, \ |
|
|
|
.dir_pin = stepper_param_dir_pin, \ |
|
|
|
.addr = stepper_param_addr, \ |
|
|
|
.vel_max = stepper_param_vel_max, \ |
|
|
|
.acc_max = stepper_param_acc_max, \ |
|
|
|
.microstep = stepper_param_microstep, \ |
|
|
|
.division = stepper_param_division, \ |
|
|
|
.angle = stepper_param_angle, \ |
|
|
|
.velocity = stepper_param_velocity, \ |
|
|
|
.sensor = stepper_param_sensor, \ |
|
|
|
.homing_angle = stepper_param_homing_angle, \ |
|
|
|
{ .step_pin = STEPPER_PARAM_STEP_PIN, \ |
|
|
|
.dir_pin = STEPPER_PARAM_DIR_PIN, \ |
|
|
|
.uart = STEPPER_PARAM_UART, \ |
|
|
|
.vel_max = STEPPER_PARAM_VEL_MAX, \ |
|
|
|
.acc_max = STEPPER_PARAM_ACC_MAX, \ |
|
|
|
.microstep = STEPPER_PARAM_MICROSTEP, \ |
|
|
|
.division = STEPPER_PARAM_DIVISION, \ |
|
|
|
.angle = STEPPER_PARAM_ANGLE, \ |
|
|
|
.velocity = STEPPER_PARAM_VELOCITY, \ |
|
|
|
.homing_angle = STEPPER_PARAM_HOMING_ANGLE, \ |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
|