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

4.87.5 Re-entrancy<br />

The function is re-entrant.<br />

approximation coefficients are used, the &pParam must be<br />

replaced with GFLIB_TAN_DEFAULT_FLT symbol. The<br />

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

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

GFLIB_Tan(fltIn, &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_FLT approximation coefficients<br />

are used.<br />

4.87.6 Code Example<br />

#include "gflib.h"<br />

tFloat fltAngle;<br />

tFloat fltOutput;<br />

void main(void)<br />

{<br />

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

fltAngle = 0.78539816;<br />

}<br />

// output should be 1<br />

fltOutput = GFLIB_Tan_FLT (fltAngle, GFLIB_TAN_DEFAULT_FLT);<br />

// output should be 1<br />

fltOutput = GFLIB_Tan (fltAngle, GFLIB_TAN_DEFAULT_FLT, Define FLT);<br />

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

// Available only if single precision floating point<br />

// implementation selected as default<br />

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

// output should be 1<br />

fltOutput = GFLIB_Tan (fltAngle);<br />

4.88 Function GFLIB_UpperLimit_F32<br />

This function tests whether the input value is below the upper limit.<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 />

434 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!