Prusa MINI Firmware overview
types.h
Go to the documentation of this file.
1 /**
2  * Marlin 3D Printer Firmware
3  * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4  *
5  * Based on Sprinter and grbl.
6  * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 #pragma once
23 
24 #include <math.h>
25 #include <stddef.h>
26 
27 #include "millis_t.h"
28 
29 //
30 // Enumerated axis indices
31 //
32 // - X_AXIS, Y_AXIS, and Z_AXIS should be used for axes in Cartesian space
33 // - A_AXIS, B_AXIS, and C_AXIS should be used for Steppers, corresponding to XYZ on Cartesians
34 // - X_HEAD, Y_HEAD, and Z_HEAD should be used for Steppers on Core kinematics
35 //
36 enum AxisEnum : uint8_t {
37  X_AXIS = 0, A_AXIS = 0,
38  Y_AXIS = 1, B_AXIS = 1,
39  Z_AXIS = 2, C_AXIS = 2,
40  E_AXIS = 3,
41  X_HEAD = 4, Y_HEAD = 5, Z_HEAD = 6,
42  E0_AXIS = 3,
43  E1_AXIS = 4,
44  E2_AXIS = 5,
45  E3_AXIS = 6,
46  E4_AXIS = 7,
47  E5_AXIS = 8,
48  ALL_AXES = 0xFE, NO_AXIS = 0xFF
49 };
50 
51 //
52 // Loop over XYZE axes
53 //
54 
55 #define LOOP_S_LE_N(VAR, S, N) for (uint8_t VAR=(S); VAR<=(N); VAR++)
56 #define LOOP_S_L_N(VAR, S, N) for (uint8_t VAR=(S); VAR<(N); VAR++)
57 #define LOOP_LE_N(VAR, N) LOOP_S_LE_N(VAR, 0, N)
58 #define LOOP_L_N(VAR, N) LOOP_S_L_N(VAR, 0, N)
59 
60 #define LOOP_XYZ(VAR) LOOP_S_LE_N(VAR, X_AXIS, Z_AXIS)
61 #define LOOP_XYZE(VAR) LOOP_S_LE_N(VAR, X_AXIS, E_AXIS)
62 #define LOOP_XYZE_N(VAR) LOOP_S_L_N(VAR, X_AXIS, XYZE_N)
63 #define LOOP_ABC(VAR) LOOP_S_LE_N(VAR, A_AXIS, C_AXIS)
64 #define LOOP_ABCE(VAR) LOOP_S_LE_N(VAR, A_AXIS, E_AXIS)
65 #define LOOP_ABCE_N(VAR) LOOP_S_L_N(VAR, A_AXIS, XYZE_N)
66 
67 //
68 // Conditional type assignment magic. For example...
69 //
70 // typename IF<(MYOPT==12), int, float>::type myvar;
71 //
72 template <bool, class L, class R>
73 struct IF { typedef R type; };
74 template <class L, class R>
75 struct IF<true, L, R> { typedef L type; };
76 
77 //
78 // feedRate_t is just a humble float
79 //
80 typedef float feedRate_t;
81 
82 // Conversion macros
83 #define MMM_TO_MMS(MM_M) feedRate_t(float(MM_M) / 60.0f)
84 #define MMS_TO_MMM(MM_S) (float(MM_S) * 60.0f)
85 #define MMS_SCALED(V) ((V) * 0.01f * feedrate_percentage)
86 
87 //
88 // Coordinates structures for XY, XYZ, XYZE...
89 //
90 
91 // Helpers
92 #define _RECIP(N) ((N) ? 1.0f / float(N) : 0.0f)
93 #define _ABS(N) ((N) < 0 ? -(N) : (N))
94 #define _LS(N) (N = (T)(uint32_t(N) << v))
95 #define _RS(N) (N = (T)(uint32_t(N) >> v))
96 #define FI FORCE_INLINE
97 
98 // Forward declarations
99 template<typename T> struct XYval;
100 template<typename T> struct XYZval;
101 template<typename T> struct XYZEval;
102 
103 typedef struct XYval<bool> xy_bool_t;
104 typedef struct XYZval<bool> xyz_bool_t;
105 typedef struct XYZEval<bool> xyze_bool_t;
106 
107 typedef struct XYval<char> xy_char_t;
108 typedef struct XYZval<char> xyz_char_t;
109 typedef struct XYZEval<char> xyze_char_t;
110 
111 typedef struct XYval<unsigned char> xy_uchar_t;
112 typedef struct XYZval<unsigned char> xyz_uchar_t;
113 typedef struct XYZEval<unsigned char> xyze_uchar_t;
114 
115 typedef struct XYval<int8_t> xy_int8_t;
116 typedef struct XYZval<int8_t> xyz_int8_t;
117 typedef struct XYZEval<int8_t> xyze_int8_t;
118 
119 typedef struct XYval<uint8_t> xy_uint8_t;
120 typedef struct XYZval<uint8_t> xyz_uint8_t;
121 typedef struct XYZEval<uint8_t> xyze_uint8_t;
122 
123 typedef struct XYval<int16_t> xy_int_t;
124 typedef struct XYZval<int16_t> xyz_int_t;
125 typedef struct XYZEval<int16_t> xyze_int_t;
126 
127 typedef struct XYval<uint16_t> xy_uint_t;
128 typedef struct XYZval<uint16_t> xyz_uint_t;
129 typedef struct XYZEval<uint16_t> xyze_uint_t;
130 
131 typedef struct XYval<int32_t> xy_long_t;
132 typedef struct XYZval<int32_t> xyz_long_t;
133 typedef struct XYZEval<int32_t> xyze_long_t;
134 
135 typedef struct XYval<uint32_t> xy_ulong_t;
136 typedef struct XYZval<uint32_t> xyz_ulong_t;
137 typedef struct XYZEval<uint32_t> xyze_ulong_t;
138 
139 typedef struct XYZval<volatile int32_t> xyz_vlong_t;
140 typedef struct XYZEval<volatile int32_t> xyze_vlong_t;
141 
142 typedef struct XYval<float> xy_float_t;
143 typedef struct XYZval<float> xyz_float_t;
144 typedef struct XYZEval<float> xyze_float_t;
145 
149 
153 
158 
162 
166 
170 
171 // External conversion methods
172 void toLogical(xy_pos_t &raw);
173 void toLogical(xyz_pos_t &raw);
174 void toLogical(xyze_pos_t &raw);
175 void toNative(xy_pos_t &raw);
176 void toNative(xyz_pos_t &raw);
177 void toNative(xyze_pos_t &raw);
178 
179 //
180 // XY coordinates, counters, etc.
181 //
182 template<typename T>
183 struct XYval {
184  union {
185  struct { T x, y; };
186  struct { T a, b; };
187  T pos[2];
188  };
189  FI void set(const T px) { x = px; }
190  FI void set(const T px, const T py) { x = px; y = py; }
191  FI void reset() { x = y = 0; }
192  FI T magnitude() const { return (T)sqrtf(x*x + y*y); }
193  FI operator T* () { return pos; }
194  FI operator bool() { return x || y; }
195  FI XYval<T> copy() const { return *this; }
196  FI XYval<T> ABS() const { return { T(_ABS(x)), T(_ABS(y)) }; }
197  FI XYval<int16_t> asInt() { return { int16_t(x), int16_t(y) }; }
198  FI XYval<int16_t> asInt() const { return { int16_t(x), int16_t(y) }; }
199  FI XYval<int32_t> asLong() { return { int32_t(x), int32_t(y) }; }
200  FI XYval<int32_t> asLong() const { return { int32_t(x), int32_t(y) }; }
201  FI XYval<float> asFloat() { return { float(x), float(y) }; }
202  FI XYval<float> asFloat() const { return { float(x), float(y) }; }
203  FI XYval<float> reciprocal() const { return { _RECIP(x), _RECIP(y) }; }
204  FI XYval<float> asLogical() const { XYval<float> o = asFloat(); toLogical(o); return o; }
205  FI XYval<float> asNative() const { XYval<float> o = asFloat(); toNative(o); return o; }
206  FI operator XYZval<T>() { return { x, y }; }
207  FI operator XYZval<T>() const { return { x, y }; }
208  FI operator XYZEval<T>() { return { x, y }; }
209  FI operator XYZEval<T>() const { return { x, y }; }
210  FI T& operator[](const int i) { return pos[i]; }
211  FI const T& operator[](const int i) const { return pos[i]; }
212  FI XYval<T>& operator= (const T v) { set(v, v ); return *this; }
213  FI XYval<T>& operator= (const XYZval<T> &rs) { set(rs.x, rs.y); return *this; }
214  FI XYval<T>& operator= (const XYZEval<T> &rs) { set(rs.x, rs.y); return *this; }
215  FI XYval<T> operator+ (const XYval<T> &rs) const { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
216  FI XYval<T> operator+ (const XYval<T> &rs) { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
217  FI XYval<T> operator- (const XYval<T> &rs) const { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
218  FI XYval<T> operator- (const XYval<T> &rs) { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
219  FI XYval<T> operator* (const XYval<T> &rs) const { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
220  FI XYval<T> operator* (const XYval<T> &rs) { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
221  FI XYval<T> operator/ (const XYval<T> &rs) const { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
222  FI XYval<T> operator/ (const XYval<T> &rs) { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
223  FI XYval<T> operator+ (const XYZval<T> &rs) const { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
224  FI XYval<T> operator+ (const XYZval<T> &rs) { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
225  FI XYval<T> operator- (const XYZval<T> &rs) const { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
226  FI XYval<T> operator- (const XYZval<T> &rs) { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
227  FI XYval<T> operator* (const XYZval<T> &rs) const { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
228  FI XYval<T> operator* (const XYZval<T> &rs) { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
229  FI XYval<T> operator/ (const XYZval<T> &rs) const { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
230  FI XYval<T> operator/ (const XYZval<T> &rs) { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
231  FI XYval<T> operator+ (const XYZEval<T> &rs) const { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
232  FI XYval<T> operator+ (const XYZEval<T> &rs) { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
233  FI XYval<T> operator- (const XYZEval<T> &rs) const { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
234  FI XYval<T> operator- (const XYZEval<T> &rs) { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
235  FI XYval<T> operator* (const XYZEval<T> &rs) const { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
236  FI XYval<T> operator* (const XYZEval<T> &rs) { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
237  FI XYval<T> operator/ (const XYZEval<T> &rs) const { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
238  FI XYval<T> operator/ (const XYZEval<T> &rs) { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
239  FI XYval<T> operator* (const float &v) const { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }
240  FI XYval<T> operator* (const float &v) { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }
241  FI XYval<T> operator* (const int &v) const { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }
242  FI XYval<T> operator* (const int &v) { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }
243  FI XYval<T> operator/ (const float &v) const { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }
244  FI XYval<T> operator/ (const float &v) { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }
245  FI XYval<T> operator/ (const int &v) const { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }
246  FI XYval<T> operator/ (const int &v) { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }
247  FI XYval<T> operator>>(const int &v) const { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; }
248  FI XYval<T> operator>>(const int &v) { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; }
249  FI XYval<T> operator<<(const int &v) const { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; }
250  FI XYval<T> operator<<(const int &v) { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; }
251  FI XYval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
252  FI XYval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
253  FI XYval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
254  FI XYval<T>& operator+=(const XYZval<T> &rs) { x += rs.x; y += rs.y; return *this; }
255  FI XYval<T>& operator-=(const XYZval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
256  FI XYval<T>& operator*=(const XYZval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
257  FI XYval<T>& operator+=(const XYZEval<T> &rs) { x += rs.x; y += rs.y; return *this; }
258  FI XYval<T>& operator-=(const XYZEval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
259  FI XYval<T>& operator*=(const XYZEval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
260  FI XYval<T>& operator*=(const float &v) { x *= v; y *= v; return *this; }
261  FI XYval<T>& operator*=(const int &v) { x *= v; y *= v; return *this; }
262  FI XYval<T>& operator>>=(const int &v) { _RS(x); _RS(y); return *this; }
263  FI XYval<T>& operator<<=(const int &v) { _LS(x); _LS(y); return *this; }
264  FI bool operator==(const XYval<T> &rs) { return x == rs.x && y == rs.y; }
265  FI bool operator==(const XYZval<T> &rs) { return x == rs.x && y == rs.y; }
266  FI bool operator==(const XYZEval<T> &rs) { return x == rs.x && y == rs.y; }
267  FI bool operator==(const XYval<T> &rs) const { return x == rs.x && y == rs.y; }
268  FI bool operator==(const XYZval<T> &rs) const { return x == rs.x && y == rs.y; }
269  FI bool operator==(const XYZEval<T> &rs) const { return x == rs.x && y == rs.y; }
270  FI bool operator!=(const XYval<T> &rs) { return !operator==(rs); }
271  FI bool operator!=(const XYZval<T> &rs) { return !operator==(rs); }
272  FI bool operator!=(const XYZEval<T> &rs) { return !operator==(rs); }
273  FI bool operator!=(const XYval<T> &rs) const { return !operator==(rs); }
274  FI bool operator!=(const XYZval<T> &rs) const { return !operator==(rs); }
275  FI bool operator!=(const XYZEval<T> &rs) const { return !operator==(rs); }
276  FI XYval<T> operator-() { XYval<T> o = *this; o.x = -x; o.y = -y; return o; }
277  FI const XYval<T> operator-() const { XYval<T> o = *this; o.x = -x; o.y = -y; return o; }
278 };
279 
280 //
281 // XYZ coordinates, counters, etc.
282 //
283 template<typename T>
284 struct XYZval {
285  union {
286  struct { T x, y, z; };
287  struct { T a, b, c; };
288  T pos[3];
289  };
290  FI void set(const T px) { x = px; }
291  FI void set(const T px, const T py) { x = px; y = py; }
292  FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
293  FI void set(const XYval<T> pxy, const T pz) { x = pxy.x; y = pxy.y; z = pz; }
294  FI void reset() { x = y = z = 0; }
295  FI T magnitude() const { return (T)sqrtf(x*x + y*y + z*z); }
296  FI operator T* () { return pos; }
297  FI operator bool() { return z || x || y; }
298  FI XYZval<T> copy() const { XYZval<T> o = *this; return o; }
299  FI XYZval<T> ABS() const { return { T(_ABS(x)), T(_ABS(y)), T(_ABS(z)) }; }
300  FI XYZval<int16_t> asInt() { return { int16_t(x), int16_t(y), int16_t(z) }; }
301  FI XYZval<int16_t> asInt() const { return { int16_t(x), int16_t(y), int16_t(z) }; }
302  FI XYZval<int32_t> asLong() { return { int32_t(x), int32_t(y), int32_t(z) }; }
303  FI XYZval<int32_t> asLong() const { return { int32_t(x), int32_t(y), int32_t(z) }; }
304  FI XYZval<float> asFloat() { return { float(x), float(y), float(z) }; }
305  FI XYZval<float> asFloat() const { return { float(x), float(y), float(z) }; }
306  FI XYZval<float> reciprocal() const { return { _RECIP(x), _RECIP(y), _RECIP(z) }; }
307  FI XYZval<float> asLogical() const { XYZval<float> o = asFloat(); toLogical(o); return o; }
308  FI XYZval<float> asNative() const { XYZval<float> o = asFloat(); toNative(o); return o; }
309  FI operator XYval<T>&() { return *(XYval<T>*)this; }
310  FI operator const XYval<T>&() const { return *(const XYval<T>*)this; }
311  FI operator XYZEval<T>() const { return { x, y, z }; }
312  FI T& operator[](const int i) { return pos[i]; }
313  FI const T& operator[](const int i) const { return pos[i]; }
314  FI XYZval<T>& operator= (const T v) { set(v, v, v ); return *this; }
315  FI XYZval<T>& operator= (const XYval<T> &rs) { set(rs.x, rs.y ); return *this; }
316  FI XYZval<T>& operator= (const XYZEval<T> &rs) { set(rs.x, rs.y, rs.z); return *this; }
317  FI XYZval<T> operator+ (const XYval<T> &rs) const { XYZval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
318  FI XYZval<T> operator+ (const XYval<T> &rs) { XYZval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
319  FI XYZval<T> operator- (const XYval<T> &rs) const { XYZval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
320  FI XYZval<T> operator- (const XYval<T> &rs) { XYZval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
321  FI XYZval<T> operator* (const XYval<T> &rs) const { XYZval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
322  FI XYZval<T> operator* (const XYval<T> &rs) { XYZval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
323  FI XYZval<T> operator/ (const XYval<T> &rs) const { XYZval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
324  FI XYZval<T> operator/ (const XYval<T> &rs) { XYZval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
325  FI XYZval<T> operator+ (const XYZval<T> &rs) const { XYZval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; }
326  FI XYZval<T> operator+ (const XYZval<T> &rs) { XYZval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; }
327  FI XYZval<T> operator- (const XYZval<T> &rs) const { XYZval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; }
328  FI XYZval<T> operator- (const XYZval<T> &rs) { XYZval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; }
329  FI XYZval<T> operator* (const XYZval<T> &rs) const { XYZval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
330  FI XYZval<T> operator* (const XYZval<T> &rs) { XYZval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
331  FI XYZval<T> operator/ (const XYZval<T> &rs) const { XYZval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
332  FI XYZval<T> operator/ (const XYZval<T> &rs) { XYZval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
333  FI XYZval<T> operator+ (const XYZEval<T> &rs) const { XYZval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; }
334  FI XYZval<T> operator+ (const XYZEval<T> &rs) { XYZval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; }
335  FI XYZval<T> operator- (const XYZEval<T> &rs) const { XYZval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; }
336  FI XYZval<T> operator- (const XYZEval<T> &rs) { XYZval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; }
337  FI XYZval<T> operator* (const XYZEval<T> &rs) const { XYZval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
338  FI XYZval<T> operator* (const XYZEval<T> &rs) { XYZval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
339  FI XYZval<T> operator/ (const XYZEval<T> &rs) const { XYZval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
340  FI XYZval<T> operator/ (const XYZEval<T> &rs) { XYZval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
341  FI XYZval<T> operator* (const float &v) const { XYZval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; }
342  FI XYZval<T> operator* (const float &v) { XYZval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; }
343  FI XYZval<T> operator* (const int &v) const { XYZval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; }
344  FI XYZval<T> operator* (const int &v) { XYZval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= z; return ls; }
345  FI XYZval<T> operator/ (const float &v) const { XYZval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; }
346  FI XYZval<T> operator/ (const float &v) { XYZval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; }
347  FI XYZval<T> operator/ (const int &v) const { XYZval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; }
348  FI XYZval<T> operator/ (const int &v) { XYZval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= z; return ls; }
349  FI XYZval<T> operator>>(const int &v) const { XYZval<T> ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); return ls; }
350  FI XYZval<T> operator>>(const int &v) { XYZval<T> ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); return ls; }
351  FI XYZval<T> operator<<(const int &v) const { XYZval<T> ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); return ls; }
352  FI XYZval<T> operator<<(const int &v) { XYZval<T> ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); return ls; }
353  FI XYZval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
354  FI XYZval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
355  FI XYZval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
356  FI XYZval<T>& operator/=(const XYval<T> &rs) { x /= rs.x; y /= rs.y; return *this; }
357  FI XYZval<T>& operator+=(const XYZval<T> &rs) { x += rs.x; y += rs.y; z += rs.z; return *this; }
358  FI XYZval<T>& operator-=(const XYZval<T> &rs) { x -= rs.x; y -= rs.y; z -= rs.z; return *this; }
359  FI XYZval<T>& operator*=(const XYZval<T> &rs) { x *= rs.x; y *= rs.y; z *= rs.z; return *this; }
360  FI XYZval<T>& operator/=(const XYZval<T> &rs) { x /= rs.x; y /= rs.y; z /= rs.z; return *this; }
361  FI XYZval<T>& operator+=(const XYZEval<T> &rs) { x += rs.x; y += rs.y; z += rs.z; return *this; }
362  FI XYZval<T>& operator-=(const XYZEval<T> &rs) { x -= rs.x; y -= rs.y; z -= rs.z; return *this; }
363  FI XYZval<T>& operator*=(const XYZEval<T> &rs) { x *= rs.x; y *= rs.y; z *= rs.z; return *this; }
364  FI XYZval<T>& operator/=(const XYZEval<T> &rs) { x /= rs.x; y /= rs.y; z /= rs.z; return *this; }
365  FI XYZval<T>& operator*=(const float &v) { x *= v; y *= v; z *= v; return *this; }
366  FI XYZval<T>& operator*=(const int &v) { x *= v; y *= v; z *= v; return *this; }
367  FI XYZval<T>& operator>>=(const int &v) { _RS(x); _RS(y); _RS(z); return *this; }
368  FI XYZval<T>& operator<<=(const int &v) { _LS(x); _LS(y); _LS(z); return *this; }
369  FI bool operator==(const XYZEval<T> &rs) { return x == rs.x && y == rs.y && z == rs.z; }
370  FI bool operator!=(const XYZEval<T> &rs) { return !operator==(rs); }
371  FI bool operator==(const XYZEval<T> &rs) const { return x == rs.x && y == rs.y && z == rs.z; }
372  FI bool operator!=(const XYZEval<T> &rs) const { return !operator==(rs); }
373  FI XYZval<T> operator-() { XYZval<T> o = *this; o.x = -x; o.y = -y; o.z = -z; return o; }
374  FI const XYZval<T> operator-() const { XYZval<T> o = *this; o.x = -x; o.y = -y; o.z = -z; return o; }
375 };
376 
377 //
378 // XYZE coordinates, counters, etc.
379 //
380 template<typename T>
381 struct XYZEval {
382  union {
383  struct{ T x, y, z, e; };
384  struct{ T a, b, c; };
385  T pos[4];
386  };
387  FI void reset() { x = y = z = e = 0; }
388  FI T magnitude() const { return (T)sqrtf(x*x + y*y + z*z + e*e); }
389  FI operator T* () { return pos; }
390  FI operator bool() { return e || z || x || y; }
391  FI void set(const T px) { x = px; }
392  FI void set(const T px, const T py) { x = px; y = py; }
393  FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
394  FI void set(const T px, const T py, const T pz, const T pe) { x = px; y = py; z = pz; e = pe; }
395  FI void set(const XYval<T> pxy) { x = pxy.x; y = pxy.y; }
396  FI void set(const XYval<T> pxy, const T pz) { x = pxy.x; y = pxy.y; z = pz; }
397  FI void set(const XYZval<T> pxyz) { x = pxyz.x; y = pxyz.y; z = pxyz.z; }
398  FI void set(const XYval<T> pxy, const T pz, const T pe) { x = pxy.x; y = pxy.y; z = pz; e = pe; }
399  FI void set(const XYval<T> pxy, const XYval<T> pze) { x = pxy.x; y = pxy.y; z = pze.z; e = pze.e; }
400  FI void set(const XYZval<T> pxyz, const T pe) { x = pxyz.x; y = pxyz.y; z = pxyz.z; e = pe; }
401  FI XYZEval<T> copy() const { return *this; }
402  FI XYZEval<T> ABS() const { return { T(_ABS(x)), T(_ABS(y)), T(_ABS(z)), T(_ABS(e)) }; }
403  FI XYZEval<int16_t> asInt() { return { int16_t(x), int16_t(y), int16_t(z), int16_t(e) }; }
404  FI XYZEval<int16_t> asInt() const { return { int16_t(x), int16_t(y), int16_t(z), int16_t(e) }; }
405  FI XYZEval<int32_t> asLong() const { return { int32_t(x), int32_t(y), int32_t(z), int32_t(e) }; }
406  FI XYZEval<int32_t> asLong() { return { int32_t(x), int32_t(y), int32_t(z), int32_t(e) }; }
407  FI XYZEval<float> asFloat() { return { float(x), float(y), float(z), float(e) }; }
408  FI XYZEval<float> asFloat() const { return { float(x), float(y), float(z), float(e) }; }
409  FI XYZEval<float> reciprocal() const { return { _RECIP(x), _RECIP(y), _RECIP(z), _RECIP(e) }; }
410  FI XYZEval<float> asLogical() const { XYZEval<float> o = asFloat(); toLogical(o); return o; }
411  FI XYZEval<float> asNative() const { XYZEval<float> o = asFloat(); toNative(o); return o; }
412  FI operator XYval<T>&() { return *(XYval<T>*)this; }
413  FI operator const XYval<T>&() const { return *(const XYval<T>*)this; }
414  FI operator XYZval<T>&() { return *(XYZval<T>*)this; }
415  FI operator const XYZval<T>&() const { return *(const XYZval<T>*)this; }
416  FI T& operator[](const int i) { return pos[i]; }
417  FI const T& operator[](const int i) const { return pos[i]; }
418  FI XYZEval<T>& operator= (const T v) { set(v, v, v, v); return *this; }
419  FI XYZEval<T>& operator= (const XYval<T> &rs) { set(rs.x, rs.y); return *this; }
420  FI XYZEval<T>& operator= (const XYZval<T> &rs) { set(rs.x, rs.y, rs.z); return *this; }
421  FI XYZEval<T> operator+ (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
422  FI XYZEval<T> operator+ (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }
423  FI XYZEval<T> operator- (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
424  FI XYZEval<T> operator- (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }
425  FI XYZEval<T> operator* (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
426  FI XYZEval<T> operator* (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }
427  FI XYZEval<T> operator/ (const XYval<T> &rs) const { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
428  FI XYZEval<T> operator/ (const XYval<T> &rs) { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }
429  FI XYZEval<T> operator+ (const XYZval<T> &rs) const { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; }
430  FI XYZEval<T> operator+ (const XYZval<T> &rs) { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; return ls; }
431  FI XYZEval<T> operator- (const XYZval<T> &rs) const { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; }
432  FI XYZEval<T> operator- (const XYZval<T> &rs) { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; return ls; }
433  FI XYZEval<T> operator* (const XYZval<T> &rs) const { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
434  FI XYZEval<T> operator* (const XYZval<T> &rs) { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; return ls; }
435  FI XYZEval<T> operator/ (const XYZval<T> &rs) const { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
436  FI XYZEval<T> operator/ (const XYZval<T> &rs) { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; return ls; }
437  FI XYZEval<T> operator+ (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; ls.e += rs.e; return ls; }
438  FI XYZEval<T> operator+ (const XYZEval<T> &rs) { XYZEval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; ls.z += rs.z; ls.e += rs.e; return ls; }
439  FI XYZEval<T> operator- (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; ls.e -= rs.e; return ls; }
440  FI XYZEval<T> operator- (const XYZEval<T> &rs) { XYZEval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; ls.z -= rs.z; ls.e -= rs.e; return ls; }
441  FI XYZEval<T> operator* (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; ls.e *= rs.e; return ls; }
442  FI XYZEval<T> operator* (const XYZEval<T> &rs) { XYZEval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; ls.z *= rs.z; ls.e *= rs.e; return ls; }
443  FI XYZEval<T> operator/ (const XYZEval<T> &rs) const { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.e /= rs.e; return ls; }
444  FI XYZEval<T> operator/ (const XYZEval<T> &rs) { XYZEval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; ls.z /= rs.z; ls.e /= rs.e; return ls; }
445  FI XYZEval<T> operator* (const float &v) const { XYZEval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; }
446  FI XYZEval<T> operator* (const float &v) { XYZEval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; }
447  FI XYZEval<T> operator* (const int &v) const { XYZEval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; }
448  FI XYZEval<T> operator* (const int &v) { XYZEval<T> ls = *this; ls.x *= v; ls.y *= v; ls.z *= v; ls.e *= v; return ls; }
449  FI XYZEval<T> operator/ (const float &v) const { XYZEval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; }
450  FI XYZEval<T> operator/ (const float &v) { XYZEval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; }
451  FI XYZEval<T> operator/ (const int &v) const { XYZEval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; }
452  FI XYZEval<T> operator/ (const int &v) { XYZEval<T> ls = *this; ls.x /= v; ls.y /= v; ls.z /= v; ls.e /= v; return ls; }
453  FI XYZEval<T> operator>>(const int &v) const { XYZEval<T> ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.e); return ls; }
454  FI XYZEval<T> operator>>(const int &v) { XYZEval<T> ls = *this; _RS(ls.x); _RS(ls.y); _RS(ls.z); _RS(ls.e); return ls; }
455  FI XYZEval<T> operator<<(const int &v) const { XYZEval<T> ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.e); return ls; }
456  FI XYZEval<T> operator<<(const int &v) { XYZEval<T> ls = *this; _LS(ls.x); _LS(ls.y); _LS(ls.z); _LS(ls.e); return ls; }
457  FI XYZEval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
458  FI XYZEval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
459  FI XYZEval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
460  FI XYZEval<T>& operator/=(const XYval<T> &rs) { x /= rs.x; y /= rs.y; return *this; }
461  FI XYZEval<T>& operator+=(const XYZval<T> &rs) { x += rs.x; y += rs.y; z += rs.z; return *this; }
462  FI XYZEval<T>& operator-=(const XYZval<T> &rs) { x -= rs.x; y -= rs.y; z -= rs.z; return *this; }
463  FI XYZEval<T>& operator*=(const XYZval<T> &rs) { x *= rs.x; y *= rs.y; z *= rs.z; return *this; }
464  FI XYZEval<T>& operator/=(const XYZval<T> &rs) { x /= rs.x; y /= rs.y; z /= rs.z; return *this; }
465  FI XYZEval<T>& operator+=(const XYZEval<T> &rs) { x += rs.x; y += rs.y; z += rs.z; e += rs.e; return *this; }
466  FI XYZEval<T>& operator-=(const XYZEval<T> &rs) { x -= rs.x; y -= rs.y; z -= rs.z; e -= rs.e; return *this; }
467  FI XYZEval<T>& operator*=(const XYZEval<T> &rs) { x *= rs.x; y *= rs.y; z *= rs.z; e *= rs.e; return *this; }
468  FI XYZEval<T>& operator/=(const XYZEval<T> &rs) { x /= rs.x; y /= rs.y; z /= rs.z; e /= rs.e; return *this; }
469  FI XYZEval<T>& operator*=(const T &v) { x *= v; y *= v; z *= v; e *= v; return *this; }
470  FI XYZEval<T>& operator>>=(const int &v) { _RS(x); _RS(y); _RS(z); _RS(e); return *this; }
471  FI XYZEval<T>& operator<<=(const int &v) { _LS(x); _LS(y); _LS(z); _LS(e); return *this; }
472  FI bool operator==(const XYZval<T> &rs) { return x == rs.x && y == rs.y && z == rs.z; }
473  FI bool operator!=(const XYZval<T> &rs) { return !operator==(rs); }
474  FI bool operator==(const XYZval<T> &rs) const { return x == rs.x && y == rs.y && z == rs.z; }
475  FI bool operator!=(const XYZval<T> &rs) const { return !operator==(rs); }
476  FI XYZEval<T> operator-() { return { -x, -y, -z, -e }; }
477  FI const XYZEval<T> operator-() const { return { -x, -y, -z, -e }; }
478 };
479 
480 #undef _RECIP
481 #undef _ABS
482 #undef _LS
483 #undef _RS
484 #undef FI
485 
486 const xyze_char_t axis_codes { 'X', 'Y', 'Z', 'E' };
XYval::operator!=
FI bool operator!=(const XYZval< T > &rs)
Definition: types.h:271
FI
#define FI
Definition: types.h:96
XYZval::z
T z
Definition: types.h:286
E3_AXIS
Definition: types.h:45
XYval::operator==
FI bool operator==(const XYZval< T > &rs)
Definition: types.h:265
XYval::asFloat
FI XYval< float > asFloat()
Definition: types.h:201
XYZval::pos
T pos[3]
Definition: types.h:288
XYval::operator-=
FI XYval< T > & operator-=(const XYval< T > &rs)
Definition: types.h:252
XYZEval::asLong
FI XYZEval< int32_t > asLong()
Definition: types.h:406
XYval::a
T a
Definition: types.h:186
XYZEval::operator+=
FI XYZEval< T > & operator+=(const XYval< T > &rs)
Definition: types.h:457
XYZval::a
T a
Definition: types.h:287
XYZEval
Definition: types.h:101
XYZEval::z
T z
Definition: types.h:383
XYZEval::operator>>
FI XYZEval< T > operator>>(const int &v)
Definition: types.h:454
XYZEval::asFloat
FI XYZEval< float > asFloat()
Definition: types.h:407
XYZval::set
FI void set(const T px, const T py, const T pz)
Definition: types.h:292
_RECIP
#define _RECIP(N)
Definition: types.h:92
XYZEval::operator<<
FI XYZEval< T > operator<<(const int &v)
Definition: types.h:456
XYZEval::operator<<=
FI XYZEval< T > & operator<<=(const int &v)
Definition: types.h:471
XYZEval::operator<<
FI XYZEval< T > operator<<(const int &v) const
Definition: types.h:455
XYZEval::operator*=
FI XYZEval< T > & operator*=(const T &v)
Definition: types.h:469
XYval::operator+=
FI XYval< T > & operator+=(const XYZEval< T > &rs)
Definition: types.h:257
xyze_pos_t
xyze_float_t xyze_pos_t
Definition: types.h:161
XYval::operator-=
FI XYval< T > & operator-=(const XYZval< T > &rs)
Definition: types.h:255
XYZEval::operator==
FI bool operator==(const XYZval< T > &rs)
Definition: types.h:472
XYZval::operator==
FI bool operator==(const XYZEval< T > &rs) const
Definition: types.h:371
E2_AXIS
Definition: types.h:44
XYZEval::operator*=
FI XYZEval< T > & operator*=(const XYval< T > &rs)
Definition: types.h:459
XYZval::x
T x
Definition: types.h:286
XYval::operator!=
FI bool operator!=(const XYZEval< T > &rs) const
Definition: types.h:275
IF< true, L, R >::type
L type
Definition: types.h:75
XYval::operator!=
FI bool operator!=(const XYZval< T > &rs) const
Definition: types.h:274
XYZval::operator==
FI bool operator==(const XYZEval< T > &rs)
Definition: types.h:369
XYZEval::magnitude
FI T magnitude() const
Definition: types.h:388
XYZval::reset
FI void reset()
Definition: types.h:294
XYZval::operator/
FI XYZval< T > operator/(const XYval< T > &rs) const
Definition: types.h:323
NO_AXIS
Definition: types.h:48
XYZval::operator<<
FI XYZval< T > operator<<(const int &v)
Definition: types.h:352
XYZval::operator*=
FI XYZval< T > & operator*=(const int &v)
Definition: types.h:366
X_AXIS
Definition: types.h:37
XYZEval::set
FI void set(const XYval< T > pxy, const T pz)
Definition: types.h:396
E1_AXIS
Definition: types.h:43
XYZval::operator[]
const FI T & operator[](const int i) const
Definition: types.h:313
XYZEval::operator*=
FI XYZEval< T > & operator*=(const XYZEval< T > &rs)
Definition: types.h:467
XYZEval::asLogical
FI XYZEval< float > asLogical() const
Definition: types.h:410
XYval::operator[]
const FI T & operator[](const int i) const
Definition: types.h:211
XYZEval::operator=
FI XYZEval< T > & operator=(const T v)
Definition: types.h:418
XYZEval::set
FI void set(const XYval< T > pxy, const T pz, const T pe)
Definition: types.h:398
XYZEval::set
FI void set(const XYval< T > pxy)
Definition: types.h:395
XYZEval::operator-=
FI XYZEval< T > & operator-=(const XYZEval< T > &rs)
Definition: types.h:466
XYZEval::operator+
FI XYZEval< T > operator+(const XYval< T > &rs) const
Definition: types.h:421
XYZEval::operator[]
FI T & operator[](const int i)
Definition: types.h:416
XYval::operator*
FI XYval< T > operator*(const XYval< T > &rs) const
Definition: types.h:219
abce_long_t
xyze_long_t abce_long_t
Definition: types.h:155
XYZEval::reciprocal
FI XYZEval< float > reciprocal() const
Definition: types.h:409
XYval::operator+=
FI XYval< T > & operator+=(const XYval< T > &rs)
Definition: types.h:251
abce_ulong_t
xyze_ulong_t abce_ulong_t
Definition: types.h:157
XYZval::operator*=
FI XYZval< T > & operator*=(const float &v)
Definition: types.h:365
XYZval::operator*
FI XYZval< T > operator*(const XYval< T > &rs) const
Definition: types.h:321
C_AXIS
Definition: types.h:39
XYZEval::e
T e
Definition: types.h:383
XYval::operator>>
FI XYval< T > operator>>(const int &v) const
Definition: types.h:247
XYZval::asInt
FI XYZval< int16_t > asInt()
Definition: types.h:300
XYZval::asFloat
FI XYZval< float > asFloat()
Definition: types.h:304
XYZval::operator=
FI XYZval< T > & operator=(const T v)
Definition: types.h:314
xy_byte_t
xy_uint8_t xy_byte_t
Definition: types.h:150
i
uint8_t i
Definition: screen_test_graph.c:72
toNative
void toNative(xy_pos_t &raw)
Definition: motion.h:274
XYZval::set
FI void set(const T px, const T py)
Definition: types.h:291
XYZEval::operator!=
FI bool operator!=(const XYZval< T > &rs)
Definition: types.h:473
XYZval::operator-=
FI XYZval< T > & operator-=(const XYZEval< T > &rs)
Definition: types.h:362
XYZEval::asLong
FI XYZEval< int32_t > asLong() const
Definition: types.h:405
AxisEnum
AxisEnum
Definition: types.h:36
XYZval::operator+=
FI XYZval< T > & operator+=(const XYZval< T > &rs)
Definition: types.h:357
xyz_pos_t
xyz_float_t xyz_pos_t
Definition: types.h:160
XYZval::asFloat
FI XYZval< float > asFloat() const
Definition: types.h:305
XYZval::operator!=
FI bool operator!=(const XYZEval< T > &rs)
Definition: types.h:370
xy_pos_t
xy_float_t xy_pos_t
Definition: types.h:159
XYval::asFloat
FI XYval< float > asFloat() const
Definition: types.h:202
XYZval::operator>>
FI XYZval< T > operator>>(const int &v) const
Definition: types.h:349
XYZval::set
FI void set(const XYval< T > pxy, const T pz)
Definition: types.h:293
XYval::set
FI void set(const T px, const T py)
Definition: types.h:190
XYZval::asInt
FI XYZval< int16_t > asInt() const
Definition: types.h:301
XYZval::operator-
const FI XYZval< T > operator-() const
Definition: types.h:374
XYZval::operator+=
FI XYZval< T > & operator+=(const XYZEval< T > &rs)
Definition: types.h:361
feedRate_t
float feedRate_t
Definition: types.h:80
XYZval::set
FI void set(const T px)
Definition: types.h:290
XYZval::operator>>
FI XYZval< T > operator>>(const int &v)
Definition: types.h:350
XYval::operator!=
FI bool operator!=(const XYval< T > &rs)
Definition: types.h:270
XYZval::operator/=
FI XYZval< T > & operator/=(const XYZEval< T > &rs)
Definition: types.h:364
XYZval::ABS
FI XYZval< T > ABS() const
Definition: types.h:299
XYval::operator==
FI bool operator==(const XYZval< T > &rs) const
Definition: types.h:268
XYZval::operator-
FI XYZval< T > operator-()
Definition: types.h:373
XYval::pos
T pos[2]
Definition: types.h:187
ab_pos_t
ab_float_t ab_pos_t
Definition: types.h:167
math.h
XYZEval::operator[]
const FI T & operator[](const int i) const
Definition: types.h:417
XYval::reset
FI void reset()
Definition: types.h:191
XYZval::magnitude
FI T magnitude() const
Definition: types.h:295
XYval::operator>>=
FI XYval< T > & operator>>=(const int &v)
Definition: types.h:262
XYZval::operator*=
FI XYZval< T > & operator*=(const XYZEval< T > &rs)
Definition: types.h:363
XYZval::operator-=
FI XYZval< T > & operator-=(const XYZval< T > &rs)
Definition: types.h:358
E4_AXIS
Definition: types.h:46
XYZEval::set
FI void set(const T px, const T py)
Definition: types.h:392
XYval::b
T b
Definition: types.h:186
XYZEval::a
T a
Definition: types.h:384
XYZval::b
T b
Definition: types.h:287
XYZEval::c
T c
Definition: types.h:384
XYval::reciprocal
FI XYval< float > reciprocal() const
Definition: types.h:203
XYZval::operator[]
FI T & operator[](const int i)
Definition: types.h:312
XYval::set
FI void set(const T px)
Definition: types.h:189
XYZval::operator*=
FI XYZval< T > & operator*=(const XYZval< T > &rs)
Definition: types.h:359
XYZval::asLong
FI XYZval< int32_t > asLong() const
Definition: types.h:303
XYZval::copy
FI XYZval< T > copy() const
Definition: types.h:298
XYZEval::operator-=
FI XYZEval< T > & operator-=(const XYZval< T > &rs)
Definition: types.h:462
XYZEval::copy
FI XYZEval< T > copy() const
Definition: types.h:401
XYval::asNative
FI XYval< float > asNative() const
Definition: types.h:205
XYZEval::set
FI void set(const XYval< T > pxy, const XYval< T > pze)
Definition: types.h:399
xyz_byte_t
xyz_uint8_t xyz_byte_t
Definition: types.h:151
XYval::magnitude
FI T magnitude() const
Definition: types.h:192
XYZEval::b
T b
Definition: types.h:384
XYZEval::operator+=
FI XYZEval< T > & operator+=(const XYZEval< T > &rs)
Definition: types.h:465
XYZEval::set
FI void set(const T px, const T py, const T pz, const T pe)
Definition: types.h:394
_ABS
#define _ABS(N)
Definition: types.h:93
XYval::operator-
FI XYval< T > operator-()
Definition: types.h:276
millis_t.h
XYZval::operator*=
FI XYZval< T > & operator*=(const XYval< T > &rs)
Definition: types.h:355
XYval::operator+
FI XYval< T > operator+(const XYval< T > &rs) const
Definition: types.h:215
XYval::operator!=
FI bool operator!=(const XYval< T > &rs) const
Definition: types.h:273
XYZEval::asNative
FI XYZEval< float > asNative() const
Definition: types.h:411
XYZval::asLogical
FI XYZval< float > asLogical() const
Definition: types.h:307
XYZval::reciprocal
FI XYZval< float > reciprocal() const
Definition: types.h:306
X_HEAD
Definition: types.h:41
XYZEval::set
FI void set(const T px, const T py, const T pz)
Definition: types.h:393
XYval::operator*=
FI XYval< T > & operator*=(const float &v)
Definition: types.h:260
XYZEval::x
T x
Definition: types.h:383
XYval::asLong
FI XYval< int32_t > asLong()
Definition: types.h:199
ALL_AXES
Definition: types.h:48
XYval::operator+=
FI XYval< T > & operator+=(const XYZval< T > &rs)
Definition: types.h:254
XYval::operator>>
FI XYval< T > operator>>(const int &v)
Definition: types.h:248
XYZEval::operator>>=
FI XYZEval< T > & operator>>=(const int &v)
Definition: types.h:470
_LS
#define _LS(N)
Definition: types.h:94
xyze_byte_t
xyze_uint8_t xyze_byte_t
Definition: types.h:152
XYval
Definition: types.h:99
XYval::ABS
FI XYval< T > ABS() const
Definition: types.h:196
L
#define L(CODE)
Definition: macros.h:76
XYZval::operator+
FI XYZval< T > operator+(const XYval< T > &rs) const
Definition: types.h:317
XYZval::operator/=
FI XYZval< T > & operator/=(const XYZval< T > &rs)
Definition: types.h:360
XYZEval::set
FI void set(const T px)
Definition: types.h:391
XYval::x
T x
Definition: types.h:185
XYval::asLogical
FI XYval< float > asLogical() const
Definition: types.h:204
XYZval::asLong
FI XYZval< int32_t > asLong()
Definition: types.h:302
XYval::operator==
FI bool operator==(const XYval< T > &rs)
Definition: types.h:264
Y_HEAD
Definition: types.h:41
XYval::asInt
FI XYval< int16_t > asInt()
Definition: types.h:197
XYZEval::pos
T pos[4]
Definition: types.h:385
uint8_t
const uint8_t[]
Definition: 404_html.c:3
XYZEval::operator*=
FI XYZEval< T > & operator*=(const XYZval< T > &rs)
Definition: types.h:463
XYval::operator-
const FI XYval< T > operator-() const
Definition: types.h:277
XYval::operator<<
FI XYval< T > operator<<(const int &v)
Definition: types.h:250
XYval::operator*=
FI XYval< T > & operator*=(const XYZEval< T > &rs)
Definition: types.h:259
XYZval::y
T y
Definition: types.h:286
XYZval::operator-=
FI XYZval< T > & operator-=(const XYval< T > &rs)
Definition: types.h:354
XYZEval::operator/=
FI XYZEval< T > & operator/=(const XYval< T > &rs)
Definition: types.h:460
_RS
#define _RS(N)
Definition: types.h:95
XYval::operator<<=
FI XYval< T > & operator<<=(const int &v)
Definition: types.h:263
XYval::asLong
FI XYval< int32_t > asLong() const
Definition: types.h:200
Y_AXIS
Definition: types.h:38
XYval::asInt
FI XYval< int16_t > asInt() const
Definition: types.h:198
XYZEval::operator>>
FI XYZEval< T > operator>>(const int &v) const
Definition: types.h:453
abc_pos_t
abc_float_t abc_pos_t
Definition: types.h:168
XYZval::operator+=
FI XYZval< T > & operator+=(const XYval< T > &rs)
Definition: types.h:353
XYval::operator[]
FI T & operator[](const int i)
Definition: types.h:210
XYval::operator/
FI XYval< T > operator/(const XYval< T > &rs) const
Definition: types.h:221
XYZval::operator/=
FI XYZval< T > & operator/=(const XYval< T > &rs)
Definition: types.h:356
Z_AXIS
Definition: types.h:39
XYZEval::asFloat
FI XYZEval< float > asFloat() const
Definition: types.h:408
A_AXIS
Definition: types.h:37
XYval::operator-=
FI XYval< T > & operator-=(const XYZEval< T > &rs)
Definition: types.h:258
XYZval::operator!=
FI bool operator!=(const XYZEval< T > &rs) const
Definition: types.h:372
ab_float_t
xy_float_t ab_float_t
Definition: types.h:163
E5_AXIS
Definition: types.h:47
XYval::operator==
FI bool operator==(const XYval< T > &rs) const
Definition: types.h:267
XYZEval::operator*
FI XYZEval< T > operator*(const XYval< T > &rs) const
Definition: types.h:425
IF
Definition: types.h:73
XYZEval::operator==
FI bool operator==(const XYZval< T > &rs) const
Definition: types.h:474
XYval::operator*=
FI XYval< T > & operator*=(const XYZval< T > &rs)
Definition: types.h:256
XYval::operator=
FI XYval< T > & operator=(const T v)
Definition: types.h:212
abce_pos_t
abce_float_t abce_pos_t
Definition: types.h:169
XYval::operator<<
FI XYval< T > operator<<(const int &v) const
Definition: types.h:249
XYZEval::operator-
const FI XYZEval< T > operator-() const
Definition: types.h:477
abc_float_t
xyz_float_t abc_float_t
Definition: types.h:164
XYval::y
T y
Definition: types.h:185
XYval::operator==
FI bool operator==(const XYZEval< T > &rs)
Definition: types.h:266
XYval::operator*=
FI XYval< T > & operator*=(const int &v)
Definition: types.h:261
abc_ulong_t
xyz_ulong_t abc_ulong_t
Definition: types.h:156
XYval::operator==
FI bool operator==(const XYZEval< T > &rs) const
Definition: types.h:269
XYZEval::operator/=
FI XYZEval< T > & operator/=(const XYZEval< T > &rs)
Definition: types.h:468
XYval::operator!=
FI bool operator!=(const XYZEval< T > &rs)
Definition: types.h:272
abce_float_t
xyze_float_t abce_float_t
Definition: types.h:165
XYZval::operator<<
FI XYZval< T > operator<<(const int &v) const
Definition: types.h:351
XYZval
Definition: types.h:100
XYval::copy
FI XYval< T > copy() const
Definition: types.h:195
E_AXIS
Definition: types.h:40
IF::type
R type
Definition: types.h:73
B_AXIS
Definition: types.h:38
axis_codes
const xyze_char_t axis_codes
Definition: types.h:486
XYZEval::operator!=
FI bool operator!=(const XYZval< T > &rs) const
Definition: types.h:475
XYZval::c
T c
Definition: types.h:287
XYZEval::operator-=
FI XYZEval< T > & operator-=(const XYval< T > &rs)
Definition: types.h:458
XYZEval::ABS
FI XYZEval< T > ABS() const
Definition: types.h:402
XYZval::operator>>=
FI XYZval< T > & operator>>=(const int &v)
Definition: types.h:367
XYZEval::operator/=
FI XYZEval< T > & operator/=(const XYZval< T > &rs)
Definition: types.h:464
abc_long_t
xyz_long_t abc_long_t
Definition: types.h:154
toLogical
void toLogical(xy_pos_t &raw)
Definition: motion.h:271
Z_HEAD
Definition: types.h:41
XYZEval::operator+=
FI XYZEval< T > & operator+=(const XYZval< T > &rs)
Definition: types.h:461
XYZval::asNative
FI XYZval< float > asNative() const
Definition: types.h:308
XYZEval::asInt
FI XYZEval< int16_t > asInt()
Definition: types.h:403
XYZval::operator<<=
FI XYZval< T > & operator<<=(const int &v)
Definition: types.h:368
XYZEval::reset
FI void reset()
Definition: types.h:387
XYZEval::asInt
FI XYZEval< int16_t > asInt() const
Definition: types.h:404
XYZEval::operator-
FI XYZEval< T > operator-()
Definition: types.h:476
XYZEval::operator/
FI XYZEval< T > operator/(const XYval< T > &rs) const
Definition: types.h:427
E0_AXIS
Definition: types.h:42
XYZEval::set
FI void set(const XYZval< T > pxyz)
Definition: types.h:397
XYval::operator*=
FI XYval< T > & operator*=(const XYval< T > &rs)
Definition: types.h:253
XYZEval::y
T y
Definition: types.h:383
XYZEval::set
FI void set(const XYZval< T > pxyz, const T pe)
Definition: types.h:400