28 #include <mraa/aio.hpp> 29 #include <mraa/common.hpp> 31 #include <mraa/gpio.hpp> 33 #include <mraa/spi.hpp> 36 #include "Callback.hpp" 41 #define EN_RXADDR 0x02 43 #define SETUP_RETR 0x04 47 #define OBSERVE_TX 0x08 49 #define RX_ADDR_P0 0x0A 50 #define RX_ADDR_P1 0x0B 51 #define RX_ADDR_P2 0x0C 52 #define RX_ADDR_P3 0x0D 53 #define RX_ADDR_P4 0x0E 54 #define RX_ADDR_P5 0x0F 62 #define FIFO_STATUS 0x17 107 #define R_REGISTER 0x00 108 #define W_REGISTER 0x20 109 #define REGISTER_MASK 0x1F 110 #define R_RX_PAYLOAD 0x61 111 #define W_TX_PAYLOAD 0xA0 112 #define FLUSH_TX 0xE1 113 #define FLUSH_RX 0xE2 114 #define REUSE_TX_PL 0xE3 120 #define RF_PWR_HIGH 2 124 #define _CONFIG ((1<<EN_CRC) | (0<<CRCO) ) 126 #define MAX_BUFFER 32 132 #define BLE_MAC_0 0xEF 133 #define BLE_MAC_1 0xFF 134 #define BLE_MAC_2 0xC0 135 #define BLE_MAC_3 0xAA 136 #define BLE_MAC_4 0x18 137 #define BLE_MAC_5 0x00 139 #define BLE_PAYLOAD_OFFSET 13 143 typedef void (* funcPtrVoidVoid) (
Callback *);
205 void init (
int chipSelect,
int chipEnable);
217 void send (uint8_t * value);
308 void setChannel (uint8_t channel);
310 void setPower (power_t power);
312 uint8_t setSpeedRate (speed_rate_t rate);
333 mraa::Result
ceLow ();
338 mraa::Result
csOn ();
343 mraa::Result
csOff ();
368 funcPtrVoidVoid dataReceivedHandler;
373 void writeBytes (uint8_t * dataout, uint8_t * datain, uint8_t len);
377 void setRegister (uint8_t reg, uint8_t value);
381 uint8_t getRegister (uint8_t reg);
385 void readRegister (uint8_t reg, uint8_t * value, uint8_t len);
389 void writeRegister (uint8_t reg, uint8_t * value, uint8_t len);
393 void sendCommand (uint8_t cmd);
395 void bleCrc (
const uint8_t* data, uint8_t len, uint8_t* dst);
397 void bleWhiten (uint8_t* data, uint8_t len, uint8_t whitenCoeff);
399 void blePacketEncode(uint8_t* packet, uint8_t len, uint8_t chan);
401 uint8_t swapbits (uint8_t a);
411 mraa::Gpio m_csnPinCtx;
412 mraa::Gpio m_cePinCtx;
bool rxFifoEmpty()
Definition: nrf24l01.cxx:198
uint8_t m_bleBuffer[32]
Definition: nrf24l01.hpp:360
bool dataReady()
Definition: nrf24l01.cxx:145
void txFlushBuffer()
Definition: nrf24l01.cxx:317
mraa::Result ceHigh()
Definition: nrf24l01.cxx:288
NRF24L01(int cs, int ce)
Definition: nrf24l01.cxx:37
void configure()
Definition: nrf24l01.cxx:66
void sendBeaconingMsg(uint8_t *msg)
Definition: nrf24l01.cxx:359
void send()
Definition: nrf24l01.cxx:111
void powerDown()
Definition: nrf24l01.cxx:224
void setDataReceivedHandler(Callback *call_obj)
Definition: nrf24l01.cxx:138
void setBroadcastAddress(uint8_t *addr)
Definition: nrf24l01.cxx:128
void rxPowerUp()
Definition: nrf24l01.cxx:204
void getData(uint8_t *data)
Definition: nrf24l01.cxx:173
std::string name()
Definition: nrf24l01.hpp:194
void setDestinationAddress(uint8_t *addr)
Definition: nrf24l01.cxx:123
void rxFlushBuffer()
Definition: nrf24l01.cxx:213
Definition: Callback.hpp:3
mraa::Result ceLow()
Definition: nrf24l01.cxx:293
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
void setBeaconingMode()
Definition: nrf24l01.cxx:322
void init(int chipSelect, int chipEnable)
Definition: nrf24l01.cxx:44
void setPayload(uint8_t load)
Definition: nrf24l01.cxx:133
uint8_t m_txBuffer[MAX_BUFFER]
Definition: nrf24l01.hpp:359
void txPowerUp()
Definition: nrf24l01.cxx:218
bool dataSending()
Definition: nrf24l01.cxx:158
API for the NRF24L01 Transceiver Module.
Definition: nrf24l01.hpp:182
void pollListener()
Definition: nrf24l01.cxx:308
uint8_t getStatus()
Definition: nrf24l01.cxx:193
mraa::Result csOn()
Definition: nrf24l01.cxx:298
void setSourceAddress(uint8_t *addr)
Definition: nrf24l01.cxx:116
Definition: max30100.hpp:35
mraa::Result csOff()
Definition: nrf24l01.cxx:303
uint8_t m_rxBuffer[MAX_BUFFER]
Definition: nrf24l01.hpp:358