Steering_Wheel_Infatry/User/device/motor_step.h
2026-01-28 11:48:09 +08:00

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