ProtocolDefinitions.hpp
Go to the documentation of this file.
1 /****************************************************************
2  *
3  * Copyright (c) 2011
4  * All rights reserved.
5  *
6  * Hochschule Bonn-Rhein-Sieg
7  * University of Applied Sciences
8  * Computer Science Department
9  *
10  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11  *
12  * Author:
13  * Jan Paulus, Nico Hochgeschwender, Michael Reckhaus, Azamat Shakhimardanov
14  * Supervised by:
15  * Gerhard K. Kraetzschmar
16  *
17  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18  *
19  * This sofware is published under a dual-license: GNU Lesser General Public
20  * License LGPL 2.1 and BSD license. The dual-license implies that users of this
21  * code may choose which terms they prefer.
22  *
23  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
24  *
25  * Redistribution and use in source and binary forms, with or without
26  * modification, are permitted provided that the following conditions are met:
27  *
28  * * Redistributions of source code must retain the above copyright
29  * notice, this list of conditions and the following disclaimer.
30  * * Redistributions in binary form must reproduce the above copyright
31  * notice, this list of conditions and the following disclaimer in the
32  * documentation and/or other materials provided with the distribution.
33  * * Neither the name of the Hochschule Bonn-Rhein-Sieg nor the names of its
34  * contributors may be used to endorse or promote products derived from
35  * this software without specific prior written permission.
36  *
37  * This program is free software: you can redistribute it and/or modify
38  * it under the terms of the GNU Lesser General Public License LGPL as
39  * published by the Free Software Foundation, either version 2.1 of the
40  * License, or (at your option) any later version or the BSD license.
41  *
42  * This program is distributed in the hope that it will be useful,
43  * but WITHOUT ANY WARRANTY; without even the implied warranty of
44  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  * GNU Lesser General Public License LGPL and the BSD license for more details.
46  *
47  * You should have received a copy of the GNU Lesser General Public
48  * License LGPL and BSD license along with this program.
49  *
50  ****************************************************************/
51 
52 #ifndef PROTOCOLDEFINITIONS_HPP
53 #define PROTOCOLDEFINITIONS_HPP
54 
55 namespace youbot {
56 
57 //Opcodes of all TMCL commands that can be used in direct mode
58 typedef enum TMCLCommandNumber {
59  ROR = 1, //Rotate right
60  ROL = 2, //Rotate left
61  MST = 3, //Motor stop
62  MVP = 4, //Move to position
63  SAP = 5, //Set axis parameter
64  GAP = 6, //Get axis parameter
65  STAP = 7, //Store axis parameter into EEPROM
66  RSAP = 8, //Restore axis parameter from EEPROM
67  SGP = 9, //Set global parameter
68  GGP = 10, //Get global parameter
69  STGP = 11, //Store global parameter into EEPROM
70  RSGP = 12, //Restore global parameter from EEPROM
71  RFS = 13,
72  SIO = 14,
73  GIO = 15,
74  SCO = 30,
75  GCO = 31,
76  CCO = 32,
79 
80 #define USER_VARIABLE_BANK 2
81 
82 //Opcodes of TMCL control functions (to be used to run or abort a TMCL program in the module)
83 #define TMCL_APPL_STOP 128
84 #define TMCL_APPL_RUN 129
85 #define TMCL_APPL_RESET 131
86 
87 //Options for MVP commandds
88 #define MVP_ABS 0
89 #define MVP_REL 1
90 #define MVP_COORD 2
91 
92 //Options for RFS command
93 #define RFS_START 0
94 #define RFS_STOP 1
95 #define RFS_STATUS 2
96 
97 //Result codes for GetResult
98 #define TMCL_RESULT_OK 0
99 #define TMCL_RESULT_NOT_READY 1
100 #define TMCL_RESULT_CHECKSUM_ERROR 2
101 
110 };
111 
113  DRIVE = 0,
115 };
116 
117 /*
118 enum ProcessDataErrorFlags {
119  OVER_CURRENT = 1,
120  UNDER_VOLTAGE = 2,
121  OVER_VOLTAGE = 4,
122  OVER_TEMPERATURE = 8,
123  HALTED = 16,
124  HALL_SENSOR = 32,
125  ENCODER = 64,
126  MOTOR_WINDING = 128,
127  CYCLE_TIME_VIOLATION = 256,
128  INIT_SIN_COMM = 512,
129 };
130 */
131 
137  MOTOR_HALTED = 0x10,
139 // ENCODER_ERROR = 0x40,
140 // INITIALIZATION_ERROR = 0x80,
141 // PWM_MODE_ACTIVE = 0x100,
142  VELOCITY_MODE = 0x200,
143  POSITION_MODE = 0x400,
144  TORQUE_MODE = 0x800,
145 // EMERGENCY_STOP = 0x1000,
146 // FREERUNNING = 0x2000,
148  INITIALIZED = 0x8000,
149  TIMEOUT = 0x10000,
150  I2T_EXCEEDED = 0x20000
151 
152 };
153 
154 
156  MAILBOX_SUCCESS = 100, //formerly called "NO_ERROR", renamed due to name clash with Windows define
163 };
164 
168 };
169 
176  OPEN_LOAD_A = 0x20,
177  OPEN_LOAD_B = 0x40,
178  STAND_STILL = 0x80
179 };
180 
181 } // namespace youbot
182 
183 #endif /* PROTOCOLDEFINITIONS_HPP */
184 
enum youbot::TMCLCommandNumber CommandNumber


youbot_driver
Author(s): Jan Paulus
autogenerated on Mon Jun 10 2019 15:46:25