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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Function MLIB_Mul_FLT<br />

}<br />

fltOut = MLIB_Mul (fltIn1,fltIn2,Define FLT);<br />

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

// Available only if single precision floating point<br />

// implementation selected as default<br />

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

// output should be 1275.125<br />

fltOut = MLIB_Mul (fltIn1,fltIn2);<br />

The output of the function is defined by the following simple equation:<br />

Overflow is not detected.<br />

4.152.7 Re-entrancy<br />

The function is re-entrant.<br />

4.152.8 Code Example<br />

#include "mlib.h"<br />

tFloat fltIn1;<br />

tFloat fltIn2;<br />

tFloat fltOut;<br />

void main(void)<br />

{<br />

// first input = 50.5<br />

fltIn1 = 50.5;<br />

}<br />

Equation MLIB_Mul_Eq1<br />

// second input = 25.25<br />

fltIn2 = 25.25;<br />

Note<br />

// output should be 1275.125<br />

fltOut = MLIB_Mul_FLT(fltIn1,fltIn2);<br />

// output should be 1275.125<br />

fltOut = MLIB_Mul (fltIn1,fltIn2,Define FLT);<br />

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

// Available only if single precision floating point<br />

// implementation selected as default<br />

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

// output should be 1275.125<br />

fltOut = MLIB_Mul (fltIn1,fltIn2);<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 />

622 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!