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.

4.30.5 Re-entrancy<br />

The function is re-entrant.<br />

• With additional implementation parameter (i.e.<br />

GFLIB_Asin(fltIn, &pParam, FLT), where the &pParam is<br />

pointer to approximation coefficients. In case the default<br />

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

replaced with GFLIB_ASIN_DEFAULT_FLT symbol. The<br />

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

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

GFLIB_Asin(fltIn, &pParam), where &pParam is pointer<br />

to approximation coefficients. The &pParam parameter is<br />

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

GFLIB_ASIN_DEFAULT_FLT approximation<br />

coefficients are used.<br />

4.30.6 Code Example<br />

#include "gflib.h"<br />

tFloat fltInput;<br />

tFloat fltAngle;<br />

void main(void)<br />

{<br />

// input fltInput = 1<br />

fltInput = 1;<br />

}<br />

// output should be 1.570796<br />

fltAngle = GFLIB_Asin_FLT (fltInput, GFLIB_ASIN_DEFAULT_FLT);<br />

// output should be 1.570796<br />

fltAngle = GFLIB_Asin (fltInput, GFLIB_ASIN_DEFAULT_FLT, Define FLT);<br />

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

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

// implementation selected as default<br />

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

// output should be 1.570796<br />

fltAngle = GFLIB_Asin (fltInput);<br />

4.31 Function GFLIB_Atan_F32<br />

Chapter 4 API References<br />

This function implements Minimax polynomial approximation of arctangent 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 />

Freescale Semiconductor, Inc. 233

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

Saved successfully!

Ooh no, something went wrong!