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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Function GFLIB_Cos_FLT<br />

4.53.5 Re-entrancy<br />

The function is re-entrant.<br />

4.53.6 Code Example<br />

#include "gflib.h"<br />

tFrac16 f16Angle;<br />

tFrac16 f16Output;<br />

void main(void)<br />

{<br />

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

f16Angle = FRAC16 (0.25);<br />

}<br />

// output should be 0x5A82<br />

f16Output = GFLIB_Cos_F16 (f16Angle, GFLIB_COS_DEFAULT_F16);<br />

// output should be 0x5A82<br />

f16Output = GFLIB_Cos (f16Angle, GFLIB_COS_DEFAULT_F16, Define F16);<br />

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

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

// as default<br />

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

// output should be 0x5A82<br />

f16Output = GFLIB_Cos (f16Angle);<br />

4.54 Function GFLIB_Cos_FLT<br />

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

4.54.1 Declaration<br />

tFloat GFLIB_Cos_FLT(tFloat fltIn, const GFLIB_COS_T_FLT *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 />

326 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!