#ifndef __EMMARIN_H
#define __EMMARIN_H 



unsigned char calculate_parity(void);

unsigned char Emmarin_Read( char *pdta );   

tUInt EmmarinInitReader(void);

//*******************************************************************
// definice pro detekci manchester dat z karty Emmarin
// vztazeno k definici oscilatoru
//*******************************************************************
#define   EM_START_TIMEOUT          f1_CLK_SPEED/18432

#define   EM_CHANGE_TIME            f1_CLK_SPEED/460800

#define   EM_WAIT_NEXT				f1_CLK_SPEED/204800		// doba cekani na zacatek dalsiho bitu

#define   EM_TIMEOUT_EX             f1_CLK_SPEED/3686

#define   EM_BIT_TIME				f1_CLK_SPEED/92160



//*******************************************************************
// definice navratovych kodu funkce Emmarin_Read()
//*******************************************************************
#define EMMARIN_ERR_PARITY1		-1
#define EMMARIN_ERR_NULL		-2
#define EMMARIN_ERR_PARITY2		-3


#define EMDATA_PIN				EM_DATA_PIN			// data z Em4095
#define EMCTRL_PIN 				EM_CTRL_PIN			// ovladani EM4095




#endif
