nRFBareRadio is a library to use the Radio peripheral in a nRF51 or nRF52 Nordic microcontroller in "bare" mode transmitting raw packets, instead of the usual BLE protocols.

Embed: (wiki syntax)

« Back to documentation index

RadioConfig Class Reference

RadioConfig Class Reference

RadioConfig holds various setup parameters, being used as argument to configure a radio. More...

#include <nRFBareRadio.h>

Data Fields

int frequency
 Center frequency the radio will operate at in MHz, with 2400MHz offset (that is, a value of 35 means the radio will operate at 2435MHz).
int rate
 Data rate (band width around the center frequency) in MHz.
int data_length
 Packet payload size in bytes, must be in the range 0-32.
int address_length
 Length of the address field in bytes, must be in the range 3-5.
int tx_power
 Power level used in transmit mode.
int use_whitening
 Either to use data whitening or not.
int endianness
 Data endianness for both the address and payload.
unsigned int crc_poly
 CRC polynomial, fixed at a 16bit length in this library.
unsigned int crc_init
 CRC initial value, fixed at a 16bit length in this library.

Detailed Description

RadioConfig holds various setup parameters, being used as argument to configure a radio.

All have default values, so you can get a radio up and running without touching anything.

Definition at line 138 of file nRFBareRadio.h.


Field Documentation

Length of the address field in bytes, must be in the range 3-5.

This library supports one endpoint only (logic address 0).

Definition at line 159 of file nRFBareRadio.h.

unsigned int crc_init

CRC initial value, fixed at a 16bit length in this library.

Default 0xFFFF (compatible to nRF24).

Definition at line 188 of file nRFBareRadio.h.

unsigned int crc_poly

CRC polynomial, fixed at a 16bit length in this library.

Default 0x1021 (compatible to nRF24).

Definition at line 184 of file nRFBareRadio.h.

Packet payload size in bytes, must be in the range 0-32.

This library uses static payload size only. If your payload varies, use the largest possible length and leave unused bytes in the packet.

Definition at line 155 of file nRFBareRadio.h.

Data endianness for both the address and payload.

Possible values are RADIO_LITTLEENDIAN or RADIO_BIGENDIAN (default). For nRF24 compatibility it must be RADIO_BIGENDIAN.

Definition at line 180 of file nRFBareRadio.h.

int frequency

Center frequency the radio will operate at in MHz, with 2400MHz offset (that is, a value of 35 means the radio will operate at 2435MHz).

Must be in range 0-100 and defaults to 2 (2402MHz).

Definition at line 145 of file nRFBareRadio.h.

int rate

Data rate (band width around the center frequency) in MHz.

Possible values are RADIO_RATE_1M, RADIO_RATE_2M (default) or RADIO_RATE_250K (deprecated).

Definition at line 150 of file nRFBareRadio.h.

int tx_power

Power level used in transmit mode.

Possible values are RADIO_TX_0dBm (default) for 0dBm, RADIO_TX_N4dBm for -4dBm, RADIO_TX_N12dBm for -12 dBm, RADIO_TX_N20dBm for -20 dBm, RADIO_TX_N40dBm for -40 dBm, RADIO_TX_P4dBm for +4dBm, or any constant from the nRF SDK (example: RADIO_TXPOWER_TXPOWER_Neg8dBm).

Definition at line 170 of file nRFBareRadio.h.

Either to use data whitening or not.

Possible values are RADIO_WHITENING or RADIO_NO_WHITENING (default). Data whitening is not compatible to nRF24 chipsets.

Definition at line 175 of file nRFBareRadio.h.