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.
36 lines
904 B
36 lines
904 B
|
11 months ago
|
/*
|
||
|
|
* bsp_Motor_Helper.c
|
||
|
|
*
|
||
|
|
* Created on: Jul 30, 2024
|
||
|
|
* Author: akeguo
|
||
|
|
*/
|
||
|
|
#include "bsp_Motor_Helper.h"
|
||
|
|
#include "bsp_GV.pb.h"
|
||
|
|
#include "msp_Motor.pb.h"
|
||
|
|
struct MotorHelper
|
||
|
|
{
|
||
|
|
MotorParameters* MotorPara;//电机的参数,直接将指针指到GV上
|
||
|
|
|
||
|
|
//Set
|
||
|
|
void (*SetMode)(void);
|
||
|
|
void (*SetVelocity)(void);
|
||
|
|
void (*SetPosition)(void);
|
||
|
|
|
||
|
|
//Read 部分
|
||
|
|
void (*ReadCurrent)(void);
|
||
|
|
void (*ReadPosition)(void);
|
||
|
|
void (*ReadVelocity)(void);
|
||
|
|
void (*ReadError)(void);
|
||
|
|
void (*ReadTemperature_PCB)(void);
|
||
|
|
void (*ReadTemperature_Motor)(void);
|
||
|
|
uint8_t Rx_Buf[256]; // 接收缓存,最大256字节
|
||
|
|
uint8_t Tx_Buf[2048]; // 发送缓存
|
||
|
|
uint16_t TxCount;
|
||
|
|
uint16_t RxCount;
|
||
|
|
|
||
|
|
void (*Motor_Tx)(struct MotorHelper*); //发送数据,不管使用CAN还是用485 都可以进行发送
|
||
|
|
void (*Motor_Rx)(struct MotorHelper*);
|
||
|
|
void (*Motor_Decode)(uint8_t*, uint16_t);
|
||
|
|
|
||
|
|
};
|