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

4.3.3 Return<br />

void<br />

4.3.4 Description<br />

The function per<strong>for</strong>ms the initialization procedure <strong>for</strong> the GDFLIB_FilterFIR_F16<br />

function. In particular, the function per<strong>for</strong>ms the following operations:<br />

1. Resets the input buffer index to zero.<br />

2. Initializes the input buffer pointer to the pointer provided as an argument.<br />

3. Resets the input buffer.<br />

After initialization, made by the function, the parameters <strong>and</strong> state structures should be<br />

provided as arguments to calls of the GDFLIB_FilterFIR_F16 function.<br />

Note<br />

The input buffer pointer (State->pInBuf) must point to a Read/<br />

Write memory region, which must be at least the number of the<br />

filter taps long. The number of taps in a filter is equal to the<br />

filter order + 1. There is no restriction as to the location of the<br />

parameters structure as long as it is readable.<br />

CAUTION<br />

No check is per<strong>for</strong>med <strong>for</strong> R/W capability <strong>and</strong> the length of the<br />

input buffer (pState->pInBuf).<br />

4.3.5 Re-entrancy<br />

The function is re-entrant only if the calling code is provided with a distinct instance of<br />

the structure pointed to by pState.<br />

4.3.6 Code Example<br />

#include "gdflib.h"<br />

#define FIR_NUMTAPS 16<br />

#define FIR_NUMTAPS_MAX 64<br />

#define FIR_ORDER (FIR_NUMTAPS - 1)<br />

GDFLIB_FILTERFIR_PARAM_T_F16 Param;<br />

GDFLIB_FILTERFIR_STATE_T_F16 State;<br />

tFrac16 f16InBuf[FIR_NUMTAPS_MAX];<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 />

156 Freescale Semiconductor, Inc.

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

Saved successfully!

Ooh no, something went wrong!