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.

}<br />

// output should be FRAC16(0.25)<br />

f16Out = MLIB_Abs (f16In);<br />

4.117 Function MLIB_Abs_FLT<br />

This function returns absolute value of input parameter.<br />

4.117.1 Declaration<br />

tFloat MLIB_Abs_FLT(register tFloat fltIn);<br />

4.117.2 Arguments<br />

Table 4-154. MLIB_Abs_FLT arguments<br />

Type Name Direction Description<br />

register tFloat fltIn input Input value.<br />

register tFloat fltIn input Input value<br />

4.117.3 Return<br />

Absolute value of input parameter.Absolute value of input parameter<br />

4.117.4 Description<br />

This inline function returns the absolute value of input parameter. The input value as well<br />

as output value is considered as single precision floating point data type. The output<br />

saturation is not implemented in this function, thus in case the absolute value of input<br />

parameter is outside the (-2 128 , 2 128 ) interval, the output value will overflow without any<br />

detection.<br />

The output of the function is defined by the following simple equation:<br />

Equation MLIB_Abs_Eq1<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. 547

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

Saved successfully!

Ooh no, something went wrong!