59 #define Q0n7_FIX1 ((Q0n7) 127)
60 #define Q7n8_FIX1 ((Q7n8) 256)
61 #define Q8n8_FIX1 ((Q8n8) 256)
62 #define Q23n8_FIX1 ((Q23n8) 256)
63 #define Q1n14_FIX1 ((Q1n14) 16384)
64 #define Q1n15_FIX1 ((Q1n15) 32768)
65 #define Q16n16_FIX1 ((Q16n16) 65536)
66 #define Q0n15_FIX1 ((Q0n15) 32767)
67 #define Q0n16_FIX1 ((Q0n16) 65535)
68 #define Q15n0_FIX1 ((Q15n0) 16384)
69 #define Q15n16_FIX1 ((Q15n16) 65536)
70 #define Q8n24_FIX1 ((Q8n24) 16777216)
71 #define Q0n32_FIX1 ((Q0n32) 4294967295)
73 #define Q16n16_PI ((Q16n16) 205887)
74 #define Q3n13_2PI ((Q3n13) 411775)
75 #define Q16n16_2PI ((Q16n16) 411775)
77 #define low15bits ((Q1n15) 32767)
347 return ((int16_t)((((int32_t)(a))*(b))>>8));
409 int16_t ipow(int16_t base, int16_t exp);
415 uint8_t uint8_tRnd(uint8_t min, uint8_t max);
416 uint16_t isqrt16(uint16_t n);
417 uint32_t isqrt32(uint32_t n);
Q0n8 float_to_Q0n8(float a)
Convert float to Q0n8 fix.
Q16n16 float_to_Q16n16(float a)
Convert float to Q16n16 fix.
float Q0n16_to_float(Q0n16 a)
Convert fix to float.
Q8n8 Q0n8_to_Q8n8(Q0n8 a)
Convert Q0n8 uint8_t to Q8n8 fix.
Q0n8 Q8n24_to_Q0n8(Q8n24 a)
Convert Q8n24 fixed to Q0n8 uint8_t.
uint8_t uint8_tMod(uint8_t n, uint8_t d)
fast uint8_t modulus
Q15n16 float_to_Q15n16(float a)
Convert float to Q15n16 fix.
Q0n8 Q16n16_to_Q0n8(Q16n16 a)
Convert Q16n16 fixed to Q0n8 uint8_t.
Q8n0 Q15n16_to_Q8n0(Q15n16 a)
Convert Q15n16 fixed to Q8n0 uint8_t.
uint8_t uint8_tDiv(uint8_t n, uint8_t d)
Fast uint8_t division.
Q24n8 Q16n16_to_Q24n8(Q16n16 a)
Convert Q16n16 fixed to Q24n8 uint32_t.
Q1n14 float_to_Q1n14(float a)
Convert float to Q1n14 fix.
Q15n0 Q23n8_to_Q15n0(Q23n8 a)
Convert Q23n8 fixed to Q15n0 signed int16_t.
Q0n7 float_to_Q0n7(float a)
Convert float to Q0n7 fix.
Q7n8 Q15n16_to_Q7n8(Q15n16 a)
Convert Q15n16 fixed to Q7n8 signed int16_t, keeping middle bits only.
Q7n8 float_to_Q7n8(float a)
Convert float to Q7n8 fix.
Q16n16 Q24n8_to_Q16n16(Q24n8 a)
Convert Q24n8 fixed to Q16n16 uint32_t.
uint16_t Q3n13
unsigned fractional number using 3 integer bits and 13 fractional bits, represents 0 to 7....
Q23n8 float_to_Q23n8(float a)
Convert float to Q23n8 fix.
Q16n16 Q16n16_pow2(Q8n8 exponent)
fast replacement for pow(2,x), where x is a Q8n8 fractional fixed-point exponent.
Q7n8 Q7n8_mult(Q7n8 a, Q7n8 b)
Fast fixed point multiply for Q7n8 fractional numbers.
Q8n24 float_to_Q8n24(float a)
Convert float to Q8n24 fix.
Q8n8 float_to_Q8n8(float a)
Convert float to Q8n8 fix.
uint8_t Q0n8
unsigned fractional number using 8 fractional bits, represents 0.0 to 0.996
uint16_t Q0n16
unsigned fractional number using 16 fractional bits, represents 0.0 to 0.999
int32_t Q15n16
signed fractional number using 15 integer bits and 16 fractional bits, represents -32767....
float Q15n16_to_float(Q15n16 a)
Convert fix to float.
Q1n15 float_to_Q1n15(float a)
Convert float to Q1n15 fix.
Q1n14 Q0n7_to_Q1n14(Q0n7 a)
Convert Q0n7 int8_t to Q1n14 fix.
float Q23n8_to_float(Q23n8 a)
Convert fix to float.
Q7n8 Q8n0_to_Q7n8(Q8n0 a)
Convert Q8n0 uint8_t to Q7n8 fix.
Q0n16 float_to_Q0n16(float a)
Convert float to Q0n16 fix.
uint16_t Q16n0
unsigned number using 16 integer bits and 0 fractional bits, represents 0 to 65536....
Q16n16 Q8n0_to_Q16n16(Q8n0 a)
Convert Q8n0 uint8_t to Q16n16 fix.
int32_t Q31n0
signed (normal int32_t int16_t) number using 31 integer bits and 0 fractional bits,...
uint32_t Q8n24
signed fractional number using 8 integer bits and 24 fractional bits, represents 0 to 255....
Q0n7 Q1n14_to_Q0n7(Q1n14 a)
Convert Q1n14 fixed to Q0n7 int8_t.
Q15n16 Q7n0_to_Q15n16(Q7n0 a)
Convert Q7n0 int8_t to Q15n16 fix.
int16_t Q7n8
signed fractional number using 7 integer bits and 8 fractional bits, represents -127....
Q23n8 Q15n16_to_Q23n8(Q15n16 a)
Convert Q15n16 fixed to Q23n8 signed int32_t.
Q0n8 Q1n15_to_Q0n8(Q1n15 a)
Convert Q1n15 fixed to Q0n8 uint8_t.
float Q8n24_to_float(Q8n24 a)
Convert fix to float.
Q15n16 Q16n0_to_Q15n16(Q16n0 a)
Convert Q16n0 uint16_t to Q15n16 fix.
Q24n8 Q16n0_to_Q24n8(Q16n0 a)
Convert Q16n0 uint16_t to Q24n8 fixed point uint32_t.
Q24n8 Q0n8_to_Q24n8(Q0n8 a)
Convert Q0n8 uint8_t to Q24n8 fix.
int16_t Q0n15
signed fractional number using 0 integer bits and 15 fractional bits, represents -0....
Q7n8 Q7n0_to_Q7n8(Q7n0 a)
Convert Q7n0 int8_t to Q7n8 fix.
int16_t Q1n14
signed fractional number using 1 integer bit and 14 fractional bits, represents -1....
Q16n0 Q16n16_to_Q16n0(Q16n16 a)
Convert Q16n16 fixed to Q16n0 uint16_t.
float Q0n7_to_float(Q0n7 a)
Convert Q0n7 fix to float.
uint16_t Q8n8
unsigned fractional number using 8 integer bits and 8 fractional bits, represents 0 to 255....
Q15n16 Q15n0_to_Q15n16(Q15n0 a)
Convert Q15n0 int16_t to Q15n16 fix.
Q31n0 Q23n8_to_Q31n0(Q23n8 a)
Convert Q23n8 fixed to Q31n0 int32_t.
uint32_t Q0n31
signed number using 0 integer bits and 31 fractional bits, represents -0.2147483648 to 0....
Q8n8 Q8n0_to_Q8n8(Q8n0 a)
Convert uint8_t to Q8n8 fix.
uint32_t Q24n8
unsigned fractional number using 24 integer bits and 8 fractional bits, represents 0 to 16777215
Q0n8 Q24n8_to_Q0n8(Q24n8 a)
Convert Q24n8 fixed to Q0n8 uint8_t.
Q15n16 Q7n8_to_Q15n16(Q7n8 a)
Convert Q7n8 fix to Q15n16.
int16_t Q15n0
signed number using 15 integer bits and 0 fractional bits, represents -32768 to 32767
float Q16n0_to_float(Q16n0 a)
Convert Q16n0 uint16_t to float.
int8_t Q0n7
signed fractional number using 7 fractional bits, represents -0.5 to 0.496
float Q1n15_to_float(Q1n15 a)
Convert fix to float.
Q32n0 Q24n8_to_Q32n0(Q24n8 a)
Convert Q24n8 fixed to Q32n0 uint32_t.
Q15n0 Q15n16_to_Q15n0(Q15n16 a)
Convert Q15n16 fixed to Q15n0 signed int16_t.
int32_t Q23n8
signed fractional number using 23 integer bits and 8 fractional bits, represents -8388607....
Q16n0 Q23n8_to_Q16n0(Q23n8 a)
Convert Q23n8 fixed to Q16n0 uint16_t.
Q7n0 Q7n8_to_Q7n0(Q7n8 a)
Convert Q7n8 fix to Q7n0.
Q1n15 Q0n8_to_Q1n15(Q0n8 a)
Convert Q0n8 uint8_t to Q1n15 fix.
Q23n8 Q16n0_to_Q23n8(Q16n0 a)
Convert Q16n0 uint16_t to Q23n8 fixed point signed int32_t.
float Q7n8_to_float(Q7n8 a)
Convert Q7n8 fix to float.
Q16n16 Q0n8_to_Q16n16(Q0n8 a)
Convert Q0n8 uint8_t to Q16n16 fix.
uint32_t Q16n16
unsigned fractional number using 16 integer bits and 16 fractional bits, represents 0 to 65535....
float Q24n8_to_float(Q24n8 a)
Convert fix to float.
Q16n16 Q8n8_to_Q16n16(Q8n8 a)
Convert Q8n8 fix to Q16n16 uint32_t.
int8_t Q7n0
ordinary old signed Q7n0 int8_t with 0 fractional bits, represents -128 to 127
float Q8n8_to_float(Q8n8 a)
Convert Q8n8 fix to float.
Q15n16 Q8n0_to_Q15n16(Q8n0 a)
Convert Q8n0 uint8_t to Q15n16 fix.
Q16n16 Q16n0_to_Q16n16(Q16n0 a)
Convert Q16n0 uint16_t to Q16n16 fixed point uint32_t.
Q7n8 Q23n8_to_Q7n8(Q23n8 a)
Convert Q23n8 fixed to Q7n8 signed int16_t, losing most significant bits.
Q8n24 Q0n8_to_Q8n24(Q0n8 a)
Convert Q0n8 uint8_t to Q8n24 fix.
Q15n16 Q0n7_to_Q15n16(Q0n7 a)
Convert Q0n7 signed int8_t to Q15n16 fix.
Q15n16 Q0n8_to_Q15n16(Q0n8 a)
Convert Q0n8 uint8_t to Q15n16 fix.
float Q1n14_to_float(Q1n14 a)
Convert fix to float.
Q8n0 Q8n8_to_Q8n0(Q8n8 a)
Convert Q8n8 fix to Q8n0 uint8_t.
float Q0n8_to_float(Q0n8 a)
Convert Q0n8 fix to float.
uint8_t Q8n0
normal uint8_t with 0 fractional bits, represents 0.0 to 255.0
uint16_t Q1n15
unsigned fractional number using 1 integer bit and 15 fractional bits, represents 0 to 1....
uint32_t Q0n32
unsigned fractional number using 0 integer bits and 32 fractional bits, represents 0 to 0....
Q8n8 Q16n16_to_Q8n8(Q8n8 a)
Convert Q16n16 fixed to Q8n8 uint16_t.
Q16n16 Q24n8_to_Q16n0(Q24n8 a)
Convert Q24n8 fixed to Q16n0 uint16_t.
Q8n8 Q15n16_to_Q8n8(Q15n16 a)
Convert Q15n16 fixed to Q8n8 signed int16_t, keeping middle bits only.
Q0n8 Q15n16_to_Q0n8(Q15n16 a)
Convert Q15n16 fixed to Q0n8 uint8_t.
Q24n8 float_to_Q24n8(float a)
Convert float to Q24n8 fix.
uint32_t Q32n0
unsigned (normal uint32_t int16_t) number using 32 integer bits and 0 fractional bits,...
float Q16n16_to_float(Q16n16 a)
Convert fix to float.