1
CAN/CAN.h@8:95a914f962bd, 2020-01-07 (annotated)
- Committer:
- shaorui
- Date:
- Tue Jan 07 09:23:24 2020 +0000
- Revision:
- 8:95a914f962bd
- Parent:
- 5:6a95726e45b0
1234
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 |
shaorui | 8:95a914f962bd | 20 | #define KP_MAX 5.0f |
WXD | 5:6a95726e45b0 | 21 | #define KD_MIN 0.0f |
shaorui | 8:95a914f962bd | 22 | #define KD_MAX 500.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 | // 对象外部申明 |
shaorui | 8:95a914f962bd | 28 | extern CAN ef_can, wf_can; //设备的外部申明 |
shaorui | 8:95a914f962bd | 29 | extern CANMessage ef_rxMsg, wf_rxMsg; // 主控收到的CAN消息 |
shaorui | 8:95a914f962bd | 30 | extern CANMessage EF_can, WF_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 |