30 lines
821 B
C
30 lines
821 B
C
#ifndef _BY_STEPPER_H__
|
|
#define _BY_STEPPER_H__
|
|
|
|
#include "at32f413.h"
|
|
|
|
typedef enum stepper_speed_t {
|
|
STEPPER_SPEED_DIV1 = 1,
|
|
STEPPER_SPEED_DIV2 = 2,
|
|
STEPPER_SPEED_DIV4 = 4,
|
|
STEPPER_SPEED_DIV8 = 8,
|
|
STEPPER_SPEED_DIV16 = 16,
|
|
STEPPER_SPEED_DIV32 = 32
|
|
} stepper_speed_t;
|
|
|
|
extern void by_stepper_set_dir(uint8_t dir);
|
|
extern void by_stepper_set_speed(stepper_speed_t speed);
|
|
extern void by_stepper_init(void);
|
|
extern void by_stepper_run(void);
|
|
extern void by_stepper_stop(uint8_t hold);
|
|
extern void by_stepper_set_position_millimeter(float distance);
|
|
extern void by_stepper_add_position_millimeter(float distance);
|
|
extern void by_stepper_loop(void);
|
|
extern void by_stpepper_int(void);
|
|
|
|
extern int64_t position;
|
|
extern int64_t position_aim;
|
|
extern int64_t position_offset;
|
|
extern uint8_t running_flag;
|
|
|
|
#endif |