143 #if (D4D_MCU_TYPE == D4D_HC08) || (D4D_MCU_TYPE == D4D_HCS08)
169 #elif (D4D_MCU_TYPE == D4D_HC12) || (D4D_MCU_TYPE == D4D_HCS12) || (D4D_MCU_TYPE == D4D_HCS12X)
170 return (
Byte)(num/div);
171 #elif (D4D_MCU_TYPE == D4D_MCF51) || (D4D_MCU_TYPE == D4D_MCF52) || (D4D_MCU_TYPE == D4D_MPC51) || (D4D_MCU_TYPE == D4D_MK)
172 return (
Byte)(num/div);
174 #error "Not supported MCU for D4D math divide!"
183 return (
Word)(num/div);
234 return (
sByte)((r > (
Byte)127)? 127 : r);
285 return (
sWord)((r > (
Word)0x7FFF)? 0x7FFF : r);
309 num = (
sByte)(num * -1);
328 num = (
sWord)(num * -1);
Word D4D_MulDivUU16(Word u1, Word u2, Word d)
Simple proportion unsigned calculation - 16 bit.
const sByte d4d_sinTbl[64]
signed long sLWord
Type definition of sLWord (signed 32-bit).
Word D4D_Abs16(sWord num)
Calculation of absolute value - 16 bit.
D4D Driver main header file.
static Byte D4D_Divide8(Word num, Byte div)
Fast 16/8=8 divide operation with rounding and saturation.
sByte D4D_LimitS8(sByte val, sByte min, sByte max)
Calculation of limitation value (signed) - 8 bit.
D4D Driver private header file.
static Word D4D_Divide16(LWord num, Word div)
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
sByte D4D_Sin(Byte x)
Sine calculation using lookup table.
unsigned long LWord
Type definition of LWord (unsigned 32-bit).
signed short sWord
Type definition of sWord (signed 16-bit).
Byte D4D_MulDivUU8(Byte u1, Byte u2, Byte d)
Simple proportion unsigned calculation - 8 bit.
Byte D4D_LimitU8(Byte val, Byte min, Byte max)
Calculation of limitation value (unsigned) - 8 bit.
sWord D4D_LimitS16(sWord val, sWord min, sWord max)
Calculation of limitation value (signed) - 16 bit.
signed char sByte
Type definition of sByte (signed 8-bit).
Word D4D_LimitU16(Word val, Word min, Word max)
Calculation of limitation value (unsigned) - 16 bit.
#define D4D_UNUSED(x)
Macro used just for notify compiler that the input parameter is not used.
sWord D4D_MulDivSU16(sWord s, Word u, Word d)
Simple proportion signed calculation - 8 bit.
Byte D4D_Abs(sByte num)
Calculation of absolute value - 8 bit.
sByte D4D_Cos(Byte x)
Cosine calculation using lookup table.
sByte D4D_MulDivSU8(sByte s, Byte u, Byte d)
Simple proportion signed calculation - 8 bit.
LWord D4D_Abs32(sLWord num)
Calculation of absolute value - 32 bit.
unsigned short Word
Type definition of Word (unsigned 16-bit).