feetech_protocol.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Inria
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
20 #ifndef FEETECH_PROTOCOL_H
21 #define FEETECH_PROTOCOL_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #define FEETECH_START (0xFF)
28 
29 typedef enum {
30  SCS15_B_1M = 0,
31  SCS15_B_0_5M = 1,
32  SCS15_B_250K = 2,
33  SCS15_B_128K = 3,
34  SCS15_B_115200 = 4,
35  SCS15_B_76800 = 5,
36  SCS15_B_57600 = 6,
37  SCS15_B_38400 = 7
38 } scs15_baudrate_t;
39 
40 typedef enum {
41  SCS15_ID = 5,
42  SCS15_BAUD_RATE = 6,
43  SCS15_RETURN_DELAY_TIME = 7,
44  SCS15_RETURN_LEVEL = 8,
45  SCS15_LIMIT_TEMPERATURE = 13,
46  SCS15_MAX_LIMIT_VOLTAGE = 14,
47  SCS15_MIN_LIMIT_VOLTAGE = 15,
48  SCS15_ALARM_LED = 18,
49  SCS15_ALARM_SHUTDOWN = 19,
50  SCS15_COMPLIANCE_P = 21,
51  SCS15_COMPLIANCE_D = 22,
52  SCS15_COMPLIANCE_I = 23,
53  SCS15_CW_DEAD = 26,
54  SCS15_CCW_DEAD = 27,
55  SCS15_TORQUE_ENABLE = 40,
56  SCS15_LED = 41,
57  SCS15_LOCK = 48,
58  SCS15_PRESENT_VOLTAGE = 62,
59  SCS15_PRESENT_TEMPERATURE = 63,
60  SCS15_REGISTERED_INSTRUCTION = 64,
61  SCS15_ERROR = 65,
62  SCS15_MOVING = 66,
63 } scs15_register8_t;
64 
65 typedef enum {
66  SCS15_MODEL_NUMBER = 0,
67  SCS15_VERSION = 3,
68  SCS15_MIN_ANGLE_LIMIT = 9,
69  SCS15_MAX_ANGLE_LIMIT = 11,
70  SCS15_MAX_TORQUE = 16,
71  SCS15_PUNCH = 24,
72  SCS15_IMAX = 28,
73  SCS15_OFFSET = 30,
74  SCS15_GOAL_POSITION = 42,
75  SCS15_GOAL_TIME = 44,
76  SCS15_GOAL_SPEED = 46,
77  SCS15_PRESENT_POSITION = 56,
78  SCS15_PRESENT_SPEED = 58,
79  SCS15_PRESENT_LOAD = 60,
80  SCS15_VIR_POSITION = 67,
81  SCS15_CURRENT = 69,
82 } scs15_register16_t;
83 
84 typedef enum {
85  INST_PING = 0x01,
86  INST_READ = 0x02,
87  INST_WRITE = 0x03,
88  INST_REG_WRITE = 0x04,
89  INST_ACTION = 0x05,
90  INST_RESET = 0x06,
91  INST_SYNC_WRITE = 0x83,
92 } feetech_intruction_t;
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif /* FEETECH_PROTOCOL_H */
99