int64_t st2_get_position(st2_motor_t *motor)
Get current position in steps.
Definition: stepper2.c:471
bool st2_motor_move(st2_motor_t *motor, const float move, const float speed, position_t type)
Command a motor to move.
Definition: stepper2.c:386
float st2_motor_set_speed(st2_motor_t *motor, float speed)
Set speed.
Definition: stepper2.c:316
position_t
Definition: stepper2.h:27
@ Stepper2_Steps
0
Definition: stepper2.h:28
@ Stepper2_mm
2
Definition: stepper2.h:30
@ Stepper2_InfiniteSteps
1
Definition: stepper2.h:29
st2_motor_t * st2_motor_init(uint_fast8_t axis_idx, bool is_spindle)
Bind and initialize a motor.
Definition: stepper2.c:251
bool st2_set_position(st2_motor_t *motor, int64_t position)
Set current position in steps.
Definition: stepper2.c:483
void st2_motor_register_stopped_callback(st2_motor_t *motor, foreground_task_ptr callback)
Definition: stepper2.c:208
float st2_get_speed(st2_motor_t *motor)
Get current speed (RPM).
Definition: stepper2.c:303
bool st2_motor_run(st2_motor_t *motor)
Execute a move commanded by st2_motor_move().
Definition: stepper2.c:587
bool st2_motor_bind_spindle(uint_fast8_t axis_idx)
Bind and initialize a motor.
Definition: stepper2.c:219
bool st2_motor_cruising(st2_motor_t *motor)
Check if motor is running in cruising phase.
Definition: stepper2.c:656
bool st2_motor_poll(st2_motor_t *motor)
Check if motor is run by polling.
Definition: stepper2.c:638
bool st2_motor_running(st2_motor_t *motor)
Check if motor is running.
Definition: stepper2.c:647
bool st2_motor_stop(st2_motor_t *motor)
Stop a move. This will initiate deceleration to stop the motor if it is running.
Definition: stepper2.c:609
Internal structure for holding motor configuration and keeping track of its status.
Definition: stepper2.c:45
uint32_t move
Definition: stepper2.c:55
volatile int64_t position
Definition: stepper2.c:52
bool is_spindle
Definition: stepper2.c:48
float speed
Definition: stepper2.c:65
void(* foreground_task_ptr)(void *data)
Definition: task.h:25