1

Dependencies:   mcp2515 mbed-dev-f303

Committer:
yezhong
Date:
Tue Jan 11 02:19:55 2022 +0000
Revision:
4:2503c88a564f
Parent:
2:cd74a8cb03b0
1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
panzhan 0:d80c66cb1b3a 1 #ifndef _CAN_H
panzhan 0:d80c66cb1b3a 2 #define _CAN_H
panzhan 0:d80c66cb1b3a 3
panzhan 0:d80c66cb1b3a 4 // 头文件
panzhan 0:d80c66cb1b3a 5 #include "mbed.h"
panzhan 0:d80c66cb1b3a 6 #include "math_ops.h"
panzhan 0:d80c66cb1b3a 7 #include "leg_message.h"
panzhan 0:d80c66cb1b3a 8 #include "used_leg_message.h"
yezhong 4:2503c88a564f 9 #include "CAN3.h"
yezhong 4:2503c88a564f 10 #include "mcp2515.h"
panzhan 0:d80c66cb1b3a 11
panzhan 0:d80c66cb1b3a 12 // 宏定义
panzhan 0:d80c66cb1b3a 13 #define CAN_ID 0x01 // Master CAN ID
panzhan 0:d80c66cb1b3a 14
panzhan 0:d80c66cb1b3a 15 #define P_MIN -12.5f // Value Limits
panzhan 0:d80c66cb1b3a 16 #define P_MAX 12.5f
panzhan 0:d80c66cb1b3a 17 #define V_MIN -45.0f
panzhan 0:d80c66cb1b3a 18 #define V_MAX 45.0f
panzhan 0:d80c66cb1b3a 19 #define KP_MIN 0.0f
panzhan 0:d80c66cb1b3a 20 #define KP_MAX 500.0f
panzhan 0:d80c66cb1b3a 21 #define KD_MIN 0.0f
panzhan 0:d80c66cb1b3a 22 #define KD_MAX 5.0f
panzhan 0:d80c66cb1b3a 23 #define T_MIN -18.0f
panzhan 0:d80c66cb1b3a 24 #define T_MAX 18.0f // Value Limits
panzhan 0:d80c66cb1b3a 25
panzhan 0:d80c66cb1b3a 26
panzhan 0:d80c66cb1b3a 27 // 对象外部申明
yezhong 2:cd74a8cb03b0 28 extern CAN pf_can, df_can; //设备的外部申明
yezhong 2:cd74a8cb03b0 29 extern CANMessage pf_rxMsg, df_rxMsg; // 主控收到的CAN消息
yezhong 4:2503c88a564f 30 extern CANMessage pf_txMsg, df_txMsg; // 主控发送的CAN消息
yezhong 4:2503c88a564f 31
yezhong 4:2503c88a564f 32 extern CAN3 df1_can;
yezhong 4:2503c88a564f 33 extern CANMessage df1_txMsg;
yezhong 4:2503c88a564f 34 extern CANMessage df1_rxMsg;
yezhong 4:2503c88a564f 35
panzhan 0:d80c66cb1b3a 36
panzhan 0:d80c66cb1b3a 37 // 函数外部申明
panzhan 0:d80c66cb1b3a 38 void pack_cmd(CANMessage * msg, joint_control joint);
panzhan 0:d80c66cb1b3a 39 void PackAll();
panzhan 0:d80c66cb1b3a 40 void WriteAll();
yezhong 2:cd74a8cb03b0 41 void unpack_reply(CANMessage msg, ankle_state * ankle);
panzhan 0:d80c66cb1b3a 42
panzhan 0:d80c66cb1b3a 43
panzhan 0:d80c66cb1b3a 44
panzhan 0:d80c66cb1b3a 45 #endif