28 #include <mraa/aio.hpp>
29 #include <mraa/common.hpp>
31 #include <mraa/gpio.hpp>
33 #include <mraa/spi.hpp>
36 #if defined(SWIGJAVA) || defined(JAVACALLBACK)
43 #define EN_RXADDR 0x02
45 #define SETUP_RETR 0x04
49 #define OBSERVE_TX 0x08
51 #define RX_ADDR_P0 0x0A
52 #define RX_ADDR_P1 0x0B
53 #define RX_ADDR_P2 0x0C
54 #define RX_ADDR_P3 0x0D
55 #define RX_ADDR_P4 0x0E
56 #define RX_ADDR_P5 0x0F
64 #define FIFO_STATUS 0x17
109 #define R_REGISTER 0x00
110 #define W_REGISTER 0x20
111 #define REGISTER_MASK 0x1F
112 #define R_RX_PAYLOAD 0x61
113 #define W_TX_PAYLOAD 0xA0
114 #define FLUSH_TX 0xE1
115 #define FLUSH_RX 0xE2
116 #define REUSE_TX_PL 0xE3
122 #define RF_PWR_HIGH 2
126 #define _CONFIG ((1<<EN_CRC) | (0<<CRCO) )
128 #define MAX_BUFFER 32
134 #define BLE_MAC_0 0xEF
135 #define BLE_MAC_1 0xFF
136 #define BLE_MAC_2 0xC0
137 #define BLE_MAC_3 0xAA
138 #define BLE_MAC_4 0x18
139 #define BLE_MAC_5 0x00
141 #define BLE_PAYLOAD_OFFSET 13
145 #if defined(SWIGJAVA) || defined(JAVACALLBACK)
146 typedef void (* funcPtrVoidVoid) (Callback *);
148 typedef void (* funcPtrVoidVoid) ();
211 void init (uint8_t chipSelect, uint8_t chipEnable);
223 void send (uint8_t * value);
260 #if defined(SWIGJAVA) || defined(JAVACALLBACK)
322 void setChannel (uint8_t channel);
324 void setPower (power_t power);
326 uint8_t setSpeedRate (speed_rate_t rate);
347 mraa::Result
ceLow ();
352 mraa::Result
csOn ();
357 mraa::Result
csOff ();
377 #if defined(SWIGJAVA) || defined(JAVACALLBACK)
379 Callback *callback_obj;
381 funcPtrVoidVoid dataReceivedHandler;
386 void writeBytes (uint8_t * dataout, uint8_t * datain, uint8_t len);
390 void setRegister (uint8_t reg, uint8_t value);
394 uint8_t getRegister (uint8_t reg);
398 void readRegister (uint8_t reg, uint8_t * value, uint8_t len);
402 void writeRegister (uint8_t reg, uint8_t * value, uint8_t len);
406 void sendCommand (uint8_t cmd);
408 void bleCrc (
const uint8_t* data, uint8_t len, uint8_t* dst);
410 void bleWhiten (uint8_t* data, uint8_t len, uint8_t whitenCoeff);
412 void blePacketEncode(uint8_t* packet, uint8_t len, uint8_t chan);
414 uint8_t swapbits (uint8_t a);
423 uint8_t m_localAddress[5];
425 mraa::Gpio m_csnPinCtx;
426 mraa::Gpio m_cePinCtx;
bool rxFifoEmpty()
Definition: nrf24l01.cxx:206
uint8_t m_bleBuffer[32]
Definition: nrf24l01.h:374
bool dataReady()
Definition: nrf24l01.cxx:153
void txFlushBuffer()
Definition: nrf24l01.cxx:328
mraa::Result ceHigh()
Definition: nrf24l01.cxx:296
void configure()
Definition: nrf24l01.cxx:66
void sendBeaconingMsg(uint8_t *msg)
Definition: nrf24l01.cxx:370
void send()
Definition: nrf24l01.cxx:111
void powerDown()
Definition: nrf24l01.cxx:232
void setBroadcastAddress(uint8_t *addr)
Definition: nrf24l01.cxx:128
void init(uint8_t chipSelect, uint8_t chipEnable)
Definition: nrf24l01.cxx:44
void rxPowerUp()
Definition: nrf24l01.cxx:212
void getData(uint8_t *data)
Definition: nrf24l01.cxx:181
std::string name()
Definition: nrf24l01.h:200
void setDestinationAddress(uint8_t *addr)
Definition: nrf24l01.cxx:123
void rxFlushBuffer()
Definition: nrf24l01.cxx:221
mraa::Result ceLow()
Definition: nrf24l01.cxx:301
void setBeaconingMode()
Definition: nrf24l01.cxx:333
void setPayload(uint8_t load)
Definition: nrf24l01.cxx:133
uint8_t m_txBuffer[MAX_BUFFER]
Definition: nrf24l01.h:373
void txPowerUp()
Definition: nrf24l01.cxx:226
bool dataSending()
Definition: nrf24l01.cxx:166
API for the NRF24L01 Transceiver Module.
Definition: nrf24l01.h:188
void pollListener()
Definition: nrf24l01.cxx:316
void setDataReceivedHandler(funcPtrVoidVoid handler)
Definition: nrf24l01.cxx:146
uint8_t getStatus()
Definition: nrf24l01.cxx:201
mraa::Result csOn()
Definition: nrf24l01.cxx:306
NRF24L01(uint8_t cs, uint8_t ce)
Definition: nrf24l01.cxx:37
void setSourceAddress(uint8_t *addr)
Definition: nrf24l01.cxx:116
mraa::Result csOff()
Definition: nrf24l01.cxx:311
uint8_t m_rxBuffer[MAX_BUFFER]
Definition: nrf24l01.h:372