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.

4.155.3 Return<br />

Fractional multiplication of the input arguments.Fractional multiplication of the input<br />

arguments.<br />

4.155.4 Description<br />

Fractional multiplication of two fractional 16-bit values. The input values as well as<br />

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

implemented in this function, thus in case the multiplication of input values is outside the<br />

(-1, 1) 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_MulSat_Eq1<br />

Fractional multiplication of two fractional 16-bit values. The input values as well as<br />

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

implemented in this function, thus in case the multiplication of input values is outside the<br />

(-1, 1) interval, the output value is limited to the boundary value.<br />

Note<br />

Overflow is detected. The functions saturates the return value if<br />

it cannot fit into the return type.<br />

4.155.5 Re-entrancy<br />

The function is re-entrant.<br />

4.155.6 Code Example<br />

#include "mlib.h"<br />

tFrac16 f16In1;<br />

tFrac16 f16In2;<br />

tFrac16 f16Out;<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. 629

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

Saved successfully!

Ooh no, something went wrong!