/*
** ===================================================================
** Název souboru   : jk_xtea.h
** Mikrokontroler  : ATmega128, ATmega16,...
** Popis           : Hlavickovy doubor k sifrovani vyuzivajici algoritmus XTEA s 128bit klicem a overenim antireplay
**                 :  
** Autor           : Jan Kristel (kristel_ml@volny,cz)
**                 : xx.04.2014
** ===================================================================
*/

#ifndef RFM12Bx_H_
#define RFM12Bx_H_


 /* RFM12B INTERFACE */
  #define SCK 1   // SPI clock
  #define SDO 3   // SPI Data output (RFM12B side)
  #define SDI 2   // SPI Data input (RFM12B side)
  #define CS  0   // SPI SS (chip select)
  #define NIRQ 0  // (PORTD)
  /* IO CONTROL */
  #define HI(x) PORTB |= (1<<(x))
  #define LO(x) PORTB &= ~(1<<(x))

 /* #define WAIT_NIRQ_LOW () while(PINE&(1<<NIRQ))*/
  



  
// ---- ** Prototipy funkci ** ---- 
 void portInit(void);
 
 void rfInit(void);
 
 unsigned int writeCmd(unsigned int cmd);
 
 unsigned char rfRecv(void) ;
  
 void rfSend(unsigned char data);
 
 void rftransmitter_mode( void );
 
 void rfreceiver_mode( void );
 
 // void wait_ffit_high( void );
 
 void rffifo_reset( void );
 
 void rfSend_char(volatile char* byte);
 
 void rfpacket_end( void );
 
 void rfpacket_head( void );
 
//*******pridat funkci send char ** a posilat vse naraz 






#endif /* RFM12B-V_H_ */