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.

Function MLIB_AddSat_F16<br />

4.124.2 Arguments<br />

Table 4-161. MLIB_AddSat_F16 arguments<br />

Type Name Direction Description<br />

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

register tFrac16 f16In2 input Second value to be add.<br />

register tFrac16 f16In1 input First value to be add<br />

register tFrac16 f16In2 input Second value to be add<br />

4.124.3 Return<br />

Sum of two input values, saturated if necessary.Sum of two input values, saturated if<br />

necessary<br />

4.124.4 Description<br />

This inline function returns the sum of two input values. The input values as well as<br />

output value is considered as 16-bit fractional data type. The output saturation is<br />

implemented in this function, thus in case the sum of input values is outside the (-1, 1)<br />

interval, the output value is limited to the boundary value.<br />

The output of the function is defined by the following simple equation:<br />

Equation MLIB_AddSat_Eq1<br />

This inline function returns the sum of two input values. The input values as well as<br />

output value is considered as 16-bit fractional data type. The output saturation is<br />

implemented in this function, thus in case the sum of input values is outside the (-1, 1)<br />

interval, the output value is limited to the boundary value.<br />

Note<br />

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

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

564 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!