upm
0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
|
API for the NRF24L01 Transceiver Module. More...
id This module defines the NRF24L01 interface for libnrf24l01
Public Member Functions | |
NRF24L01 (uint8_t cs, uint8_t ce) | |
std::string | name () |
void | init (uint8_t chipSelect, uint8_t chipEnable) |
void | configure () |
void | send (uint8_t *value) |
void | send () |
void | setSourceAddress (uint8_t *addr) |
void | setDestinationAddress (uint8_t *addr) |
void | setBroadcastAddress (uint8_t *addr) |
void | setPayload (uint8_t load) |
void | setDataReceivedHandler (funcPtrVoidVoid handler) |
bool | dataReady () |
bool | dataSending () |
void | getData (uint8_t *data) |
uint8_t | getStatus () |
bool | rxFifoEmpty () |
void | rxPowerUp () |
void | rxFlushBuffer () |
void | txPowerUp () |
void | powerDown () |
void | setChannel (uint8_t channel) |
void | setPower (power_t power) |
uint8_t | setSpeedRate (speed_rate_t rate) |
void | txFlushBuffer () |
void | pollListener () |
mraa::Result | ceHigh () |
mraa::Result | ceLow () |
mraa::Result | csOn () |
mraa::Result | csOff () |
void | setBeaconingMode () |
void | sendBeaconingMsg (uint8_t *msg) |
Data Fields | |
uint8_t | m_rxBuffer [MAX_BUFFER] |
uint8_t | m_txBuffer [MAX_BUFFER] |
uint8_t | m_bleBuffer [32] |
NRF24L01 | ( | uint8_t | cs, |
uint8_t | ce | ||
) |
Instantiates an NRF24l01 object
cs | Chip select pin |
|
inline |
Returns the name of the component
void init | ( | uint8_t | chipSelect, |
uint8_t | chipEnable | ||
) |
Initializes needed GPIO pins and SPI
chipSelect | Sets up the chip select pin |
chipEnable | Sets up the chip enable pin |
void configure | ( | ) |
void send | ( | uint8_t * | value | ) |
Sends the buffer data
*value | Pointer to the buffer |
void send | ( | ) |
Sends the data located in an inner bufer; the user must fill the m_txBuffer buffer
void setSourceAddress | ( | uint8_t * | addr | ) |
Sets a receiving address of the device
addr | 5-byte address |
void setDestinationAddress | ( | uint8_t * | addr | ) |
Sets a recipient address. The nrfSend method sends the data buffer to this address
addr | 5-byte address |
void setBroadcastAddress | ( | uint8_t * | addr | ) |
Sets a broadcasting address
addr | 5-byte address |
void setPayload | ( | uint8_t | load | ) |
Sets the payload size
load | Size of the payload (MAX 32) |
void setDataReceivedHandler | ( | funcPtrVoidVoid | handler | ) |
Sets the handler to be called when data has been received
handler | Handler used for callback |
bool dataReady | ( | ) |
Checks if the data has arrived
bool dataSending | ( | ) |
Checks if the transceiver is in the sending mode
void getData | ( | uint8_t * | data | ) |
Sinks all the arrived data into a provided buffer
load | Size of the payload (MAX 32) |
uint8_t getStatus | ( | ) |
Checks the transceiver state
bool rxFifoEmpty | ( | ) |
Checks if the receive stack is empty
void rxPowerUp | ( | ) |
Powers the receiver up
void rxFlushBuffer | ( | ) |
Flushes the receive stack
void txPowerUp | ( | ) |
Powers the transmitter up
void powerDown | ( | ) |
Powers everything down
void txFlushBuffer | ( | ) |
Flushes the transmit stack
void pollListener | ( | ) |
Pulling the method listening for the arrived data, dataRecievedHandler is triggered if data arrives
mraa::Result ceHigh | ( | ) |
Sets the chip enable pin to HIGH
mraa::Result ceLow | ( | ) |
Sets the chip enable pin to LOW
mraa::Result csOn | ( | ) |
Sets the chip select pin to LOW
mraa::Result csOff | ( | ) |
Sets the chip select pin to HIGH
void setBeaconingMode | ( | ) |
Configures the NRF24L01 transceiver to behave as a BLE (Bluetooth Low Energy) beaconing devcie.
void sendBeaconingMsg | ( | uint8_t * | msg | ) |
Beacons the provided message to BLE scanners.
msg | Beacons the provided message (max length is 16 bytes) |
uint8_t m_rxBuffer[MAX_BUFFER] |
Receive buffer
uint8_t m_txBuffer[MAX_BUFFER] |
Transmit buffer
uint8_t m_bleBuffer[32] |
BLE buffer