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.

4.177.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 />

// second input = 25.25<br />

fltIn2 = 25.25;<br />

// output should be 25.25<br />

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

// output should be 25.25<br />

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

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

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

// implementation selected as default<br />

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

// output should be 25.25<br />

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

4.178 Function MLIB_SubSat_F32<br />

This function subtracts the second parameter from the first one <strong>and</strong> saturate if necessary.<br />

4.178.1 Declaration<br />

tFrac32 MLIB_SubSat_F32(register tFrac32 f32In1, register tFrac32 f32In2);<br />

4.178.2 Arguments<br />

Table 4-215. MLIB_SubSat_F32 arguments<br />

Type Name Direction Description<br />

Chapter 4 API References<br />

register tFrac32 f32In1 input Oper<strong>and</strong> is a 32-bit number normalized between [-1,1).<br />

register tFrac32 f32In2 input Oper<strong>and</strong> is a 32-bit number normalized between [-1,1).<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 />

Freescale Semiconductor, Inc. 669

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

Saved successfully!

Ooh no, something went wrong!