/*
 * e_avg_1t.h
 *
 *  Created on: 01-06-2016
 *      Author: Krzysztof Jakubczyk
 */

#ifndef E_AVG_DT_H_
#define E_AVG_DT_H_

#include "tdefs.h"

struct e_avg_dt_logic
{
	u16 *buf_ptr;
	float *avg_dt_ptr;
	float mnoznik;
	float mnoznik10;
	float offset;
	float offset10;
	float bufor[20];
	short n;
	short n10;
    short licznik_probek; //licznik petli - zmienna pomocnicza
    short licznik_polokresow; //licznik polokresow - zmienna pomocnicza
    u8 zakres;
};

struct e_avg_dt_io
{
	u32 buf_u16_ptr_in;
	u32 param_an_ptr_in;
	u32 avg_dt_float_out;
}__attribute__((__packed__));

struct e_avg_dt_params
{
	double dt;
}__attribute__((__packed__));

struct e_avg_dt_args
{
	struct e_avg_dt_io io;
	struct e_avg_dt_params params;
//	u16 crc;
}__attribute__((__packed__));

extern void e_avg_dt(void *args, void *logic);
extern void e_avg_dt_100hz(void *args, void *logic);
extern int e_avg_dt_initlog(void *arguments, void *logic);

#endif /* E_AVG_DT_H_ */
