1
CAN/CAN.h@5:6a95726e45b0, 2019-10-08 (annotated)
- Committer:
- WXD
- Date:
- Tue Oct 08 04:35:23 2019 +0000
- Revision:
- 5:6a95726e45b0
- Child:
- 8:95a914f962bd
qqq
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
WXD | 5:6a95726e45b0 | 1 | #ifndef _CAN_H |
WXD | 5:6a95726e45b0 | 2 | #define _CAN_H |
WXD | 5:6a95726e45b0 | 3 | |
WXD | 5:6a95726e45b0 | 4 | |
WXD | 5:6a95726e45b0 | 5 | // 头文件 |
WXD | 5:6a95726e45b0 | 6 | #include "mbed.h" |
WXD | 5:6a95726e45b0 | 7 | #include "math_ops.h" |
WXD | 5:6a95726e45b0 | 8 | #include "leg_message.h" |
WXD | 5:6a95726e45b0 | 9 | #include "used_leg_message.h" |
WXD | 5:6a95726e45b0 | 10 | |
WXD | 5:6a95726e45b0 | 11 | |
WXD | 5:6a95726e45b0 | 12 | // 宏定义 |
WXD | 5:6a95726e45b0 | 13 | #define CAN_ID 0x01 // Master CAN ID |
WXD | 5:6a95726e45b0 | 14 | |
WXD | 5:6a95726e45b0 | 15 | #define P_MIN -12.5f // Value Limits |
WXD | 5:6a95726e45b0 | 16 | #define P_MAX 12.5f |
WXD | 5:6a95726e45b0 | 17 | #define V_MIN -45.0f |
WXD | 5:6a95726e45b0 | 18 | #define V_MAX 45.0f |
WXD | 5:6a95726e45b0 | 19 | #define KP_MIN 0.0f |
WXD | 5:6a95726e45b0 | 20 | #define KP_MAX 800.0f |
WXD | 5:6a95726e45b0 | 21 | #define KD_MIN 0.0f |
WXD | 5:6a95726e45b0 | 22 | #define KD_MAX 100.0f |
WXD | 5:6a95726e45b0 | 23 | #define T_MIN -18.0f |
WXD | 5:6a95726e45b0 | 24 | #define T_MAX 18.0f // Value Limits |
WXD | 5:6a95726e45b0 | 25 | |
WXD | 5:6a95726e45b0 | 26 | |
WXD | 5:6a95726e45b0 | 27 | // 对象外部申明 |
WXD | 5:6a95726e45b0 | 28 | extern CAN pf_can, df_can; //设备的外部申明 |
WXD | 5:6a95726e45b0 | 29 | extern CANMessage pf_rxMsg, df_rxMsg; // 主控收到的CAN消息 |
WXD | 5:6a95726e45b0 | 30 | extern CANMessage PF_can, DF_can; // 主控发送的CAN消息 |
WXD | 5:6a95726e45b0 | 31 | |
WXD | 5:6a95726e45b0 | 32 | |
WXD | 5:6a95726e45b0 | 33 | // 函数外部申明 |
WXD | 5:6a95726e45b0 | 34 | void pack_cmd(CANMessage * msg, joint_control joint); |
WXD | 5:6a95726e45b0 | 35 | void PackAll(); |
WXD | 5:6a95726e45b0 | 36 | void WriteAll(); |
WXD | 5:6a95726e45b0 | 37 | void unpack_reply(CANMessage msg, ankle_state * ankle); |
WXD | 5:6a95726e45b0 | 38 | |
WXD | 5:6a95726e45b0 | 39 | |
WXD | 5:6a95726e45b0 | 40 | #endif |
WXD | 5:6a95726e45b0 | 41 |