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

}<br />

// output should be 14<br />

u16Out = MLIB_Norm_F16(f16In);<br />

// output should be 14<br />

u16Out = MLIB_Norm (f16In,Define F16);<br />

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

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

// as default<br />

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

// output should be 14<br />

u16Out = MLIB_Norm (f16In);<br />

4.163 Function MLIB_Round_F32<br />

The function rounds the first input value <strong>for</strong> number of digits defined by second<br />

parameter <strong>and</strong> saturate automatically.<br />

4.163.1 Declaration<br />

tFrac32 MLIB_Round_F32(register tFrac32 f32In1, register tU16 u16In2);<br />

4.163.2 Arguments<br />

Table 4-200. MLIB_Round_F32 arguments<br />

Type Name Direction Description<br />

register tFrac32 f32In1 input The first value to be rounded.<br />

register tU16 u16In2 input The round digits amount.<br />

4.163.3 Return<br />

32-bit fractional value rounded to the nearest n-bit fractional value where "n" is defined<br />

by the second input value. The bits beyond the 16-bit boundary are discarded.<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 />

642 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!