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.

Function GFLIB_UpperLimit_F16<br />

void main(void)<br />

{<br />

// upper limit<br />

f32trMyUpperLimit.f32UpperLimit = FRAC32 (0.5);<br />

// input value = 0.75<br />

f32In = FRAC32 (0.75);<br />

}<br />

// output should be 0x40000000 ~ FRAC32(0.5)<br />

f32Out = GFLIB_UpperLimit_F32 (f32In,&f32trMyUpperLimit);<br />

// output should be 0x40000000 ~ FRAC32(0.5)<br />

f32Out = GFLIB_UpperLimit (f32In,&f32trMyUpperLimit,Define F32);<br />

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

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

// as default<br />

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

// output should be 0x40000000 ~ FRAC32(0.5)<br />

f32Out = GFLIB_UpperLimit (f32In,&f32trMyUpperLimit);<br />

4.89 Function GFLIB_UpperLimit_F16<br />

This function tests whether the input value is below the upper limit.<br />

4.89.1 Declaration<br />

tFrac16 GFLIB_UpperLimit_F16(tFrac16 f16In, const GFLIB_UPPERLIMIT_T_F16 *const pParam);<br />

4.89.2 Arguments<br />

Table 4-114. GFLIB_UpperLimit_F16 arguments<br />

Type Name Direction Description<br />

tFrac16 f16In input Input value.<br />

const<br />

GFLIB_UPPERLIMIT_T<br />

_F16 *const<br />

4.89.3 Return<br />

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

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

value is above the 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 />

436 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!