/*
** ===================================================================
** Název souboru   : RFM12Bx.h
** Mikrokontroler  : ATmega128, 
** Popis           :Hlavickovy soubor progamu pro ovladani a komunikaci s FR modulem RFM12B
**                 : (konfigurace pro 868Mhz) 
** 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 5  // (PORTE)
  /* IO CONTROL */
  #define HI(x) PORTB |= (1<<(x))
  #define LO(x) PORTB &= ~(1<<(x))

  
// ---- ** Prototipy funkci ** ---- 

 void portInit(void);
 
 unsigned int writeCmd(unsigned int cmd);
 
 void rfInit(void);
  
 void rfSend(unsigned char data);
 
 void rftransmitter_mode( void );
 
 void rfreceiver_mode( void );
 
 void rffifo_reset( void );
 
 void rffifo_reset( void );
 
 void rfSend_char(volatile unsigned char* byte);
 
 void rfpacket_end( void );
 
 void rfpacket_head( void );
 
 unsigned char rfRecv() ;


#endif /* RFM12B-V_H_ */