Component: RF 2.4GHz (nRF24L01) (Wireless)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd.
Version 2.0 (Release)
Category Wireless


Image RF 2.4GHz (nRF24L01) component

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

Examples

No additional examples


Downloadable macro reference

ReadRxByte

Reads a single byte back from the local Rx buffer.

Parameters

BYTE Index
Byte to read, range 0 - 31


Return value

BYTE


WriteTxByte

Reads a single byte to the local Tx buffer.

Parameters

BYTE Index
Byte to read, range 0 - 31
BYTE Value


Return value

This call does not return a value


FlushRx

Tells the RF module to flush the contents of the receive buffer.

Returns the status from sending the command.

Parameters

This macro has no parameters


Return value

BYTE


ReadRxFifo

Reads the Rx FIFO buffer into a local buffer.

Use the ReadBuffer macro to collect the individual data bytes.

Parameters

BYTE NumBytes
Number of bytes to try and read from the FIFO Range 1-32


Return value

This call does not return a value


WriteTxFifo

Writes the contents of the local Tx buffer to the Transmit FIFO.

Parameters

BYTE NumBytes
Number of bytes to write to the FIFO, Range 1 - 32


Return value

This call does not return a value


FlushTx

Tells the RF module to flush the contents of the transmit buffer.

Returns the status from sending the command.

Parameters

This macro has no parameters


Return value

BYTE


CheckRX

Check the Rx FIFO status register for any new data.

Returns 0 = No data

Returns 1 = New data available

Parameters

This macro has no parameters


Return value

BYTE


ReadRegister

Reads a single bytes from the selected register.

Directly returns the value read back from the register.

Parameters

BYTE Reg
Register address to access


Return value

BYTE


SetTxMode

Sets the module up ready to transmit data.

Parameters

BYTE PA0
Pipe Address Bytes
BYTE PA1
Pipe Address Bytes
BYTE PA2
Pipe Address Bytes
BYTE PA3
Pipe Address Bytes
BYTE PA4
Pipe Address Bytes


Return value

This call does not return a value


SetRxMode

Sets the module up ready to receive data.

Parameters

BYTE PA0
Pipe Address Bytes
BYTE PA1
Pipe Address Bytes
BYTE PA2
Pipe Address Bytes
BYTE PA3
Pipe Address Bytes
BYTE PA4
Pipe Address Bytes


Return value

This call does not return a value


WriteRegister

Writes a single byte to the selected register.

Returns the status of the write command.

Parameters

BYTE Reg
Register address to access
BYTE Value


Return value

BYTE


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.

Parameters

This macro has no parameters


Return value

UINT


Simulation macro reference

This component does not contain any simulation macros


Property reference

RF Channel

This property is of type Unsigned integer and can be referenced with the variable name RFChannel.

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.

Channel

This property is of type Fixed list of ints and can be referenced with the variable name cal_spi::CHANNEL.

SPI Channel selector

Prescale

This property is of type Fixed list of ints and can be referenced with the variable name cal_spi::PR_SCALE.

Prescale option selector

MOSI

This property is of type Single digital pin and can be referenced with the variable name cal_spi::MOSI.

SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.

MISO

This property is of type Single digital pin and can be referenced with the variable name cal_spi::MISO.

SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.

CLK

This property is of type Single digital pin and can be referenced with the variable name cal_spi::CLK.

SPI Clock Pin CLK - The Clock signal is driven by the SPI master.

CS / SS

This property is of type Single digital pin and can be referenced with the variable name cal_spi::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.

CE Pin

This property is of type Single digital pin and can be referenced with the variable name ce_pin.

Chip enable, configures RX or TX mode

Label

This property is of type Line of text and can be referenced with the variable name label.

Label used to help identify the component on the panel.

Scope Traces

This property is of type True or false and can be referenced with the variable name cal_spi::ScopeTraces.

Selects if the scope traces are automatically generated or not

Console Data

This property is of type True or false and can be referenced with the variable name cal_spi::ConsoleData.

Selects if the console data is automatically generated or not

Injector

This property is of type Fixed list of ints and can be referenced with the variable name cal_spi::Injector.

No additional information