/*
 * mux_t.h
 *
 *  Created on: 02-02-2017
 *      Author: PS
 */

#ifndef MUX_T_
#define MUX_T_

#include "tdefs.h"


struct mux_t_logic
{
   	 //wejscia
   	 float *we[21];
     
     u8 *wb1;
     u8 wb1_bit_mask;
     u8 *wb2;
     u8 wb2_bit_mask;
     u8 *wb3;
     u8 wb3_bit_mask;
     
     u8 *wyl;
     u8 wyl_bit_mask;
     
     //wyjscia
     float *wy[7];
     
     u8 *wb_mux;
     u8 wb_mux_bit_mask;         
     u8 *wyl_s1;
     u8 wyl_s1_bit_mask;
	 u8 *wyl_s2;
     u8 wyl_s2_bit_mask;
     u8 *wyl_s3;
     u8 wyl_s3_bit_mask;
     
     //nastawy
     u8 strona;
     u8 wyl_calosc;
};

struct mux_t_io
{
	 //wejscia
	 u32 we_in[21];
	 u32 wb1_in;
	 u32 wb2_in;
	 u32 wb3_in;
	 u32 wyl_in;
	 //wyjscia
	 u32 wy_out[7];
	 u32 wb_mux_out; 
	 u32 wyl_s1_out;
	 u32 wyl_s2_out;
	 u32 wyl_s3_out;
	 
}__attribute__((__packed__));

struct mux_t_params
{
	u32 bity; // nastawy bitowe
	u32 strona; 
}__attribute__((__packed__));

struct mux_t_args
{
	struct mux_t_io io;
	struct mux_t_params params;
//	u16 crc;
}__attribute__((__packed__));

extern void mux_t(void *args, void *logic);
extern int mux_t_initlog(void *arguments, void *logic);

#endif /* MUX_T_ */
