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

4.65.4 Description<br />

The function tests whether the input value is above the lower limit. If so, the input value<br />

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

will be returned.<br />

The lower limit f32LowerLimit can be found in the limits structure, supplied to the<br />

function as a pointer pParam.<br />

4.65.5 Re-entrancy<br />

The function is re-entrant.<br />

4.65.6 Code Example<br />

#include "gflib.h"<br />

tFrac16 f16In;<br />

tFrac16 f16Out;<br />

GFLIB_LOWERLIMIT_T_F16 f16trMyLowerLimit = GFLIB_LOWERLIMIT_DEFAULT_F16;<br />

void main(void)<br />

{<br />

// lower limit<br />

f16trMyLowerLimit.f16LowerLimit = FRAC16 (0.5);<br />

}<br />

// input value = 0.75<br />

f16In = FRAC16 (0.75);<br />

// output should be 0x6000 ~ FRAC16(0.75)<br />

f16Out = GFLIB_LowerLimit_F16 (f16In,&f16trMyLowerLimit);<br />

// output should be 0x6000 ~ FRAC16(0.75)<br />

f16Out = GFLIB_LowerLimit (f16In,&f16trMyLowerLimit,Define F16);<br />

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

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

// as default<br />

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

// output should be 0x6000 ~ FRAC16(0.75)<br />

f16Out = GFLIB_LowerLimit (f16In,&f16trMyLowerLimit);<br />

4.66 Function GFLIB_LowerLimit_FLT<br />

This function tests whether the input value is above the lower 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 />

354 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!