0.3.1

Macros

#define FIX16(x)
 Macro for defininge fix16_t constant values.
 

Typedefs

typedef int32_t fix16_t
 Fixed point Q16.16.
 

Functions

static int32_t fix16_low_mul (fix16_t a, fix16_t b)
 Not yet documented.
 
static int32_t fix16_high_mul (fix16_t a, fix16_t b)
 Not yet documented.
 
static fix16_t fix16_mul (fix16_t a, fix16_t b)
 Not yet documented.
 
static fix16_t fix16_int32_from (int32_t value)
 Not yet documented.
 
static int32_t fix16_int32_to (fix16_t value)
 Not yet documented.
 
static int32_t fix16_round_int32_to (fix16_t value)
 Not yet documented.
 
static uint32_t fix16_integral (fix16_t value)
 Not yet documented.
 
static uint32_t fix16_fractional (fix16_t value)
 Not yet documented.
 
static fix16_t fix16_floor (fix16_t value)
 Not yet documented.
 
static fix16_t fix16_ceil (fix16_t value)
 Not yet documented.
 
bool fix16_overflow_add (fix16_t a, fix16_t b, fix16_t *sum)
 Not yet documented.
 
bool fix16_overflow_sub (fix16_t a, fix16_t b, fix16_t *diff)
 Not yet documented.
 
fix16_t fix16_div (fix16_t dividend, fix16_t divisor)
 Not yet documented.
 
fix16_t fix16_lerp (fix16_t a, fix16_t b, fix16_t t)
 Not yet documented.
 
fix16_t fix16_lerp8 (fix16_t a, fix16_t b, const uint8_t t)
 Not yet documented.
 
fix16_t fix16_sqrt (fix16_t value)
 Not yet documented.
 
size_t fix16_str (fix16_t value, char *buffer, int32_t decimals)
 Not yet documented.
 

Detailed Description

Description goes here.

Macro Definition Documentation

◆ FIX16

#define FIX16 (   x)
Value:
((fix16_t)(((x) >= 0) \
? ((double)(x) * 65536.0 + 0.5) \
: ((double)(x) * 65536.0 - 0.5)))
int32_t fix16_t
Fixed point Q16.16.
Definition: fix16.h:59

Macro for defininge fix16_t constant values.

Note
The argument is evaluated multiple times, and also otherwise you should only use this for constant values. For runtime-conversions, use the inlined functions below.
Parameters
xThe constant value.

Function Documentation

◆ fix16_low_mul()

static int32_t fix16_low_mul ( fix16_t  a,
fix16_t  b 
)
inlinestatic

Not yet documented.

Parameters
aOperand.
bOperand.
Returns
The value.

◆ fix16_high_mul()

static int32_t fix16_high_mul ( fix16_t  a,
fix16_t  b 
)
inlinestatic

Not yet documented.

Parameters
aOperand.
bOperand.
Returns
The value.

◆ fix16_mul()

static fix16_t fix16_mul ( fix16_t  a,
fix16_t  b 
)
inlinestatic

Not yet documented.

Parameters
aOperand.
bOperand.
Returns
The value.

◆ fix16_int32_from()

static fix16_t fix16_int32_from ( int32_t  value)
inlinestatic

Not yet documented.

Parameters
valueOperand.
Returns
The value.

◆ fix16_int32_to()

static int32_t fix16_int32_to ( fix16_t  value)
inlinestatic

Not yet documented.

Parameters
valueOperand.
Returns
The value.

◆ fix16_round_int32_to()

static int32_t fix16_round_int32_to ( fix16_t  value)
inlinestatic

Not yet documented.

Parameters
valueOperand.
Returns
The value.

◆ fix16_integral()

static uint32_t fix16_integral ( fix16_t  value)
inlinestatic

Not yet documented.

Parameters
valueOperand.
Returns
The value.

◆ fix16_fractional()

static uint32_t fix16_fractional ( fix16_t  value)
inlinestatic

Not yet documented.

Parameters
valueOperand.
Returns
The value.

◆ fix16_floor()

static fix16_t fix16_floor ( fix16_t  value)
inlinestatic

Not yet documented.

Parameters
valueOperand.
Returns
The value.

◆ fix16_ceil()

static fix16_t fix16_ceil ( fix16_t  value)
inlinestatic

Not yet documented.

Parameters
valueOperand.
Returns
The value.

◆ fix16_overflow_add()

bool fix16_overflow_add ( fix16_t  a,
fix16_t  b,
fix16_t sum 
)

Not yet documented.

Parameters
aOperand.
bOperand.
[out]sumSum.
Returns
If overflow occurred.

◆ fix16_overflow_sub()

bool fix16_overflow_sub ( fix16_t  a,
fix16_t  b,
fix16_t diff 
)

Not yet documented.

Parameters
aOperand.
bOperand.
[out]diffSum.
Returns
If overflow occurred.

◆ fix16_div()

fix16_t fix16_div ( fix16_t  dividend,
fix16_t  divisor 
)

Not yet documented.

Parameters
dividendOperand.
divisorOperand.
Returns
The value.

◆ fix16_lerp()

fix16_t fix16_lerp ( fix16_t  a,
fix16_t  b,
fix16_t  t 
)

Not yet documented.

Parameters
aOperand.
bOperand.
tOperand.
Returns
The value.

◆ fix16_lerp8()

fix16_t fix16_lerp8 ( fix16_t  a,
fix16_t  b,
const uint8_t  t 
)

Not yet documented.

Parameters
aOperand.
bOperand.
tOperand.
Returns
The value.

◆ fix16_sqrt()

fix16_t fix16_sqrt ( fix16_t  value)

Not yet documented.

Parameters
valueOperand.
Returns
The value.

◆ fix16_str()

size_t fix16_str ( fix16_t  value,
char *  buffer,
int32_t  decimals 
)

Not yet documented.

Parameters
valueNot yet documented.
[out]bufferNot yet documented.
decimalsNot yet documented.
Returns
The string length, not counting the NUL character.