arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
NRF24Config Struct Reference

NRF24L01 Audio Configuration optimized for low-latency audio streaming. Uses the RF24 library from TMRh20: https://github.com/nRF24/RF24. More...

#include <NRF24Stream.h>

Inheritance diagram for NRF24Config:
AudioInfo

Public Member Functions

 NRF24Config ()
 
virtual void clear ()
 
void copyFrom (AudioInfo info)
 Same as set.
 
bool equals (AudioInfo alt)
 Returns true if alt values are the same like the current values.
 
bool equalsExSampleRate (AudioInfo alt)
 Checks if only the sample rate is different.
 
virtual void logInfo (const char *source="")
 
 operator bool ()
 Returns true if all components are defined (no component is 0)
 
bool operator!= (AudioInfo alt)
 Returns true if alt values are the different from the current values.
 
bool operator== (AudioInfo alt)
 Returns true if alt values are the same like the current values.
 
void set (AudioInfo info)
 Copies the values from info.
 
void setAudioInfo (AudioInfo info)
 Same as set.
 

Public Attributes

uint64_t address = 0xF0F0F0F0E1LL
 Pipe address for communication (5 bytes). TX and RX must match.
 
bool auto_ack = false
 Enable auto-acknowledgment. Disable for lowest latency.
 
uint8_t bits_per_sample = DEFAULT_BITS_PER_SAMPLE
 Number of bits per sample (int16_t = 16 bits)
 
uint8_t channel = 124
 RF channel (0-125). Higher channels (100+) are less crowded.
 
uint16_t channels = DEFAULT_CHANNELS
 Number of channels: 2=stereo, 1=mono.
 
rf24_crclength_e crc_length = RF24_CRC_DISABLED
 CRC length: RF24_CRC_DISABLED, RF24_CRC_8, RF24_CRC_16.
 
rf24_datarate_e data_rate = RF24_2MBPS
 Data rate: RF24_250KBPS, RF24_1MBPS, RF24_2MBPS.
 
int max_begin_retry = 10
 Number of retries for begin() initialization.
 
RxTxMode mode = TX_MODE
 RX or TX mode.
 
rf24_pa_dbm_e pa_level = RF24_PA_MAX
 PA level: RF24_PA_MIN, RF24_PA_LOW, RF24_PA_HIGH, RF24_PA_MAX.
 
uint8_t payload_size = 32
 Payload size in bytes (1-32)
 
int pin_ce = 9
 CE pin number.
 
int pin_csn = 10
 CSN pin number.
 
sample_rate_t sample_rate = DEFAULT_SAMPLE_RATE
 Sample Rate: e.g 44100.
 
bool use_write_fast = true
 Use writeFast() instead of write() for TX. Lower latency.
 

Detailed Description

NRF24L01 Audio Configuration optimized for low-latency audio streaming. Uses the RF24 library from TMRh20: https://github.com/nRF24/RF24.

Default settings: 2Mbps, no ACK, no CRC, channel 124 (less crowded upper band), max PA level. With these defaults, mono 16-bit 32kHz audio achieves ~6.5ms latency.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ NRF24Config()

NRF24Config ( )
inline

Member Function Documentation

◆ clear()

virtual void clear ( )
inlinevirtualinherited

◆ copyFrom()

void copyFrom ( AudioInfo  info)
inlineinherited

Same as set.

◆ equals()

bool equals ( AudioInfo  alt)
inlineinherited

Returns true if alt values are the same like the current values.

◆ equalsExSampleRate()

bool equalsExSampleRate ( AudioInfo  alt)
inlineinherited

Checks if only the sample rate is different.

◆ logInfo()

virtual void logInfo ( const char source = "")
inlinevirtualinherited

◆ operator bool()

operator bool ( )
inlineinherited

Returns true if all components are defined (no component is 0)

◆ operator!=()

bool operator!= ( AudioInfo  alt)
inlineinherited

Returns true if alt values are the different from the current values.

◆ operator==()

bool operator== ( AudioInfo  alt)
inlineinherited

Returns true if alt values are the same like the current values.

◆ set()

void set ( AudioInfo  info)
inlineinherited

Copies the values from info.

◆ setAudioInfo()

void setAudioInfo ( AudioInfo  info)
inlineinherited

Same as set.

Member Data Documentation

◆ address

uint64_t address = 0xF0F0F0F0E1LL

Pipe address for communication (5 bytes). TX and RX must match.

◆ auto_ack

bool auto_ack = false

Enable auto-acknowledgment. Disable for lowest latency.

◆ bits_per_sample

uint8_t bits_per_sample = DEFAULT_BITS_PER_SAMPLE
inherited

Number of bits per sample (int16_t = 16 bits)

◆ channel

uint8_t channel = 124

RF channel (0-125). Higher channels (100+) are less crowded.

◆ channels

uint16_t channels = DEFAULT_CHANNELS
inherited

Number of channels: 2=stereo, 1=mono.

◆ crc_length

CRC length: RF24_CRC_DISABLED, RF24_CRC_8, RF24_CRC_16.

◆ data_rate

Data rate: RF24_250KBPS, RF24_1MBPS, RF24_2MBPS.

◆ max_begin_retry

int max_begin_retry = 10

Number of retries for begin() initialization.

◆ mode

RxTxMode mode = TX_MODE

RX or TX mode.

◆ pa_level

PA level: RF24_PA_MIN, RF24_PA_LOW, RF24_PA_HIGH, RF24_PA_MAX.

◆ payload_size

uint8_t payload_size = 32

Payload size in bytes (1-32)

◆ pin_ce

int pin_ce = 9

CE pin number.

◆ pin_csn

int pin_csn = 10

CSN pin number.

◆ sample_rate

sample_rate_t sample_rate = DEFAULT_SAMPLE_RATE
inherited

Sample Rate: e.g 44100.

◆ use_write_fast

bool use_write_fast = true

Use writeFast() instead of write() for TX. Lower latency.


The documentation for this struct was generated from the following file: