MySensors Library & Examples  2.3.2
Macros | Functions
+ Collaboration diagram for RF24:

Detailed Description

RF24 driver-related log messages, format: [!]SYSTEM:[SUB SYSTEM:]MESSAGE

E SYS SUB Message Comment
RF24 INIT PIN,CE=%d,CS=%d Initialise RF24 radio, pin configuration: chip enable (CE), chip select (CS)
! RF24 INIT SANCHK FAIL Sanity check failed, check wiring or replace module
RF24 SPP PCT=%d,TX LEVEL=%d Set TX level, input TX percent (PCT)
RF24 RBR REG=%d,VAL=%d Read register (REG), value=(VAL)
RF24 WBR REG=%d,VAL=%d Write register (REG), value=(VAL)
RF24 FRX Flush RX buffer
RF24 FTX Flush TX buffer
RF24 OWP RCPT=%d Open writing pipe, recipient=(RCPT)
RF24 STL Start listening
RF24 SPL Stop listening
RF24 SLP Set radio to sleep
RF24 SBY Set radio to standby
RF24 TXM TO=%d,LEN=%d Transmit message to=(TO), length=(LEN)
! RF24 TXM MAX_RT Max TX retries, no ACK received
! RF24 GDP PYL INV Invalid payload size
RF24 RXM LEN=%d Read message, length=(LEN)
RF24 STX LEVEL=%d Set TX level, level=(LEVEL)

Macros

#define RF24_SPI   hwSPI
 default SPI
 
#define DEFAULT_RF24_CE_PIN   (9)
 DEFAULT_RF24_CE_PIN.
 
#define DEFAULT_RF24_CS_PIN   (SS)
 DEFAULT_RF24_CS_PIN.
 
#define LOCAL   static
 static
 
#define RF24_SPI_DATA_ORDER   MSBFIRST
 RF24_SPI_DATA_ORDER.
 
#define RF24_SPI_DATA_MODE   SPI_MODE0
 RF24_SPI_DATA_MODE.
 
#define RF24_BROADCAST_ADDRESS   (255u)
 RF24_BROADCAST_ADDRESS.
 
#define RF24_CONFIGURATION   (uint8_t) (RF24_CRC_16 << 2)
 RF24_CONFIGURATION.
 
#define RF24_FEATURE   (uint8_t)( _BV(RF24_EN_DPL))
 RF24_FEATURE.
 
#define RF24_RF_SETUP   (uint8_t)(( ((MY_RF24_DATARATE & 0b10 ) << 4) | ((MY_RF24_DATARATE & 0b01 ) << 3) | (MY_RF24_PA_LEVEL << 1) ) + 1)
 RF24_RF_SETUP, +1 for Si24R1 and LNA.
 
#define RF24_POWERUP_DELAY_MS   (100u)
 Power up delay, allow VCC to settle, transport to become fully operational.
 
#define RF24_BROADCAST_PIPE   (1u)
 RF24_BROADCAST_PIPE.
 
#define RF24_NODE_PIPE   (0u)
 RF24_NODE_PIPE.
 
#define RF24_readByteRegister(__reg)   RF24_RAW_readByteRegister(RF24_CMD_READ_REGISTER | (RF24_REGISTER_MASK & (__reg)))
 RF24_readByteRegister.
 
#define RF24_writeByteRegister(__reg, __value)   RF24_RAW_writeByteRegister(RF24_CMD_WRITE_REGISTER | (RF24_REGISTER_MASK & (__reg)), __value)
 RF24_writeByteRegister.
 
#define RF24_writeMultiByteRegister(__reg, __buf, __len)   RF24_spiMultiByteTransfer(RF24_CMD_WRITE_REGISTER | (RF24_REGISTER_MASK & (__reg)),(uint8_t *)__buf, __len,false)
 RF24_writeMultiByteRegister.
 

Functions

LOCAL void RF24_csn (const bool level)
 RF24_csn. More...
 
