00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00017 #ifndef __INCLUDE_NRF24L01_H
00018 #define __INCLUDE_NRF24L01_H
00019 #include "common.h"
00020
00021 void NRF_init (void);
00022 void NRF_send (uint8_t byte);
00023 void NRF_prepareForReceive ();
00024 bool_t NRF_receive (uint8_t *const byte);
00025
00026
00027 #define NRF_NOP 0xff
00028 #define R_REGISTER 0x00
00029 #define W_REGISTER 0x01
00030 #define R_RX_PAYLOAD 0x61
00031 #define W_TX_PAYLOAD 0xA0
00032 #define FLUSH_TX 0xE1
00033 #define FLUSH_RX 0xE2
00034 #define REUSE_TX_PL 0xE3
00035
00036 #define RX_ADDR_P0 0x0A
00037 #define RX_ADDR_P1 0x0B
00038 #define TX_ADDR 0x10
00039 #define RX_PW_P0 0x11
00040 #define RX_PW_P1 0x12
00041 #define FIFO_STATUS 0x17
00042
00043 #define MAX_RT 0x10
00044
00045 #define CONFIG_REG_ADDR 0x00
00046 #define STATUS_ADDR 0x07
00047
00048 #define FLUSH_TX 0xE1
00049 #define TX_FULL 0x01
00050 #define RX_DR 0x40
00051 #define TX_DS 0x20
00052
00053 #define IRQ() (!(P8IN & BIT5)) // netagive logic
00054
00055 #define RX_TX_TIME 100000
00056 #define BUT_TIME 10000
00057
00058 #endif // __INCLUDE_NRF24L01_H