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.

For example if the MCLIB_DEFAULT_IMPLEMENTATION macro definition is set to<br />

MCLIB_DEFAULT_IMPLEMENTATION_F32, the 32-bit fixed-point implementation of<br />

sine function is invoked after the GFLIB_Sin(x) API call. Note that all st<strong>and</strong>ard legacy<br />

API calls will invoke the 32-bit fixed-point implementation in this example.<br />

2.3.2 Additional Parameter Option<br />

In order to support the free selection of used implementation in the user application while<br />

keeping the function name same as in st<strong>and</strong>ard legacy API approach, the additional<br />

parameter option is implemented in the <strong>Embedded</strong> <strong>Software</strong> <strong>and</strong> <strong>Motor</strong> <strong>Control</strong> <strong>Libraries</strong><br />

<strong>for</strong> M<strong>PXR40xx</strong>. In this option the additional parameter is used to distinguish which<br />

implementation shall be invoked. There are three possible switches selecting the<br />

implementation:<br />

• F32 <strong>for</strong> 32-bit fixed-point implementation<br />

• F16 <strong>for</strong> 16-bit fixed-point implementation<br />

• FLT <strong>for</strong> single precision floating point implementation<br />

For example, if the user application needs to invoke the 16-bit fixed-point<br />

implementation of sine function, the GFLIB_Sin(x, F16) API call needs to be used. Note<br />

that there is possibility to call any implementation of the functions in user application<br />

without any limitation.<br />

2.3.3 API Postfix Option<br />

Chapter 2 Introduction<br />

In order to support the free selection of used implementation in the user application while<br />

keeping the number of parameters same as in st<strong>and</strong>ard legacy API approach, the API<br />

postfix option is implemented in the <strong>Embedded</strong> <strong>Software</strong> <strong>and</strong> <strong>Motor</strong> <strong>Control</strong> <strong>Libraries</strong> <strong>for</strong><br />

M<strong>PXR40xx</strong>. In this option the implementation postfix is used to distinguish which<br />

implementation shall be invoked. There are three possible API postfixes selecting the<br />

implementation:<br />

• F32 <strong>for</strong> 32-bit fixed-point implementation<br />

• F16 <strong>for</strong> 16-bit fixed-point implementation<br />

• FLT <strong>for</strong> single precision floating point implementation<br />

For example, if the user application needs to invoke the single precision floating point<br />

implementation of sine function, the GFLIB_Sin_FLT API call needs to be used. Note<br />

that there is possibility to call any implementation of the functions in user application<br />

without any limitation.<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 />

Freescale Semiconductor, Inc. 113

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

Saved successfully!

Ooh no, something went wrong!