LOCAL void RF24_ce (const bool level)
 RF24_ce. More...
 
LOCAL uint8_t RF24_spiMultiByteTransfer (const uint8_t cmd, uint8_t *buf, const uint8_t len, const bool readMode)
 RF24_spiMultiByteTransfer. More...
 
LOCAL uint8_t RF24_spiByteTransfer (const uint8_t cmd)
 RF24_spiByteTransfer. More...
 
LOCAL uint8_t RF24_RAW_readByteRegister (const uint8_t cmd)
 RF24_RAW_readByteRegister. More...
 
LOCAL uint8_t RF24_RAW_writeByteRegister (const uint8_t cmd, const uint8_t value)
 RF24_RAW_writeByteRegister. More...
 
LOCAL void RF24_flushRX (void)
 RF24_flushRX.
 
LOCAL void RF24_flushTX (void)
 RF24_flushTX.
 
LOCAL uint8_t RF24_getStatus (void)
 RF24_getStatus. More...
 
LOCAL uint8_t RF24_getFIFOStatus (void) __attribute__((unused))
 RF24_getFIFOStatus. More...
 
LOCAL void RF24_openWritingPipe (const uint8_t recipient)
 RF24_openWritingPipe. More...
 
LOCAL void RF24_startListening (void)
 RF24_startListening.
 
LOCAL void RF24_stopListening (void)
 RF24_stopListening.
 
LOCAL void RF24_sleep (void)
 RF24_sleep.
 
LOCAL void RF24_standBy (void)
 RF24_standBy.
 
LOCAL void RF24_powerDown (void)
 RF24_powerDown.
 
LOCAL void RF24_powerUp (void)
 RF24_powerUp.
 
LOCAL bool RF24_sendMessage (const uint8_t recipient, const void *buf, const uint8_t len, const bool noACK=false)
 RF24_sendMessage. More...
 
LOCAL uint8_t RF24_getDynamicPayloadSize (void)
 RF24_getDynamicPayloadSize. More...
 
LOCAL bool RF24_isDataAvailable (void)
 RF24_isDataAvailable. More...
 
LOCAL uint8_t RF24_readMessage (void *buf)
 RF24_readMessage. More...
 
LOCAL void RF24_setNodeAddress (const uint8_t address)
 RF24_setNodeAddress. More...
 
LOCAL uint8_t RF24_getNodeID (void)
 RF24_getNodeID. More...
 
LOCAL bool RF24_sanityCheck (void)
 RF24_sanityCheck. More...
 
LOCAL bool RF24_initialize (void)
 RF24_initialize. More...
 
LOCAL void RF24_setChannel (const uint8_t channel)
 RF24_setChannel. More...
 
LOCAL void RF24_setRetries (const uint8_t retransmitDelay, const uint8_t retransmitCount)
 RF24_setRetries. More...
 
LOCAL void RF24_setAddressWidth (const uint8_t addressWidth)
 RF24_setAddressWidth. More...
 
LOCAL void RF24_setRFSetup (const uint8_t RFsetup)
 RF24_setRFSetup. More...
 
LOCAL void RF24_setFeature (const uint8_t feature)
 RF24_setFeature. More...
 
LOCAL uint8_t RF24_getFeature (void)
 RF24_getFeature. More...
 
LOCAL void RF24_setPipe (const uint8_t pipe)
 RF24_setPipe. More...
 
LOCAL void RF24_setAutoACK (const uint8_t pipe)
 RF24_setAutoACK. More...
 
LOCAL void RF24_setDynamicPayload (const uint8_t pipe)
 RF24_setDynamicPayload. More...
 
LOCAL void RF24_setRFConfiguration (const uint8_t configuration)
 RF24_setRFConfiguration. More...
 
LOCAL void RF24_setPipeAddress (const uint8_t pipe, uint8_t *address, const uint8_t addressWidth)
 RF24_setPipeAddress. More...
 
