1
Dependencies: mcp2515 mbed-dev-f303
CAN/CAN.h@0:d80c66cb1b3a, 2020-11-10 (annotated)
- Committer:
- panzhan
- Date:
- Tue Nov 10 09:09:58 2020 +0000
- Revision:
- 0:d80c66cb1b3a
- Child:
- 2:cd74a8cb03b0
panzhan_main_controller_copy2
Who changed what in which revision?
User | Revision | Line number | New 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" |
panzhan | 0:d80c66cb1b3a | 9 | |
panzhan | 0:d80c66cb1b3a | 10 | |
panzhan | 0:d80c66cb1b3a | 11 | // 宏定义 |
panzhan | 0:d80c66cb1b3a | 12 | #define CAN_ID 0x01 // Master CAN ID |
panzhan | 0:d80c66cb1b3a | 13 | |
panzhan | 0:d80c66cb1b3a | 14 | #define P_MIN -12.5f // Value Limits |
panzhan | 0:d80c66cb1b3a | 15 | #define P_MAX 12.5f |
panzhan | 0:d80c66cb1b3a | 16 | #define V_MIN -45.0f |
panzhan | 0:d80c66cb1b3a | 17 | #define V_MAX 45.0f |
panzhan | 0:d80c66cb1b3a | 18 | #define KP_MIN 0.0f |
panzhan | 0:d80c66cb1b3a | 19 | #define KP_MAX 500.0f |
panzhan | 0:d80c66cb1b3a | 20 | #define KD_MIN 0.0f |
panzhan | 0:d80c66cb1b3a | 21 | #define KD_MAX 5.0f |
panzhan | 0:d80c66cb1b3a | 22 | #define T_MIN -18.0f |
panzhan | 0:d80c66cb1b3a | 23 | #define T_MAX 18.0f // Value Limits |
panzhan | 0:d80c66cb1b3a | 24 | |
panzhan | 0:d80c66cb1b3a | 25 | |
panzhan | 0:d80c66cb1b3a | 26 | // 对象外部申明 |
panzhan | 0:d80c66cb1b3a | 27 | extern CAN knee_can,ankle_can; // 设备的外部申明 |
panzhan | 0:d80c66cb1b3a | 28 | extern CANMessage knee_rxMsg, ankle_rxMsg; // 主控收到的CAN消息 |
panzhan | 0:d80c66cb1b3a | 29 | extern CANMessage knee_txMsg, ankle_txMsg; // 主控发送的CAN消息 |
panzhan | 0:d80c66cb1b3a | 30 | |
panzhan | 0:d80c66cb1b3a | 31 | // 函数外部申明 |
panzhan | 0:d80c66cb1b3a | 32 | void pack_cmd(CANMessage * msg, joint_control joint); |
panzhan | 0:d80c66cb1b3a | 33 | void PackAll(); |
panzhan | 0:d80c66cb1b3a | 34 | void WriteAll(); |
panzhan | 0:d80c66cb1b3a | 35 | void unpack_reply(CANMessage msg, leg_state * state); |
panzhan | 0:d80c66cb1b3a | 36 | |
panzhan | 0:d80c66cb1b3a | 37 | |
panzhan | 0:d80c66cb1b3a | 38 | |
panzhan | 0:d80c66cb1b3a | 39 | #endif |