upm
0.1.8
Sensor/Actuator repository for libmraa (v0.4.5)
|
C++ API for NRF24l01 transceiver module. More...
This file defines the NRF24l01 C++ interface for libnrf24l01
Public Member Functions | |
NRF24l01 (uint8_t cs) | |
~NRF24l01 () | |
std::string | name () |
void | nrfInitModule (uint8_t chipSelect, uint8_t chipEnable) |
void | nrfConfigModule () |
void | nrfSend (uint8_t *value) |
void | nrfSend () |
void | nrfSetRXaddr (uint8_t *addr) |
void | nrfSetTXaddr (uint8_t *addr) |
void | nrfSetBroadcastAddr (uint8_t *addr) |
void | nrfSetPayload (uint8_t load) |
bool | nrfDataReady () |
bool | nrfIsSending () |
bool | nrfRXFifoEmpty () |
bool | nrfTXFifoEmpty () |
void | nrfGetData (uint8_t *data) |
uint8_t | nrfGetStatus () |
void | nrfTransmitSync (uint8_t *dataout, uint8_t len) |
void | nrfTransferSync (uint8_t *dataout, uint8_t *datain, uint8_t len) |
void | nrfConfigRegister (uint8_t reg, uint8_t value) |
void | nrfReadRegister (uint8_t reg, uint8_t *value, uint8_t len) |
void | nrfWriteRegister (uint8_t reg, uint8_t *value, uint8_t len) |
void | nrfPowerUpRX () |
void | nrfPowerUpTX () |
void | nrfPowerDown () |
mraa_result_t | nrfCEHigh () |
mraa_result_t | nrfCELow () |
mraa_result_t | nrfCSOn () |
mraa_result_t | nrfCSOff () |
void | nrfFlushRX () |
void | nrfListenForChannel () |
Data Fields | |
uint8_t | m_rxBuffer [MAX_BUFFER] |
uint8_t | m_txBuffer [MAX_BUFFER] |
funcPtrVoidVoid | dataRecievedHandler |
NRF24l01 | ( | uint8_t | cs | ) |
Instanciates a NRF24l01 object
cs | chip select pin |
|
inline |
Return name of the component
void nrfInitModule | ( | uint8_t | chipSelect, |
uint8_t | chipEnable | ||
) |
Initialize needed Gpio pins and SPI interface
chipSelect | setting up the chip select pin |
chipEnable | setting up the chip enable pin |
void nrfConfigModule | ( | ) |
void nrfSend | ( | uint8_t * | value | ) |
Send the buffer data
value | pointer to the buffer |
void nrfSend | ( | ) |
Send the data located in inner bufer, user must fill the m_txBuffer buffer
void nrfSetRXaddr | ( | uint8_t * | addr | ) |
Set recieving address of the device
addr | 5 bytes addres |
void nrfSetTXaddr | ( | uint8_t * | addr | ) |
Set recipient address. nrfSend method will send the data buffer to this address
addr | 5 bytes addres |
void nrfSetBroadcastAddr | ( | uint8_t * | addr | ) |
Set broadcasting address.
addr | 5 bytes addres |
void nrfSetPayload | ( | uint8_t | load | ) |
Set payload size.
load | size of the payload (MAX 32) |
bool nrfDataReady | ( | ) |
Check if data arrived
bool nrfIsSending | ( | ) |
Check if chip in sending mode
bool nrfRXFifoEmpty | ( | ) |
Check if recieving stack is empty
bool nrfTXFifoEmpty | ( | ) |
Check if transmitting stack is empty
void nrfGetData | ( | uint8_t * | data | ) |
Sink all arrived data into the provided buffer
data | pointer to buffer of data |
uint8_t nrfGetStatus | ( | ) |
Check the chip state
void nrfTransmitSync | ( | uint8_t * | dataout, |
uint8_t | len | ||
) |
Transmit provided data to the chip
dataout | pointer to the buffer with data |
len | length of the buffer |
void nrfTransferSync | ( | uint8_t * | dataout, |
uint8_t * | datain, | ||
uint8_t | len | ||
) |
Recieve data from the chip
dataout | pointer to the buffer with data |
datain | pointer to the buffer where the arrived data will be sinked |
len | length of the buffer |
void nrfConfigRegister | ( | uint8_t | reg, |
uint8_t | value | ||
) |
Write byte value into a register
reg | register address |
value | the value to write |
void nrfReadRegister | ( | uint8_t | reg, |
uint8_t * | value, | ||
uint8_t | len | ||
) |
Read continues data from register
reg | register address |
value | pointer to the buffer |
len | length of the buffer |
void nrfWriteRegister | ( | uint8_t | reg, |
uint8_t * | value, | ||
uint8_t | len | ||
) |
Write continues data to register
reg | register address |
value | pointer to the buffer |
len | length of the buffer |
void nrfPowerUpRX | ( | ) |
Power up reciever
void nrfPowerUpTX | ( | ) |
Power up transmitter
void nrfPowerDown | ( | ) |
Power down all
mraa_result_t nrfCEHigh | ( | ) |
Set chip enable pin HIGH
mraa_result_t nrfCELow | ( | ) |
Set chip enable LOW
mraa_result_t nrfCSOn | ( | ) |
Set chip select pin LOW
mraa_result_t nrfCSOff | ( | ) |
Set chip select pin HIGH
void nrfFlushRX | ( | ) |
Flush reciver stack
void nrfListenForChannel | ( | ) |
Pulling method which listenning for arrived data, if data arrived dataRecievedHandler will be triggered
uint8_t m_rxBuffer[MAX_BUFFER] |
Reciver buffer
uint8_t m_txBuffer[MAX_BUFFER] |
Transmit buffer
funcPtrVoidVoid dataRecievedHandler |
Data arrived handler