LOCAL void RF24_setPipeLSB (const uint8_t pipe, const uint8_t LSB)
 RF24_setPipeLSB. More...
 
LOCAL uint8_t RF24_getObserveTX (void)
 RF24_getObserveTX. More...
 
LOCAL uint8_t RF24_setStatus (const uint8_t status)
 RF24_setStatus. More...
 
LOCAL void RF24_enableFeatures (void)
 RF24_enableFeatures.
 
LOCAL uint8_t RF24_getTxPowerPercent (void)
 RF24_getTxPowerPercent. More...
 
LOCAL int16_t RF24_getTxPowerLevel (void)
 RF24_getTxPowerLevel. More...
 
LOCAL bool RF24_setTxPowerPercent (const uint8_t newPowerPercent)
 RF24_setTxPowerPercent. More...
 
LOCAL int16_t RF24_getSendingRSSI (void)
 RF24_getSendingRSSI. More...
 
LOCAL void RF24_enableConstantCarrierWave (void) __attribute__((unused))
 Generate a constant carrier wave at active channel & transmit power (for testing only).
 
LOCAL void RF24_disableConstantCarrierWave (void) __attribute__((unused))
 Stop generating a constant carrier wave (for testing only).
 
LOCAL bool RF24_getReceivedPowerDetector (void) __attribute__((unused))
 Retrieve latched RPD power level, in receive mode (for testing, nRF24L01+ only). More...
 

Function Documentation

◆ RF24_ce()

LOCAL void RF24_ce ( const bool  level)

RF24_ce.

Parameters
level

◆ RF24_csn()

LOCAL void RF24_csn ( const bool  level)

RF24_csn.

Parameters
level

◆ RF24_getDynamicPayloadSize()

LOCAL uint8_t RF24_getDynamicPayloadSize ( void  )

RF24_getDynamicPayloadSize.

Returns

◆ RF24_getFeature()

LOCAL uint8_t RF24_getFeature ( void  )

RF24_getFeature.

Returns

◆ RF24_getFIFOStatus()

LOCAL uint8_t RF24_getFIFOStatus ( void  )

RF24_getFIFOStatus.

Returns

◆ RF24_getNodeID()

LOCAL uint8_t RF24_getNodeID ( void  )

RF24_getNodeID.

Returns

◆ RF24_getObserveTX()

LOCAL uint8_t RF24_getObserveTX ( void  )

RF24_getObserveTX.

Returns

◆ RF24_getReceivedPowerDetector()

LOCAL bool RF24_getReceivedPowerDetector ( void  )

Retrieve latched RPD power level, in receive mode (for testing, nRF24L01+ only).

Returns
True when power level >-64dBm for more than 40us.

◆ RF24_getSendingRSSI()

LOCAL int16_t RF24_getSendingRSSI ( void  )

RF24_getSendingRSSI.

Returns
Pseudo-RSSI based on ARC register

◆ RF24_getStatus()

LOCAL uint8_t RF24_getStatus ( void  )

RF24_getStatus.

Returns

◆ RF24_getTxPowerLevel()

LOCAL int16_t RF24_getTxPowerLevel ( void  )

RF24_getTxPowerLevel.

Returns

◆ RF24_getTxPowerPercent()

LOCAL uint8_t RF24_getTxPowerPercent ( void  )

RF24_getTxPowerPercent.

Returns

◆ RF24_initialize()

LOCAL bool RF24_initialize ( void  )

RF24_initialize.

Returns

◆ RF24_isDataAvailable()

LOCAL bool RF24_isDataAvailable ( void  )

RF24_isDataAvailable.

Returns

◆ RF24_openWritingPipe()

LOCAL void RF24_openWritingPipe ( const uint8_t  recipient)

RF24_openWritingPipe.

Parameters
recipient

◆ RF24_RAW_readByteRegister()

LOCAL uint8_t RF24_RAW_readByteRegister ( const uint8_t  cmd)

RF24_RAW_readByteRegister.

Parameters
cmd
Returns

