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

4.79.5 Re-entrancy<br />

The function is re-entrant.<br />

4.79.6 Code Example<br />

#include "gflib.h"<br />

tFrac32 f32Angle;<br />

tFrac32 f32Output;<br />

void main(void)<br />

{<br />

// input angle = 0.5 => pi/2<br />

f32Angle = FRAC32 (0.5);<br />

}<br />

// output should be 0x7FFF8000<br />

f32Output = GFLIB_Sin_F32 (f32Angle, GFLIB_SIN_DEFAULT_F32);<br />

// output should be 0x7FFF8000<br />

f32Output = GFLIB_Sin (f32Angle, GFLIB_SIN_DEFAULT_F32, Define F32);<br />

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

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

// as default<br />

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

// output should be 0x7FFF8000<br />

f32Output = GFLIB_Sin (f32Angle);<br />

4.80 Function GFLIB_Sin_F16<br />

This function implements polynomial approximation of sine function.<br />

4.80.1 Declaration<br />

tFrac16 GFLIB_Sin_F16(tFrac16 f16In, const GFLIB_SIN_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 />

404 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!