/*
 * under_1ph.h
 *
 *  Created on: 12-05-2014
 *      Author: Krzysztof Jakubczyk
 */

#ifndef UNDER_1PH_H_
#define UNDER_1PH_H_

#include "../tdefs.h"

struct under_1ph_logic
{
	u32 time_cnt;
	u8 *trig_ptr;
	u8 trig_bit_no;
	u8 *action_ptr;
	u8 action_bit_no;
	float *esk_ptr;
	float limit_val1;
	float limit_val2;
};

struct under_1ph_io
{
	u32 esk_float_in;
	u32 trig_out;
	u32 action_out;
}__attribute__((__packed__));

struct under_1ph_params
{
	double trig_val;
	double kp;
	u32 t_delay;
}__attribute__((__packed__));

struct under_1ph_args
{
	struct under_1ph_io io;
	struct under_1ph_params params;
//	u16 crc;
}__attribute__((__packed__));

extern void under_1ph(void *args, void *logic);
extern int under_1ph_initlog(void *arguments, void *logic);

#endif /* UNDER_1PH_H_ */
