7#define _sign(a) ( ( (a) < 0 ) ? -1 : ( (a) > 0 ) )
9#define _round(x) ((x)>=0?(long)((x)+0.5f):(long)((x)-0.5f))
11#define _constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
12#define _sqrt(a) (_sqrtApprox(a))
13#define _isset(a) ( (a) != (NOT_SET) )
14#define _UNUSED(v) (void) (v)
15#define _powtwo(x) (1 << (x))
17#define _swap(a, b) { auto temp = a; a = b; b = temp; }
20#define _2_SQRT3 1.15470053838f
21#define _SQRT3 1.73205080757f
22#define _1_SQRT3 0.57735026919f
23#define _SQRT3_2 0.86602540378f
24#define _SQRT2 1.41421356237f
25#define _120_D2R 2.09439510239f
26#define _PI 3.14159265359f
27#define _PI_2 1.57079632679f
28#define _PI_3 1.0471975512f
29#define _2PI 6.28318530718f
30#define _3PI_2 4.71238898038f
31#define _PI_6 0.52359877559f
32#define _RPM_TO_RADS 0.10471975512f
34#define NOT_SET -12345.0f
35#define _HIGH_IMPEDANCE 0
36#define _HIGH_Z _HIGH_IMPEDANCE
38#define _NC ((int) NOT_SET)
40#define MIN_ANGLE_DETECT_MOVEMENT (_2PI/101.0f)
@ angle
Position/angle motion control.
float _sqrtApprox(float value)
float _atan2(float y, float x)
float _electricalAngle(float shaft_angle, int pole_pairs)
float _normalizeAngle(float angle)
void _sincos(float a, float *s, float *c)