feat: 增加步进电机绝对和相对位置设置函数
This commit is contained in:
@@ -1,10 +1,29 @@
|
||||
#ifndef _BY_STEPPER_H__
|
||||
#define _BY_STEPPER_H__
|
||||
|
||||
#include "at32f413.h"
|
||||
|
||||
typedef enum stepper_speed_t {
|
||||
STEPPER_SPEED_DIV0 = 0,
|
||||
STEPPER_SPEED_DIV2 = 2,
|
||||
STEPPER_SPEED_DIV4 = 4,
|
||||
STEPPER_SPEED_DIV8 = 8,
|
||||
STEPPER_SPEED_DIV16 = 16,
|
||||
STEPPER_SPEED_DIV32 = 32
|
||||
} 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;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user