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

}<br />

f32In = FRAC32 (0.5);<br />

// output should be 0x7FFFFFFF ~ FRAC32(1)<br />

f32Out = GFLIB_Sign_F32 (f32In);<br />

// output should be 0x7FFFFFFF ~ FRAC32(1)<br />

f32Out = GFLIB_Sign (f32In,Define F32);<br />

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

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

// as default<br />

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

// output should be 0x7FFFFFFF ~ FRAC32(1)<br />

f32Out = GFLIB_Sign (f32In);<br />

4.77 Function GFLIB_Sign_F16<br />

This function returns the signum of input value.<br />

4.77.1 Declaration<br />

tFrac16 GFLIB_Sign_F16(tFrac16 f16In);<br />

4.77.2 Arguments<br />

Table 4-98. GFLIB_Sign_F16 arguments<br />

Type Name Direction Description<br />

tFrac16 f16In input Input argument.<br />

4.77.3 Return<br />

The function returns the sign of the input argument.<br />

4.77.4 Description<br />

The GFLIB_Sign function calculates the sign of the input argument. The function return<br />

value is computed as follows. If the input value is negative, then the return value will be<br />

set to "-1" (0x8000 hex), if the input value is zero, then the function returns "0" (0x0<br />

hex), otherwise if the input value is greater than zero, the return value will be "1" (0x7fff<br />

hex).<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 />

396 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!