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 0x10000000 ~ FRAC32(0.125)<br />

f32Out = MLIB_ShBi (f32In1, s16In2);<br />

4.166 Function MLIB_ShBi_F16<br />

This function shifts the first argument to left or right by number defined by second<br />

argument.<br />

4.166.1 Declaration<br />

tFrac16 MLIB_ShBi_F16(register tFrac16 f16In1, register tS16 s16In2);<br />

4.166.2 Arguments<br />

Table 4-203. MLIB_ShBi_F16 arguments<br />

Type Name Direction Description<br />

register tFrac16 f16In1 input First value to be left shift.<br />

register tS16 s16In2 input The shift amount value.<br />

4.166.3 Return<br />

16-bit fractional value shifted to left or right by the shift amount. The bits beyond the 16bit<br />

boundary are discarded.<br />

4.166.4 Description<br />

Based on sign of second parameter this function shifts the first parameter to right or left.<br />

If the sign of second parameter is negative, shift to right. Overflow is not detected.<br />

Note<br />

The shift amount cannot exceed in magnitude the bit-width of<br />

the shift value, that means must be within the range -15...15.<br />

Otherwise the result of the function is undefined. Due to<br />

effectivity reason this function is implemented as inline <strong>and</strong><br />

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

Chapter 4 API References<br />

Freescale Semiconductor, Inc. 647

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

Saved successfully!

Ooh no, something went wrong!