◆ RF24_RAW_writeByteRegister()

LOCAL uint8_t RF24_RAW_writeByteRegister ( const uint8_t  cmd,
const uint8_t  value 
)

RF24_RAW_writeByteRegister.

Parameters
cmd
value
Returns

◆ RF24_readMessage()

LOCAL uint8_t RF24_readMessage ( void *  buf)

RF24_readMessage.

Returns

◆ RF24_sanityCheck()

LOCAL bool RF24_sanityCheck ( void  )

RF24_sanityCheck.

Returns

◆ RF24_sendMessage()

LOCAL bool RF24_sendMessage ( const uint8_t  recipient,
const void *  buf,
const uint8_t  len,
const bool  noACK = false 
)

RF24_sendMessage.

Parameters
recipient
buf
len
noACKset True if no ACK is required
Returns

◆ RF24_setAddressWidth()

LOCAL void RF24_setAddressWidth ( const uint8_t  addressWidth)

RF24_setAddressWidth.

Parameters
addressWidth

◆ RF24_setAutoACK()

LOCAL void RF24_setAutoACK ( const uint8_t  pipe)

RF24_setAutoACK.

Parameters
pipe

◆ RF24_setChannel()

LOCAL void RF24_setChannel ( const uint8_t  channel)

RF24_setChannel.

Parameters
channel

◆ RF24_setDynamicPayload()

LOCAL void RF24_setDynamicPayload ( const uint8_t  pipe)

RF24_setDynamicPayload.

Parameters
pipe

◆ RF24_setFeature()

LOCAL void RF24_setFeature ( const uint8_t  feature)

RF24_setFeature.

Parameters
feature

◆ RF24_setNodeAddress()

LOCAL void RF24_setNodeAddress ( const uint8_t  address)

RF24_setNodeAddress.

Parameters
address

◆ RF24_setPipe()

LOCAL void RF24_setPipe ( const uint8_t  pipe)

RF24_setPipe.

Parameters
pipe

◆ RF24_setPipeAddress()

LOCAL void RF24_setPipeAddress ( const uint8_t  pipe,
uint8_t *  address,
const uint8_t  addressWidth 
)

RF24_setPipeAddress.

Parameters
pipe
address
addressWidth

◆ RF24_setPipeLSB()

LOCAL void RF24_setPipeLSB ( const uint8_t  pipe,
const uint8_t  LSB 
)

RF24_setPipeLSB.

Parameters
pipe
LSB

◆ RF24_setRetries()

LOCAL void RF24_setRetries ( const uint8_t  retransmitDelay,
const uint8_t  retransmitCount 
)

RF24_setRetries.

Parameters
retransmitDelay
retransmitCount

◆ RF24_setRFConfiguration()

LOCAL void RF24_setRFConfiguration ( const uint8_t  configuration)

RF24_setRFConfiguration.

Parameters
configuration

◆ RF24_setRFSetup()

LOCAL void RF24_setRFSetup ( const uint8_t  RFsetup)

RF24_setRFSetup.

Parameters
RFsetup

◆ RF24_setStatus()

LOCAL uint8_t RF24_setStatus ( const uint8_t  status)

RF24_setStatus.

Parameters
status
Returns
status byte before setting new status

◆ RF24_setTxPowerPercent()

LOCAL bool RF24_setTxPowerPercent ( const uint8_t  newPowerPercent)

RF24_setTxPowerPercent.

Parameters
newPowerPercent
Returns

◆ RF24_spiByteTransfer()

LOCAL uint8_t RF24_spiByteTransfer ( const uint8_t  cmd)

RF24_spiByteTransfer.

Parameters
cmd
Returns

◆ RF24_spiMultiByteTransfer()

LOCAL uint8_t RF24_spiMultiByteTransfer ( const uint8_t  cmd,
uint8_t *  buf,
const uint8_t  len,
const bool  readMode 
)

RF24_spiMultiByteTransfer.

Parameters
cmd
buf
len
readMode
Returns