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

}<br />

f16In1 = FRAC16 (0.25);<br />

// second input = 1<br />

u16In2 = 1;<br />

// output should be 0x4000 ~ FRAC16(0.5)<br />

f16Out = MLIB_ShLSat_F16(f16In1, u16In2);<br />

// output should be 0x4000 ~ FRAC16(0.5)<br />

f16Out = MLIB_ShLSat (f16In1, u16In2, Define F16);<br />

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

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

// as default<br />

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

// output should be 0x4000 ~ FRAC16(0.5)<br />

f16Out = MLIB_ShLSat (f16In1, u16In2);<br />

4.173 Function MLIB_ShR_F32<br />

This function shifts the first parameter to right by number defined by second parameter.<br />

4.173.1 Declaration<br />

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

4.173.2 Arguments<br />

Table 4-210. MLIB_ShR_F32 arguments<br />

Type Name Direction Description<br />

register tFrac32 f32In1 input First value to be right shift.<br />

register tU16 u16In2 input The shift amount value.<br />

4.173.3 Return<br />

32-bit fractional value shifted right by the shift amount. The bits beyond the 32-bit<br />

boundary of the result are discarded.<br />

4.173.4 Description<br />

This function shifts the first argument to right by number defined by second argument.<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 />

658 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!