Microchip® Advanced Software Framework

vect_dsp16_add_and_saturate.c File Reference
#include "dsp.h"
#include "preprocessor.h"

Macros

#define DSP16_ADD_KERNEL_X_FCT(x_num, data)
 
#define DSP16_ADDITION(x_num, data)
 

Functions

void dsp16_vect_add_and_sat (dsp16_t *vect1, dsp16_t *vect2, dsp16_t *vect3, int size)
 16-bit fixed point version of the vector addition function. More...
 

#define DSP16_ADD_KERNEL_X_FCT (   x_num,
  data 
)
Value:
static void TPASTE2(dsp16_vect_add_kernel_x, x_num)(dsp16_t *vect1, dsp16_t *vect2, dsp16_t *vect3) \
{ \
MREPEAT(x_num, DSP16_ADDITION, ""); \
}
#define MREPEAT(count, macro, data)
Macro repeat.
Definition: mrepeat.h:67
dsp16_t__ dsp16_t
16-bit signed fixed point type optimized for 32-bit or lower microcontrollers
Definition: dsp_types.h:192
#define DSP16_ADDITION(x_num, data)
Definition: vect_dsp16_add_and_saturate.c:46
#define TPASTE2(a, b)
Definition: tpaste.h:61
#define DSP16_ADDITION (   x_num,
  data 
)
Value:
{ \
S32 temp = vect2[x_num] + vect3[x_num]; \
if (temp > DSP_Q_MAX(DSP16_QA, DSP16_QB)) \
vect1[x_num] = DSP_Q_MAX(DSP16_QA, DSP16_QB); \
else if (temp < DSP_Q_MIN(DSP16_QA, DSP16_QB)) \
vect1[x_num] = DSP_Q_MIN(DSP16_QA, DSP16_QB); \
else \
vect1[x_num] = (dsp16_t) temp; \
}
#define DSP_Q_MAX(a, b)
Return the maximal value of a fixed-point Qa.b typed number.
Definition: dsp_types.h:258
#define DSP_Q_MIN(a, b)
Return the minimal value of a fixed-point Qa.b typed number.
Definition: dsp_types.h:262
int32_t S32
32-bit signed integer.
Definition: compiler.h:217
dsp16_t__ dsp16_t
16-bit signed fixed point type optimized for 32-bit or lower microcontrollers
Definition: dsp_types.h:192
#define DSP16_QA
number of integer bits
Definition: dsp_types.h:133
#define DSP16_QB
number of fractional bits
Definition: dsp_types.h:137

Referenced by dsp16_vect_add_and_sat().