movingAverage.h
Go to the documentation of this file.00001 #ifndef MOVING_AVERATE_H
00002 #define MOVING_AVERATE_H
00003
00017 typedef struct {
00018 int size;
00019 int size_shift;
00020 int index;
00021 int *buffer;
00022 int total;
00023 } movingAverage_t;
00024
00025
00026 #include "cpp_extern_macro.h"
00027 BEGIN_C_DECLS;
00028
00029 extern void initMovingAverage(movingAverage_t *ma,
00030 int *buffer, int size_shift);
00031 extern void setMovingAverage(movingAverage_t *ma, int value);
00032 extern int getAverageValue(movingAverage_t *ma);
00033
00034 END_C_DECLS;
00035 #endif
00036