28 #include <mraa/gpio.h>
34 #define EN_RXADDR 0x02
36 #define SETUP_RETR 0x04
40 #define OBSERVE_TX 0x08
42 #define RX_ADDR_P0 0x0A
43 #define RX_ADDR_P1 0x0B
44 #define RX_ADDR_P2 0x0C
45 #define RX_ADDR_P3 0x0D
46 #define RX_ADDR_P4 0x0E
47 #define RX_ADDR_P5 0x0F
55 #define FIFO_STATUS 0x17
98 #define R_REGISTER 0x00
99 #define W_REGISTER 0x20
100 #define REGISTER_MASK 0x1F
101 #define R_RX_PAYLOAD 0x61
102 #define W_TX_PAYLOAD 0xA0
103 #define FLUSH_TX 0xE1
104 #define FLUSH_RX 0xE2
105 #define REUSE_TX_PL 0xE3
110 #define NRF_CONFIG ((1<<EN_CRC) | (0<<CRCO) )
112 #define MAX_BUFFER 32
119 typedef void (* funcPtrVoidVoid) ();
333 mraa_spi_context m_spi;
339 uint8_t m_localAddress[5];
341 mraa_gpio_context m_csnPinCtx;
342 mraa_gpio_context m_cePinCtx;
mraa_result_t nrfCSOff()
Definition: nrf24l01.cxx:309
void nrfWriteRegister(uint8_t reg, uint8_t *value, uint8_t len)
Definition: nrf24l01.cxx:160
uint8_t m_txBuffer[MAX_BUFFER]
Definition: nrf24l01.h:329
void nrfTransmitSync(uint8_t *dataout, uint8_t len)
Definition: nrf24l01.cxx:169
void nrfFlushRX()
Definition: nrf24l01.cxx:123
void nrfReadRegister(uint8_t reg, uint8_t *value, uint8_t len)
Definition: nrf24l01.cxx:196
std::string name()
Definition: nrf24l01.h:146
void nrfPowerUpRX()
Definition: nrf24l01.cxx:114
void nrfPowerUpTX()
Definition: nrf24l01.cxx:282
bool nrfRXFifoEmpty()
Definition: nrf24l01.cxx:213
void nrfSetRXaddr(uint8_t *addr)
Definition: nrf24l01.cxx:131
uint8_t nrfGetStatus()
Definition: nrf24l01.cxx:188
uint8_t m_rxBuffer[MAX_BUFFER]
Definition: nrf24l01.h:328
void nrfTransferSync(uint8_t *dataout, uint8_t *datain, uint8_t len)
Definition: nrf24l01.cxx:205
~NRF24l01()
Definition: nrf24l01.cxx:38
void nrfSetBroadcastAddr(uint8_t *addr)
Definition: nrf24l01.cxx:148
mraa_result_t nrfCEHigh()
Definition: nrf24l01.cxx:294
NRF24l01(uint8_t cs)
Definition: nrf24l01.cxx:33
void nrfGetData(uint8_t *data)
Definition: nrf24l01.cxx:221
C++ API for NRF24l01 transceiver module.
Definition: nrf24l01.h:129
void nrfSetTXaddr(uint8_t *addr)
Definition: nrf24l01.cxx:139
void nrfSend()
Definition: nrf24l01.cxx:262
bool nrfIsSending()
Definition: nrf24l01.cxx:267
bool nrfDataReady()
Definition: nrf24l01.cxx:178
void nrfSetPayload(uint8_t load)
Definition: nrf24l01.cxx:155
void nrfConfigModule()
Definition: nrf24l01.cxx:89
void nrfInitModule(uint8_t chipSelect, uint8_t chipEnable)
Definition: nrf24l01.cxx:55
void nrfListenForChannel()
Definition: nrf24l01.cxx:314
mraa_result_t nrfCSOn()
Definition: nrf24l01.cxx:304
funcPtrVoidVoid dataRecievedHandler
Definition: nrf24l01.h:331
void nrfPowerDown()
Definition: nrf24l01.cxx:288
mraa_result_t nrfCELow()
Definition: nrf24l01.cxx:299
void nrfConfigRegister(uint8_t reg, uint8_t value)
Definition: nrf24l01.cxx:106