eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
D4D MATH API Functions Specification
Collaboration diagram for D4D MATH API Functions Specification:

Functions

Byte D4D_MulDivUU8 (Byte u1, Byte u2, Byte d)
 Simple proportion unsigned calculation - 8 bit. More...
 
sByte D4D_MulDivSU8 (sByte s, Byte u, Byte d)
 Simple proportion signed calculation - 8 bit. More...
 
Word D4D_MulDivUU16 (Word u1, Word u2, Word d)
 Simple proportion unsigned calculation - 16 bit. More...
 
sWord D4D_MulDivSU16 (sWord s, Word u, Word d)
 Simple proportion signed calculation - 8 bit. More...
 
Byte D4D_Abs (sByte num)
 Calculation of absolute value - 8 bit. More...
 
Word D4D_Abs16 (sWord num)
 Calculation of absolute value - 16 bit. More...
 
LWord D4D_Abs32 (sLWord num)
 Calculation of absolute value - 32 bit. More...
 
Word D4D_LimitU16 (Word val, Word min, Word max)
 Calculation of limitation value (unsigned) - 16 bit. More...
 
sWord D4D_LimitS16 (sWord val, sWord min, sWord max)
 Calculation of limitation value (signed) - 16 bit. More...
 
Byte D4D_LimitU8 (Byte val, Byte min, Byte max)
 Calculation of limitation value (unsigned) - 8 bit. More...
 
sByte D4D_LimitS8 (sByte val, sByte min, sByte max)
 Calculation of limitation value (signed) - 8 bit. More...
 
sByte D4D_Sin (Byte x)
 Sine calculation using lookup table. More...
 
sByte D4D_Cos (Byte x)
 Cosine calculation using lookup table. More...
 

Detailed Description

This section specifies the exact usage for each API function.

Function Documentation

Byte D4D_Abs ( sByte  num)

Calculation of absolute value - 8 bit.

Parameters
numas signed integer <-128..-1,0..127> ~ <0xFF..0x80,0x00..0x7F>

This function calculates the absolute value (unsigned) of argument num(signed)

Returns
unsigned absolute value <0..0x80> ~ <0..128>

Definition at line 306 of file d4d_math.c.

Here is the caller graph for this function:

Word D4D_Abs16 ( sWord  num)

Calculation of absolute value - 16 bit.

Parameters
numas signed integer <-32768..-1,0..32767> ~ <0xFFFF..0x8000,0x00..0x7FFF>

This function calculates the absolute value (unsigned) of argument num(signed)

Returns
unsigned absolute value <0..0x8000> ~ <0..32768>

Definition at line 325 of file d4d_math.c.

Here is the caller graph for this function:

LWord D4D_Abs32 ( sLWord  num)

Calculation of absolute value - 32 bit.

Parameters
numas signed integer <-2,147,483,648..-1,0..2,147,483,647> ~ <0xFFFFFFFF..0x80000000,0x00000000..0x7FFFFFFF>

This function calculates the absolute value (unsigned) of argument num(signed)

Returns
unsigned absolute value <0..0x80000000> ~ <0..2,147,483,648>

Definition at line 344 of file d4d_math.c.

sByte D4D_Cos ( Byte  x)

Cosine calculation using lookup table.

Parameters
xas unsigned integer <0..0xFF> ~ <0..2PI)

This function calculates the cosine value of argument phase 64 x 8 bit look-up table.

Returns
signed cosine value <-128..-1,0..127> ~ <0xFF..0x80,0x00..0x7F> ~ <-1,+1>

Definition at line 502 of file d4d_math.c.

Here is the caller graph for this function:

sWord D4D_LimitS16 ( sWord  val,
sWord  min,
sWord  max 
)

Calculation of limitation value (signed) - 16 bit.

Parameters
valas signed integer <-32768..-1,0..32767> ~ <0xFFFF..0x8000,0x00..0x7FFF> - value that will be limited
minas signed integer <-32768..-1,0..32767> ~ <0xFFFF..0x8000,0x00..0x7FFF> - minimal limitation value
maxas signed integer <-32768..-1,0..32767> ~ <0xFFFF..0x8000,0x00..0x7FFF> - maximal limitation value

This function calculates the limitation of value by input value borders

Returns
signed limited value <min..max>

Definition at line 394 of file d4d_math.c.

sByte D4D_LimitS8 ( sByte  val,
sByte  min,
sByte  max 
)

Calculation of limitation value (signed) - 8 bit.

