Component: RF Transceiver (nRF24L01) (Wireless)

From Flowcode Help
Jump to navigationJump to search
Author Matrix Ltd.
Version 9.0
Category Wireless


RF Transceiver (nRF24L01) component

A simple RF communications module based on the 2.4GHz nRF24L01 transceivermodules.

Version information

Library Version, Component Version, Date, Author, Info


Detailed description

No detailed description exists yet for this component

Examples

Example program transmitting a count value, echoing the count and TX status to the UART for debugging.

FC6 Icon.png RF Test TX


Example program receiving a value, echoing any received values to the UART for debugging.

FC6 Icon.png RF Test RX



Macro reference

CheckRX

Fc9-comp-macro.png CheckRX
Check the Rx FIFO status register for any new data. Returns 0 = No data Returns 1 = New data available 
Fc9-u8-icon.png - BYTE Return


FlushRx

Fc9-comp-macro.png FlushRx
Tells the RF module to flush the contents of the receive buffer. Returns the status from sending the command. 
Fc9-u8-icon.png - BYTE Return


FlushTx

Fc9-comp-macro.png FlushTx
Tells the RF module to flush the contents of the transmit buffer. Returns the status from sending the command. 
Fc9-u8-icon.png - BYTE Return


Initialise

Fc9-comp-macro.png Initialise
Starts up and configures the RF module ready for use. The macro will return a value greater then 0 if the module has been started correctly, otherwise the macro will return a 0. 
Fc9-u16-icon.png - UINT Return


ReadRegister

Fc9-comp-macro.png ReadRegister
Reads a single bytes from the selected register. Directly returns the value read back from the register. 
Fc9-u8-icon.png - BYTE Reg
Register address to access 
Fc9-u8-icon.png - BYTE Return


ReadRxArray

Fc9-comp-macro.png ReadRxArray
Reads an array of bytes back from the local Rx buffer. 
Fc9-u8-icon.png - BYTE Data
Byte array to store the received data 
Fc9-u8-icon.png - BYTE NumBytes
Range: 1-32 
Fc9-void-icon.png - VOID Return


ReadRxByte

Fc9-comp-macro.png ReadRxByte
Reads a single byte back from the local Rx buffer. 
Fc9-u8-icon.png - BYTE Index
Byte to read, range 0 - 31 
Fc9-u8-icon.png - BYTE Return


ReadRxFifo

Fc9-comp-macro.png ReadRxFifo
Reads the Rx FIFO buffer into a local buffer. Use the ReadBuffer/ReadArray macros to collect the individual data bytes. 
Fc9-void-icon.png - VOID Return


SetRxMode

Fc9-comp-macro.png SetRxMode
Sets up the module up ready to receive data. Assigns the 5-byte pipe listen address. 
Fc9-u8-icon.png - BYTE PA0
Pipe Address Bytes 
Fc9-u8-icon.png - BYTE PA1
Pipe Address Bytes 
Fc9-u8-icon.png - BYTE PA2
Pipe Address Bytes 
Fc9-u8-icon.png - BYTE PA3
Pipe Address Bytes 
Fc9-u8-icon.png - BYTE PA4
Pipe Address Bytes 
Fc9-void-icon.png - VOID Return


SetTxMode

Fc9-comp-macro.png SetTxMode
Sets the module up ready to transmit data. Assigns the 5-byte pipe transmit address. 
Fc9-u8-icon.png - BYTE PA0
Pipe Address Bytes 
Fc9-u8-icon.png - BYTE PA1
Pipe Address Bytes 
Fc9-u8-icon.png - BYTE PA2
Pipe Address Bytes 
Fc9-u8-icon.png - BYTE PA3
Pipe Address Bytes 
Fc9-u8-icon.png - BYTE PA4
Pipe Address Bytes 
Fc9-void-icon.png - VOID Return


WriteRegister

Fc9-comp-macro.png WriteRegister
Writes a single byte to the selected register. Returns the status of the write command. 
Fc9-u8-icon.png - BYTE Reg
Register address to access 
Fc9-u8-icon.png - BYTE Value
 
Fc9-u8-icon.png - BYTE Return


WriteTxArray

Fc9-comp-macro.png WriteTxArray
Writes an array of bytes to the local Tx buffer. 
Fc9-u8-icon.png - BYTE Data
Byte array to write. 
Fc9-u8-icon.png - BYTE NumBytes
Range: 1-32 
Fc9-void-icon.png - VOID Return


WriteTxByte

Fc9-comp-macro.png WriteTxByte
Writes a single byte to the local Tx buffer. 
Fc9-u8-icon.png - BYTE Index
Byte to read, range 0 - 31 
Fc9-u8-icon.png - BYTE Value
 
Fc9-void-icon.png - VOID Return


WriteTxFifo

Fc9-comp-macro.png WriteTxFifo
Writes the contents of the local Tx buffer to the Transmit FIFO and transmits. Returns 1 if transmission was sucessful. 
Fc9-bool-icon.png - BOOL Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png RF Settings
Fc9-type-21-icon.png RF Channel
Sets the RF channel from 0 - 127 = 2.4000GHz - 2.525GHz Both the transmitter and receiver should be on the same channel to receive data. Default 76 is a relatively free channel meaning there should be little interference here. 
Fc9-type-16-icon.png TX Power
Amount of power used for the transmitter circuit. 
Fc9-type-16-icon.png Data Rate
Sets the data throughput rate. 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
SPI Channel selector 
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-16-icon.png MOSI Remap Pin
Select which the target pin to assign the MOSI hardware pin functionality. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-16-icon.png MISO Remap Pin
Select which the target pin to assign the MISO hardware pin functionality. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-16-icon.png CLK Remap Pin
Select which the target pin to assign the CLK hardware pin functionality. 
Fc9-type-5-icon.png CS / SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
Fc9-type-5-icon.png CE Pin
Chip enable, configures RX or TX mode 
Fc9-conn-icon.png Simulation
Fc9-type-10-icon.png Label
Label used to help identify the component on the panel. 
Fc9-type-7-icon.png Scope Traces
Selects if the scope traces are automatically generated or not 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-16-icon.png API
 

Component Source Code

Please click here to download the component source project: FC_Comp_Source_nRF24L01.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_nRF24L01.fcfx