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

4.67.6 Code Example<br />

#include "gflib.h"<br />

tFrac32 f32In;<br />

tFrac32 f32Out;<br />

GFLIB_LUT1D_T_F32 trf32MyLut1D = GFLIB_LUT1D_DEFAULT_F32;<br />

tFrac32 pf32Table1D[9] = {FRAC32 (-1),FRAC32 (0),FRAC32 (-0.2),FRAC32<br />

(0),FRAC32 (0.2),<br />

FRAC32 (0),FRAC32 (0.8),FRAC32 (1),FRAC32 (1)};<br />

void main(void)<br />

{<br />

// setting parameters <strong>for</strong> Lut1D function<br />

trf32MyLut1D.pf32Table = &(pf32Table1D[4]);<br />

trf32MyLut1D.s32ShamOffset = 2;<br />

trf32MyLut1D.s32ShamIntvl = 31 - 2;<br />

// input vector = 0.5<br />

f32In = FRAC32 (0.5);<br />

}<br />

// output should be 0x66666666 ~ FRAC32(0.8)<br />

f32Out = GFLIB_Lut1D_F32 (f32In,&trf32MyLut1D);<br />

// output should be 0x66666666 ~ FRAC32(0.8)<br />

f32Out = GFLIB_Lut1D (f32In,&trf32MyLut1D,Define F32);<br />

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

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

// as default<br />

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

// output should be 0x66666666 ~ FRAC32(0.8)<br />

f32Out = GFLIB_Lut1D (f32In,&trf32MyLut1D);<br />

4.68 Function GFLIB_Lut1D_F16<br />

This function implements the one-dimensional look-up table.<br />

4.68.1 Declaration<br />

tFrac16 GFLIB_Lut1D_F16(tFrac16 f16In, const GFLIB_LUT1D_T_F16 *const pParam);<br />

4.68.2 Arguments<br />

Table 4-86. GFLIB_Lut1D_F16 arguments<br />

Type Name Direction Description<br />

tFrac16 f16In input The abscissa <strong>for</strong> which 1D interpolation is per<strong>for</strong>med.<br />

Table continues on the next page...<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 />

360 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!