//----------------------------------------------------
/**
	\file		gvariables.c

	\brief		Globalni promenne
				<<< ALL >>>

	\author		ConTeK s.r.o., Pavel Vavra
	\version	01.01
	\date		24.5.2012
*/
//----------------------------------------------------

#include "gvariables.h"

#include <ioboard.h>

//-----------------------------------------------------
/**
	\brief	Kontexty pameti a akcelerometru
*/
//-----------------------------------------------------

#ifdef MSVC
  FILEMEM_CTX		gFram;	//!< Kontext souborove pameti
#else
#ifdef USEHW_FRAM
  TWIDESC			gTwi;	//!< Kontext twi komunikace
  FRAM_CTX			gFram;	//!< Kontext fram pameti
#endif
#endif //MSVC

uint8_t			gPstBuf[sizeof(gParam.Pst)];


//-----------------------------------------------------
/**
	\brief	Kontext ukladani do flash a fram
*/
//-----------------------------------------------------

PARAMSTORE_CTX gParCtxCtrl;		//!< kontext ukladani do flash a fram

//-----------------------------------------------------
/**
	\brief	kontext datadef
*/
//-----------------------------------------------------
DATADEF_CTX gCtxCtrl;


//-----------------------------------------------------
/**
	\brief	Kontext NVpameti
*/
//-----------------------------------------------------

NVMEMDESC confMem;


//-----------------------------------------------------
/**
	\brief	Kontext vstupu/vystupu
*/
//-----------------------------------------------------

IOBOARD_CTX	gIOBoardCtx;	//!< kontext ioboard desky


uint8_t		gDInpVal[IOBOARD_DINP_B_COUNT];							//!< digitalni vstupy
//uint8_t		gDInpX[IOBOARD_DINP_B_COUNT] = {0x01};			//!< invertovane digitalni vstupy
uint8_t		gDInpX[IOBOARD_DINP_B_COUNT] = {0x00};			//!< invertovane digitalni vstupy
uint8_t		gDOutpVal[IOBOARD_DOUTP_B_COUNT];						//!< digitalni vystupy
uint8_t		gDOutpX[IOBOARD_DOUTP_B_COUNT] = {0x00};	//!< invertovane digitalni vystupy
aiodata_t	gAInpVal[IOBOARD_AINP_COUNT];							//!< analogove vstupy
aiodata_t	gAOutpVal[IOBOARD_AOUTP_COUNT];							//!< analogove vystupy
DFILTER_CTX	gDInpFilter_DI_LEVER;									//!< kontext dig.filtru DI_LEVER
DFILTER_CTX	*gDInpFilter[IOBOARD_DINP_COUNT];						//!< pole ukazatelu na kontext dig.filtru

AFILTER_FLOATAVG gAInpFilter_A;
AFILTER_CTX *gAInpFilter[IOBOARD_AINP_COUNT];

//-----------------------------------------------------
/**
	\brief	Kontexty jednotlivych automatu a knihoven
*/
//-----------------------------------------------------
THERMOCOUPLE_CTX	gThermocouple;
LAMBDA_CTX			gLambda;
PHOTO_CTX			gPhoto;
