仓库提交练习
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.0 KiB

/*
* motor.h
*
* Created on: 2026420
* Author: Lizongdi
*/
#ifdef BUILD_CANMOTOR
#ifndef FSM_INC_MOTOR_H_
#define FSM_INC_MOTOR_H_
#include "bsp_FDCAN.h"
#include "BHBF_ROBOT.h"
typedef enum
{
M_TYPE_MOVELEFT,
M_TYPE_MOVERIGHT,
M_TYPE_SWING
}EMotorType;
typedef struct
{
int32_t MotorID;
EMotorType MotorType;
int32_t HeartbeatID;
FDCANHandler *fHandler;
TT_MotorParameters *pMotorParam;
}TMotorCtrl;
/*待适配接口*/
void MotorGetState(TMotorCtrl *ptMotorCtrl, char *buffer);
void WheelFuncInit(TMotorCtrl *ptLeftMotorCtrl, TMotorCtrl *ptRightMotorCtrl);
void WheelFuncProc(TMotorCtrl *ptLeftMotorCtrl, TMotorCtrl *ptRightMotorCtrl);
void WheelSetVelcity(TMotorCtrl *ptMotorCtrl, float fSpeed_M_min);
void SwingFuncInit(TMotorCtrl *ptMotorCtrl);
void SwingFuncProc(TMotorCtrl *ptMotorCtrl);
void SwingSetPosition(TMotorCtrl *ptMotorCtrl, float fPositionAngle, int32_t iVelcityDegreeS);
/*对外接口声明*/
void MotorInit(void);
#endif
#endif /* FSM_INC_MOTOR_H_ */