Parameters
valas signed integer <-128..-1,0..127> ~ <0xFF..0x80,0x00..0x7F> - value that will be limited
minas signed integer <-128..-1,0..127> ~ <0xFF..0x80,0x00..0x7F> - minimal limitation value
maxas signed integer <-128..-1,0..127> ~ <0xFF..0x80,0x00..0x7F> - maximal limitation value

This function calculates the limitation of value by input value borders

Returns
signed limited value <min..max>

Definition at line 448 of file d4d_math.c.

Here is the caller graph for this function:

Word D4D_LimitU16 ( Word  val,
Word  min,
Word  max 
)

Calculation of limitation value (unsigned) - 16 bit.

Parameters
valas unsigned integer <0..0xFFFF> ~ <0..65535> - value that will be limited
minas unsigned integer <0..0xFFFF> ~ <0..65535> - minimal limitation value
maxas unsigned integer <0..0xFFFF> ~ <0..65535> - maximal limitation value

This function calculates the limitation of value by input value borders

Returns
unsigned limited value <min..max>

Definition at line 367 of file d4d_math.c.

Byte D4D_LimitU8 ( Byte  val,
Byte  min,
Byte  max 
)

Calculation of limitation value (unsigned) - 8 bit.

Parameters
valas unsigned integer <0..0xFF> ~ <0..255> - value that will be limited
minas unsigned integer <0..0xFF> ~ <0..255> - minimal limitation value
maxas unsigned integer <0..0xFF> ~ <0..255> - maximal limitation value

This function calculates the limitation of value by input value borders

Returns
unsigned limited value <min..max>

Definition at line 421 of file d4d_math.c.

sWord D4D_MulDivSU16 ( sWord  s,
Word  u,
Word  d 
)

Simple proportion signed calculation - 8 bit.

Parameters
sas signed integer <-32768..-1,0..32767> ~ <0xFFFF..0x8000,0x00..0x7FFF>
uas unsigned integer <0..0xFFFF> ~ <0..65535>
d(divider) as unsigned integer <0..0xFFFF> ~ <0..65535>

This function calculates the simple proportion value of arguments (s*u) / d

Returns
unsigned simple proportion value <-32768..-1,0..32767> ~ <0xFFFF..0x8000,0x00..0x7FFF>

Definition at line 276 of file d4d_math.c.

Here is the call graph for this function:

sByte D4D_MulDivSU8 ( sByte  s,
Byte  u,
Byte  d 
)

Simple proportion signed calculation - 8 bit.

Parameters
sas signed integer <-128..-1,0..127> ~ <0xFF..0x80,0x00..0x7F>
uas unsigned integer <0..0xFF> ~ <0..255>
d(divider) as unsigned integer <0..0xFF> ~ <0..255>

This function calculates the simple proportion value of arguments (s*u) / d

Returns
unsigned simple proportion value <-128..-1,0..127> ~ <0xFF..0x80,0x00..0x7F>

Definition at line 225 of file d4d_math.c.

Here is the call graph for this function:

Word D4D_MulDivUU16 ( Word  u1,
Word  u2,
Word  d 
)

Simple proportion unsigned calculation - 16 bit.

Parameters
u1as unsigned integer <0..0xFFFF> ~ <0..65535>
u2as unsigned integer <0..0xFFFF> ~ <0..65535>
d(divider) as unsigned integer <0..0xFFFF> ~ <0..65535>

This function calculates the simple proportion value of arguments (u1*u2) / d

Returns
unsigned simple proportion value <0..0xFFFF> ~ <0..65535>

Definition at line 257 of file d4d_math.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Byte D4D_MulDivUU8 ( Byte  u1,
Byte  u2,
Byte  d 
)

Simple proportion unsigned calculation - 8 bit.

Parameters
u1as unsigned integer <0..0xFF> ~ <0..255>
u2as unsigned integer <0..0xFF> ~ <0..255>
d(divider) as unsigned integer <0..0xFF> ~ <0..255>

This function calculates the simple proportion value of arguments (u1*u2) / d

Returns
unsigned simple proportion value <0..255> ~ <0x0..0xFF>

Definition at line 206 of file d4d_math.c.

Here is the call graph for this function:

Here is the caller graph for this function:

sByte D4D_Sin ( Byte  x)

Sine calculation using lookup table.

Parameters
xas unsigned integer <0..0xFF> ~ <0..2PI)

This function calculates the sine value of argument phase 64 x 8 bit look-up table.

Returns
signed sine value <-128..-1,0..127> ~ <0xFF..0x80,0x00..0x7F> ~ <-1,+1>

Definition at line 472 of file d4d_math.c.

Here is the caller graph for this function: