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

}<br />

f32In1 = FRAC32 (0.25);<br />

// second input = -1<br />

s16In2 = -1;<br />

// output should be 0x10000000 ~ FRAC32(0.125)<br />

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

// output should be 0x10000000 ~ FRAC32(0.125)<br />

f32Out = MLIB_ShBiSat (f32In1, s16In2, Define F32);<br />

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

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

// as default<br />

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

// output should be 0x10000000 ~ FRAC32(0.125)<br />

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

4.168 Function MLIB_ShBiSat_F16<br />

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

argument <strong>and</strong> saturate if necessary.<br />

4.168.1 Declaration<br />

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

4.168.2 Arguments<br />

Table 4-205. MLIB_ShBiSat_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.168.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 />

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

650 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!