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 GFLIB_VectorLimit_F16<br />

4.91.6 Code Example<br />

F32);<br />

#include "gflib.h"<br />

SWLIBS_2Syst_F32 f32pIn;<br />

SWLIBS_2Syst_F32 f32pOut;<br />

GFLIB_VECTORLIMIT_T_F32 f32trMyVectorLimit = GFLIB_VECTORLIMIT_DEFAULT_F32;<br />

tBool bLim;<br />

void main(void)<br />

{<br />

// desired magnitude of the input vector<br />

f32trMyVectorLimit.f32Limit = FRAC32 (0.25);<br />

// input vector<br />

f32pIn.f32Arg1 = FRAC32 (0.25);<br />

f32pIn.f32Arg2 = FRAC32 (0.25);<br />

}<br />

// output should be: bLim = TRUE;<br />

// f32pOut.f32Arg1 = 0x16A08000 ~ FRAC32(0.17677)<br />

// f32pOut.f32Arg2 = 0x16A08000 ~ FRAC32(0.17677)<br />

bLim = GFLIB_VectorLimit_F32 (&f32pOut,&fp32In,&f32trMyVectorLimit);<br />

// output should be: bLim = TRUE;<br />

// f32pOut.f32Arg1 = 0x16A08000 ~ FRAC32(0.17677)<br />

// f32pOut.f32Arg2 = 0x16A08000 ~ FRAC32(0.17677)<br />

bLim = GFLIB_VectorLimit (&f32pOut,&f32pIn,&f32trMyVectorLimit,Define<br />

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

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

// as default<br />

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

// output should be: bLim = TRUE;<br />

// f32pOut.f32Arg1 = 0x16A08000 ~ FRAC32(0.17677)<br />

// f32pOut.f32Arg2 = 0x16A08000 ~ FRAC32(0.17677)<br />

bLim = GFLIB_VectorLimit (&f32pOut,&f32pIn,&f32trMyVectorLimit);<br />

4.92 Function GFLIB_VectorLimit_F16<br />

This function limits the magnitude of the input vector.<br />

4.92.1 Declaration<br />

tBool GFLIB_VectorLimit_F16(SWLIBS_2Syst_F16 *const pOut, const SWLIBS_2Syst_F16 *const pIn,<br />

const GFLIB_VECTORLIMIT_T_F16 *const pParam);<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 />

442 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!