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.
 
 
 

122 lines
3.3 KiB

/******************************************************************************
版权所有 (C), 2018-2099, Radkil
******************************************************************************
文 件 名 : msp_TI5MOTOR.h
版 本 号 : 初稿
作 者 : radkil
生成日期 : 2026年6月8日
最近修改 :
功能描述 : msp_TI5MOTOR.c 的头文件
修改历史 :
1.日 期 : 2026年6月8日
作 者 : radkil
修改内容 : 创建文件
******************************************************************************/
/*----------------------------------------------*
* 外部变量说明 *
*----------------------------------------------*/
/*----------------------------------------------*
* 外部函数原型说明 *
*----------------------------------------------*/
/*----------------------------------------------*
* 内部函数原型说明 *
*----------------------------------------------*/
/*----------------------------------------------*
* 全局变量 *
*----------------------------------------------*/
/*----------------------------------------------*
* 模块级变量 *
*----------------------------------------------*/
/*----------------------------------------------*
* 常量定义 *
*----------------------------------------------*/
/*----------------------------------------------*
* 宏定义 *
*----------------------------------------------*/
#ifndef __MSP_TI5MOTOR_H__
#define __MSP_TI5MOTOR_H__
#ifdef __cplusplus
#if __cplusplus
extern "C"{
#endif
#endif /* __cplusplus */
/*==============================================*
* include header files *
*----------------------------------------------*/
#include <stdint.h>
/*==============================================*
* constants or macros define *
*----------------------------------------------*/
typedef struct _MotorParameters {
int32_t MotorID;
int32_t RxIndex;
int32_t Run_Mode;
int32_t Current;
int32_t Target_Current;
int32_t Velcity;
int32_t Target_Velcity;
int32_t Position;
int32_t Target_Position;
int32_t ERROR_Flag;
int32_t Temperature_Motor;
int32_t Temperature_PCB;
int32_t AccTime;
int32_t DecTime;
int32_t EncoderOffset; /* 53 83 设置位置偏移 int32_t "设置偏移值和目标位置
(目标位置=编码器位置 - 偏移值)" */
} MotorParameters;
#pragma pack (2) /*指定按2字节对齐*/
typedef struct _CSP
{
int16_t Current;
int16_t Velocity;
int32_t Position;
} CSP;
typedef struct _TSP
{
int32_t Torque;
int32_t Velocity;
int32_t Position;
} TSP;
#pragma pack () /*取消指定对齐,恢复缺省对齐*/
/*==============================================*
* project-wide global variables *
*----------------------------------------------*/
/*==============================================*
* routines' or functions' implementations *
*----------------------------------------------*/
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* __MSP_TI5MOTOR_H__ */