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.

4.61.2 Arguments<br />

Table 4-78. GFLIB_Limit_F32 arguments<br />

Type Name Direction Description<br />

tFrac32 f32In input Input value.<br />

const<br />

GFLIB_LIMIT_T_F32<br />

*const<br />

4.61.3 Return<br />

pParam input Pointer to the limits structure.<br />

The input value in case the input value is below the limits, or the upper or lower limit if<br />

the input value is above these limits.<br />

4.61.4 Description<br />

The GFLIB_Limit function tests whether the input value is within the upper <strong>and</strong> lower<br />

limits. If so, the input value will be returned. If the input value is above the upper limit,<br />

the upper limit will be returned. Similarly, if the input value is below the lower limit, the<br />

lower limit will be returned.<br />

The upper <strong>and</strong> lower limits can be found in the limits structure, supplied to the function<br />

as a pointer pParam.<br />

Note<br />

The function assumes that the upper limit f32UpperLimit is<br />

greater than the lower limit f32LowerLimit. Otherwise, the<br />

function returns an undefined value.<br />

4.61.5 Re-entrancy<br />

The function is re-entrant.<br />

4.61.6 Code Example<br />

#include "gflib.h"<br />

tFrac32 f32In;<br />

tFrac32 f32Out;<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 />

Chapter 4 API References<br />

Freescale Semiconductor, Inc. 347

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

Saved successfully!

Ooh no, something went wrong!