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

4.129.2 Arguments<br />

Table 4-166. MLIB_Convert_FLTF16 arguments<br />

Type Name Direction Description<br />

register tFrac16 f16In1 input Input value in 16-bit fractional <strong>for</strong>mat to be converted.<br />

register tFrac16 f16In2 input Scale factor in 16-bit fractional <strong>for</strong>mat.<br />

4.129.3 Return<br />

Converted input value in single precision floating point <strong>for</strong>mat.<br />

4.129.4 Description<br />

This inline function returns converted input value. The input value is considered as 16-bit<br />

fractional data type <strong>and</strong> output value is considered as single precision floating point data<br />

type. The input value represents the values in unity model. The second value represents<br />

the scale factor <strong>and</strong> is considered as 16-bit fractional data type. The sign of the second<br />

value represents the scale mechanism. In case the second value is positive the first input<br />

value is multiplied with the second one <strong>and</strong> converted to the output <strong>for</strong>mat. In case the<br />

second value is negative, the first input value is divided by absolute value of second input<br />

value <strong>and</strong> converted to the output <strong>for</strong>mat. The output saturation is not implemented in this<br />

function.<br />

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

Equation MLIB_Convert_Eq1<br />

Note<br />

Due to effectivity reason this function is implemented as inline<br />

<strong>and</strong> thus is not ANSI-C compliant.<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 />

574 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!