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

4.85.5 Re-entrancy<br />

The function is re-entrant.<br />

replaced with GFLIB_TAN_DEFAULT_F32 symbol. The<br />

&pParam parameter is m<strong>and</strong>atory.<br />

• With preselected default implementation (i.e.<br />

GFLIB_Tan(f32In, &pParam), where the &pParam is<br />

pointer to approximation coefficients. The &pParam<br />

parameter is optional <strong>and</strong> in case it is not used, the default<br />

GFLIB_TAN_DEFAULT_F32 approximation coefficients<br />

are used.<br />

4.85.6 Code Example<br />

#include "gflib.h"<br />

tFrac32 f32Angle;<br />

tFrac32 f32Output;<br />

void main(void)<br />

{<br />

// input angle = 0.25 => pi/4<br />

f32Angle = FRAC32 (0.25);<br />

}<br />

// output should be 0x7FFFFFFF = 1<br />

f32Output = GFLIB_Tan_F32 (f32Angle, GFLIB_TAN_DEFAULT_F32);<br />

// output should be 0x7FFFFFFF = 1<br />

f32Output = GFLIB_Tan (f32Angle, GFLIB_TAN_DEFAULT_F32, Define F32);<br />

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

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

// as default<br />

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

// output should be 0x7FFFFFFF = 1<br />

f32Output = GFLIB_Tan (f32Angle);<br />

4.86 Function GFLIB_Tan_F16<br />

This function implements polynomial approximation of tangent function.<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 />

424 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!