#ifndef rfm
#define rfm
#include "ds1302.h"
#include <avr\interrupt.h>



#define NIRQ 3
#define MOSI 5
#define SCK 7
#define MISO 6
#define FFIT 2
#define SS 4
#define VDO 1
#define DDR_SPI DDRB
#define PORT_SPI PORTB
#define PIN_SPI PINB
#define wait_spi_complete() while(!(SPSR & _BV(SPIF))); SPSR |= ~(_BV(SPIF))
#define WAIT_NIRQ_LOW() while(PINB & _BV(NIRQ));
#define waitmsg 1			//čekání na odpověď ze slave - cca (n*66ms)
#define PIP_ON		PORTD&=~(_BV(7));
#define PIP_OFF		PORTD|=_BV(7);

unsigned int rf_writecmd(unsigned int cmd);
void rf_init(void);
void rf_send(unsigned char data);
void spi_init(void);
void rf_sleep(void);
void rf_receiver(void);
void rf_transmitter(void);
void rf_fifo_reset(void);
void rf_head(void);
void rf_end(void);
unsigned char rf_read(void);
void zprava(char *znaky);
void precist(char *kam);
void zprava4(char *znaky);
unsigned char datapaket( char *ID,  char par,  char data);
unsigned char base(char *ID);
unsigned char parameters_out(char *ID);
unsigned char parameters_in(char *ID);
void EEPROM_write(unsigned int uiAddress, unsigned char ucData);
unsigned char EEPROM_read(unsigned int uiAddress);
void EEPROM_write_new(unsigned char data);
void EEPROM_clear(void);
void EEPROM_read_send(void);
void compare(void);
void disp_view(void);
extern char int0,teplota,rel0,rel1,warning,par_set,ID1[2],ID2[2];


#endif 
