03.08.2013 Views

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Function MLIB_Add_FLT<br />

void main(void)<br />

{<br />

// input value 1 = 0.25<br />

f16In1 = FRAC16 (0.25);<br />

// input value 2 = 0.25<br />

f16In2 = FRAC16 (0.25);<br />

}<br />

// output should be FRAC16(0.5) = 0x4000<br />

f16Out = MLIB_Add_F16(f16In1, f16In2);<br />

// output should be FRAC16(0.5) = 0x4000<br />

f16Out = MLIB_Add (f16In1, f16In2, Define F16);<br />

// ##############################################################<br />

// Available only if 16-bit fractional implementation selected<br />

// as default<br />

// ##############################################################<br />

// output should be FRAC16(0.5) = 0x4000<br />

f16Out = MLIB_Add (f16In1, f16In2);<br />

4.122 Function MLIB_Add_FLT<br />

This function returns sum of two input parameters.<br />

4.122.1 Declaration<br />

tFloat MLIB_Add_FLT(register tFloat fltIn1, register tFloat fltIn2);<br />

4.122.2 Arguments<br />

Table 4-159. MLIB_Add_FLT arguments<br />

Type Name Direction Description<br />

register tFloat fltIn1 input First value to be add.<br />

register tFloat fltIn2 input Second value to be add.<br />

register tFloat fltIn1 input First value to be add<br />

register tFloat fltIn2 input Second value to be add<br />

4.122.3 Return<br />

Sum of two input values.Sum of two input values<br />

<strong>Embedded</strong> <strong>Software</strong> <strong>and</strong> <strong>Motor</strong> <strong>Control</strong> <strong>Libraries</strong> <strong>for</strong> <strong>PXR40xx</strong>, Rev. 1.0<br />

558 Freescale Semiconductor, Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!