39 lines
724 B
C
39 lines
724 B
C
/*
|
|
* 步进电机
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Includes ----------------------------------------------------------------- */
|
|
#include "cmsis_os2.h"
|
|
#include <stdbool.h>
|
|
/* Exported constants ------------------------------------------------------- */
|
|
|
|
|
|
/* Exported macro ----------------------------------------------------------- */
|
|
/* Exported types ----------------------------------------------------------- */
|
|
typedef struct{
|
|
|
|
/* 脉冲个数 */
|
|
int pulse;
|
|
/* 脉冲间隔 */
|
|
float time;
|
|
|
|
/* 方向 */
|
|
bool direction;
|
|
/* 状态 */
|
|
int state;
|
|
|
|
}STEP_MOTOR;
|
|
|
|
int8_t Motor_Step_Init(STEP_MOTOR *param);
|
|
int8_t Motor_Step_Ctrl(STEP_MOTOR *param);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|