

//#define spi_miso         Pb.3
//#define spi_mosi         Pb.1
#define spi_sck          Pb.0
#define spi_sck_c          Pbc.0

#define spi_csn          Pb.4
#define spi_csn_c          Pbc.4

#define spi_data_c          Pbc.1
#define spi_data         	Pb.1
#define spi_data_h         pbph.1

#define rf_reset         pb.3
#define rf_reset_c         pbc.3



/*
#define spi_miso         Pb.3
#define spi_mosi         Pb.4
#define spi_sck          Pb.5
#define spi_csn          Pb.6
*/
//#define spi_CE           Pb.2


#define packet_length 	6

#define packet_length1 	packet_length+3

#define rf_address_data0 	0x11
#define rf_address_data1 	0x22
#define rf_address_data2 	0x33
#define rf_address_data3 	0x44

/********************************************************************************
*
*
********************************************************************************/
#define PKT_FLAG  0X40

#define	REG_RD	0x80
#define	REG_WR	0x7F
#define	RF_GAP	35

#define RXTX_CTRL 0x00
#define PKT_ADDR  0x16
#define TXFIFO_ADDR 0x27
#define RXFIFO_ADDR 0x28
#define TXFIFO_PTR 0x26
#define RXFIFO_PTR 0x25
#define ACK_REG_ADDR 0x01
#define ACK_TIMES_ADDR 0x0b
#define ACK_BIT 5
#define MAIN_STATE_ADDR 0x16




extern byte rf_address_data[4];
extern byte rf_data_buf[10];
extern byte no_rf_delay;



extern byte DelayCnt;
extern void rf_io_init(void);
extern void rf_Init(void);
extern void enable_recive(void);
extern void rf_RecivePack(void);
extern void carrier_mode(void);
extern void test_mode(void);
extern void Enter_Sleep(void);
extern void Wakeup_Sleep(void);
extern void rf_tx_data(void);










