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.

Note<br />

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

<strong>and</strong> thus is not ANSI-C compliant.<br />

4.134.5 Re-entrancy<br />

The function is re-entrant.<br />

4.134.6 Code Example<br />

#include "mlib.h"<br />

tFloat fltIn;<br />

tFrac16 f16Out;<br />

void main(void)<br />

{<br />

// input value = 0.25<br />

fltIn = 0.25;<br />

}<br />

// output should be FRAC16(0.25) = 0x2000<br />

f16Out = MLIB_ConvertPU_F16FLT(fltIn);<br />

// output should be FRAC16(0.25) = 0x2000<br />

f16Out = MLIB_ConvertPU (fltIn, F16FLT);<br />

4.135 Function MLIB_ConvertPU_FLTF16<br />

This function converts the input value to different representation without scale.<br />

4.135.1 Declaration<br />

tFloat MLIB_ConvertPU_FLTF16(register tFrac16 f16In);<br />

4.135.2 Arguments<br />

Table 4-172. MLIB_ConvertPU_FLTF16 arguments<br />

Type Name Direction Description<br />

Chapter 4 API References<br />

register tFrac16 f16In input Input value in 16-bit fractional <strong>for</strong>mat to be converted.<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 />

Freescale Semiconductor, Inc. 583

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

Saved successfully!

Ooh no, something went wrong!