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.

4.9.6 Code Example<br />

#include "gdflib.h"<br />

GDFLIB_FILTER_IIR1_T_F16 f16trMyIIR1 = GDFLIB_FILTER_IIR1_DEFAULT_F16;<br />

void main(void)<br />

{<br />

// function returns no value<br />

GDFLIB_FilterIIR1Init_F16 (&f16trMyIIR1);<br />

}<br />

// function returns no value<br />

GDFLIB_FilterIIR1Init (&f16trMyIIR1, Define F16);<br />

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

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

// as default<br />

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

// function returns no value<br />

GDFLIB_FilterIIR1Init (&f16trMyIIR1);<br />

4.10 Function GDFLIB_FilterIIR1_F16<br />

This function implements the first order IIR filter.<br />

4.10.1 Declaration<br />

tFrac16 GDFLIB_FilterIIR1_F16(tFrac16 f16In, GDFLIB_FILTER_IIR1_T_F16 *const pParam);<br />

4.10.2 Arguments<br />

Table 4-10. GDFLIB_FilterIIR1_F16 arguments<br />

Type Name Direction Description<br />

tFrac16 f16In input Value of input signal to be filtered in step (k). The value is a<br />

16-bit number in the 1.15 fractional <strong>for</strong>mat.<br />

GDFLIB_FILTER_IIR1_<br />

T_F16 *const<br />

4.10.3 Return<br />

pParam input,<br />

output<br />

Chapter 4 API References<br />

Pointer to the filter structure with a filter buffer <strong>and</strong> filter<br />

parameters.<br />

The function returns a 16-bit value in fractional <strong>for</strong>mat 1.15, representing the filtered<br />

value of the input signal in step (k).<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. 173

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

Saved successfully!

Ooh no, something went wrong!