/*
 * LRW.h
 *
 *  Created on: 09-04-2025
 *      Author: Pawel Skoczykloda
 */

#ifndef LOG_WYL_
#define LOG_WYL_

//#include "pawel_usun_to.h"

#include "tdefs.h"

struct log_wyl_logic
{

	struct binary_io w_L1_in;
	struct binary_io w_L2_in;
	struct binary_io w_L3_in;	
	struct binary_io w_3f;
	struct binary_io blok_w;		
	
	struct binary_io w_L1_out;
	struct binary_io w_L2_out;
	struct binary_io w_L3_out;
	
	u8 dobijacz;
	u32 t_limit;
	
	u8 we_L1_pop;
	u8 we_L2_pop;
	u8 we_L3_pop;
	
	u8 we_L1_imp;
	u8 we_L2_imp;
	u8 we_L3_imp;
	
	u32 timer_L1;
	u32 timer_L2;
	u32 timer_L3;
	
};

struct log_wyl_io
{
	u32 wyl_L1_in;
	u32 wyl_L2_in;
	u32 wyl_L3_in;
	u32 wyl_3f_in;
	u32 blok_w_in;
	
	u32 wyl_L1_out;
	u32 wyl_L2_out;
	u32 wyl_L3_out;
	
}__attribute__((__packed__));

struct log_wyl_params
{
    u32 bity; ///< nastawy bitowe;
    double t1; ///< wartosc nastawy czasu 

}__attribute__((__packed__));

struct log_wyl_args
{
	struct log_wyl_io io;
	struct log_wyl_params params;
//	u16 crc;
}__attribute__((__packed__));

extern void log_wyl(void *args, void *logic);
extern int log_wyl_initlog(void *arguments, void *logic);

#endif /* LOG_WYL_ */
