15void RF24::csn(
bool mode)
18 if (ce_pin != csn_pin) {
23 PORTB |= (1 << PINB2);
27 PORTB &= ~(1 << PINB2);
34#elif defined(ARDUINO) && !defined(RF24_SPI_TRANSACTIONS)
42 #if defined(RF24_SPI_PTR)
43 _spi->setBitOrder(MSBFIRST);
44 _spi->setDataMode(SPI_MODE0);
46 #if !defined(F_CPU) || F_CPU < 20000000
47 _spi->setClockDivider(SPI_CLOCK_DIV2);
48 #elif F_CPU < 40000000
49 _spi->setClockDivider(SPI_CLOCK_DIV4);
50 #elif F_CPU < 80000000
51 _spi->setClockDivider(SPI_CLOCK_DIV8);
52 #elif F_CPU < 160000000
53 _spi->setClockDivider(SPI_CLOCK_DIV16);
54 #elif F_CPU < 320000000
55 _spi->setClockDivider(SPI_CLOCK_DIV32);
56 #elif F_CPU < 640000000
57 _spi->setClockDivider(SPI_CLOCK_DIV64);
58 #elif F_CPU < 1280000000
59 _spi->setClockDivider(SPI_CLOCK_DIV128);
61 #error "Unsupported CPU frequency. Please set correct SPI divider."
65 _SPI.setBitOrder(MSBFIRST);
66 _SPI.setDataMode(SPI_MODE0);
68 #if !defined(F_CPU) || F_CPU < 20000000
69 _SPI.setClockDivider(SPI_CLOCK_DIV2);
70 #elif F_CPU < 40000000
71 _SPI.setClockDivider(SPI_CLOCK_DIV4);
72 #elif F_CPU < 80000000
73 _SPI.setClockDivider(SPI_CLOCK_DIV8);
74 #elif F_CPU < 160000000
75 _SPI.setClockDivider(SPI_CLOCK_DIV16);
76 #elif F_CPU < 320000000
77 _SPI.setClockDivider(SPI_CLOCK_DIV32);
78 #elif F_CPU < 640000000
79 _SPI.setClockDivider(SPI_CLOCK_DIV64);
80 #elif F_CPU < 1280000000
81 _SPI.setClockDivider(SPI_CLOCK_DIV128);
83 #error "Unsupported CPU frequency. Please set correct SPI divider."
88#elif defined(RF24_RPi)
90 _SPI.chipSelect(csn_pin);
93#if !defined(RF24_LINUX)
97 static_cast<void>(mode);
103void RF24::ce(
bool level)
107 if (ce_pin != csn_pin) {
119#if defined(RF24_SPI_TRANSACTIONS)
120 #if defined(RF24_SPI_PTR)
121 #if defined(RF24_RP2)
122 _spi->beginTransaction(spi_speed);
124 _spi->beginTransaction(SPISettings(spi_speed, MSBFIRST, SPI_MODE0));
127 _SPI.beginTransaction(SPISettings(spi_speed, MSBFIRST, SPI_MODE0));
138#if defined(RF24_SPI_TRANSACTIONS)
139 #if defined(RF24_SPI_PTR)
140 _spi->endTransaction();
142 _SPI.endTransaction();
151#if defined(RF24_LINUX) || defined(RF24_RP2)
153 uint8_t* prx = spi_rxbuff;
154 uint8_t* ptx = spi_txbuff;
155 uint8_t size =
static_cast<uint8_t
>(len + 1);
163 #if defined(RF24_RP2)
164 _spi->transfernb((
const uint8_t*)spi_txbuff, spi_rxbuff, size);
166 _SPI.transfernb(
reinterpret_cast<char*
>(spi_txbuff),
reinterpret_cast<char*
>(spi_rxbuff), size);
181 #if defined(RF24_SPI_PTR)
182 status = _spi->transfer(reg);
184 *buf++ = _spi->transfer(0xFF);
188 status =
_SPI.transfer(reg);
190 *buf++ =
_SPI.transfer(0xFF);
204#if defined(RF24_LINUX) || defined(RF24_RP2)
207 uint8_t* prx = spi_rxbuff;
208 uint8_t* ptx = spi_txbuff;
212 #if defined(RF24_RP2)
213 _spi->transfernb((
const uint8_t*)spi_txbuff, spi_rxbuff, 2);
215 _SPI.transfernb(
reinterpret_cast<char*
>(spi_txbuff),
reinterpret_cast<char*
>(spi_rxbuff), 2);
225 #if defined(RF24_SPI_PTR)
226 status = _spi->transfer(reg);
227 result = _spi->transfer(0xff);
230 status =
_SPI.transfer(reg);
231 result =
_SPI.transfer(0xff);
242void RF24::write_register(uint8_t reg,
const uint8_t* buf, uint8_t len)
244#if defined(RF24_LINUX) || defined(RF24_RP2)
246 uint8_t* prx = spi_rxbuff;
247 uint8_t* ptx = spi_txbuff;
248 uint8_t size =
static_cast<uint8_t
>(len + 1);
255 #if defined(RF24_RP2)
256 _spi->transfernb((
const uint8_t*)spi_txbuff, spi_rxbuff, size);
258 _SPI.transfernb(
reinterpret_cast<char*
>(spi_txbuff),
reinterpret_cast<char*
>(spi_rxbuff), size);
266 #if defined(RF24_SPI_PTR)
269 _spi->transfer(*buf++);
275 _SPI.transfer(*buf++);
285void RF24::write_register(uint8_t reg, uint8_t value)
288#if defined(RF24_LINUX) || defined(RF24_RP2)
290 uint8_t* prx = spi_rxbuff;
291 uint8_t* ptx = spi_txbuff;
295 #if defined(RF24_RP2)
296 _spi->transfernb((
const uint8_t*)spi_txbuff, spi_rxbuff, 2);
298 _SPI.transfernb(
reinterpret_cast<char*
>(spi_txbuff),
reinterpret_cast<char*
>(spi_rxbuff), 2);
306 #if defined(RF24_SPI_PTR)
308 _spi->transfer(value);
311 _SPI.transfer(value);
319void RF24::write_payload(
const void* buf, uint8_t data_len,
const uint8_t writeType)
321 const uint8_t* current =
reinterpret_cast<const uint8_t*
>(buf);
323 uint8_t blank_len = !data_len ? 1 : 0;
325 data_len =
rf24_min(data_len, payload_size);
326 blank_len =
static_cast<uint8_t
>(payload_size - data_len);
329 data_len =
rf24_min(data_len,
static_cast<uint8_t
>(32));
335#if defined(RF24_LINUX) || defined(RF24_RP2)
337 uint8_t* prx = spi_rxbuff;
338 uint8_t* ptx = spi_txbuff;
340 size =
static_cast<uint8_t
>(data_len + blank_len + 1);
347 while (blank_len--) {
351 #if defined(RF24_RP2)
352 _spi->transfernb((
const uint8_t*)spi_txbuff, spi_rxbuff, size);
354 _SPI.transfernb(
reinterpret_cast<char*
>(spi_txbuff),
reinterpret_cast<char*
>(spi_rxbuff), size);
363 #if defined(RF24_SPI_PTR)
364 status = _spi->transfer(writeType);
366 _spi->transfer(*current++);
369 while (blank_len--) {
374 status =
_SPI.transfer(writeType);
376 _SPI.transfer(*current++);
379 while (blank_len--) {
390void RF24::read_payload(
void* buf, uint8_t data_len)
392 uint8_t* current =
reinterpret_cast<uint8_t*
>(buf);
394 uint8_t blank_len = 0;
396 data_len =
rf24_min(data_len, payload_size);
397 blank_len =
static_cast<uint8_t
>(payload_size - data_len);
400 data_len =
rf24_min(data_len,
static_cast<uint8_t
>(32));
407#if defined(RF24_LINUX) || defined(RF24_RP2)
409 uint8_t* prx = spi_rxbuff;
410 uint8_t* ptx = spi_txbuff;
412 size =
static_cast<uint8_t
>(data_len + blank_len + 1);
419 size =
static_cast<uint8_t
>(data_len + blank_len + 1);
421 #if defined(RF24_RP2)
422 _spi->transfernb((
const uint8_t*)spi_txbuff, spi_rxbuff, size);
424 _SPI.transfernb(
reinterpret_cast<char*
>(spi_txbuff),
reinterpret_cast<char*
>(spi_rxbuff), size);
441 #if defined(RF24_SPI_PTR)
444 *current++ = _spi->transfer(0xFF);
447 while (blank_len--) {
448 _spi->transfer(0xFF);
454 *current++ =
_SPI.transfer(0xFF);
457 while (blank_len--) {
487uint8_t RF24::get_status(
void)
496void RF24::print_status(uint8_t _status)
498 printf_P(
PSTR(
"STATUS\t\t= 0x%02x RX_DR=%x TX_DS=%x MAX_RT=%x RX_P_NO=%x TX_FULL=%x\r\n"), _status, (_status &
_BV(
RX_DR)) ? 1 : 0,
504void RF24::print_observe_tx(uint8_t value)
511void RF24::print_byte_register(
const char* name, uint8_t reg, uint8_t qty)
524void RF24::print_address_register(
const char* name, uint8_t reg, uint8_t qty)
536 while (--bufptr >= buffer) {
546uint8_t RF24::sprintf_address_register(
char* out_buffer, uint8_t reg, uint8_t qty)
549 uint8_t* read_buffer =
new uint8_t[
addr_width];
553 while (--bufptr >= read_buffer) {
554 offset +=
sprintf_P(out_buffer + offset,
PSTR(
"%02X"), *bufptr);
557 delete[] read_buffer;
567 spi_speed(_spi_speed),
569 _is_p_variant(false),
572 dynamic_payloads_enabled(true),
584 : ce_pin(RF24_PIN_INVALID),
585 csn_pin(RF24_PIN_INVALID),
586 spi_speed(_spi_speed),
588 _is_p_variant(false),
591 dynamic_payloads_enabled(true),
602void RF24::_init_obj()
606#if defined(RF24_SPI_PTR) && !defined(RF24_RP2)
610 pipe0_reading_address[0] = 0;
611 if (spi_speed <= 35000) {
620 const uint8_t max_channel = 125;
637 for (uint8_t i = 0; i < 6; ++i) {
638 write_register(
static_cast<uint8_t
>(
RX_PW_P0 + i), payload_size);
701 #if defined(RF24_LINUX)
702 printf(
"================ SPI Configuration ================\n");
703 uint8_t bus_ce =
static_cast<uint8_t
>(csn_pin % 10);
704 uint8_t bus_numb =
static_cast<uint8_t
>((csn_pin - bus_ce) / 10);
705 printf(
"CSN Pin\t\t= /dev/spidev%d.%d\n", bus_numb, bus_ce);
706 printf(
"CE Pin\t\t= Custom GPIO%d\n", ce_pin);
708 printf_P(
PSTR(
"SPI Speedz\t= %d Mhz\n"),
static_cast<uint8_t
>(spi_speed / 1000000));
709 #if defined(RF24_LINUX)
710 printf(
"================ NRF Configuration ================\n");
713 print_status(get_status());
717 print_address_register(
PSTR(
"TX_ADDR\t"),
TX_ADDR);
720 print_byte_register(
PSTR(
"EN_AA\t"),
EN_AA);
722 print_byte_register(
PSTR(
"RF_CH\t"),
RF_CH);
725 print_byte_register(
PSTR(
"DYNPD/FEATURE"),
DYNPD, 2);
745 #if defined(RF24_LINUX)
746 printf(
"================ SPI Configuration ================\n");
747 uint8_t bus_ce =
static_cast<uint8_t
>(csn_pin % 10);
748 uint8_t bus_numb =
static_cast<uint8_t
>((csn_pin - bus_ce) / 10);
749 printf(
"CSN Pin\t\t\t= /dev/spidev%d.%d\n", bus_numb, bus_ce);
750 printf(
"CE Pin\t\t\t= Custom GPIO%d\n", ce_pin);
752 printf_P(
PSTR(
"SPI Frequency\t\t= %d Mhz\n"),
static_cast<uint8_t
>(spi_speed / 1000000));
753 #if defined(RF24_LINUX)
754 printf(
"================ NRF Configuration ================\n");
758 uint16_t frequency =
static_cast<uint16_t
>(channel + 2400);
759 printf_P(
PSTR(
"Channel\t\t\t= %u (~ %u MHz)\r\n"), channel, frequency);
780 printf_P(
PSTR(
"Auto Retry Delay\t= %d microseconds\r\n"), (setupRetry >>
ARD) * 250 + 250);
781 printf_P(
PSTR(
"Auto Retry Attempts\t= %d maximum\r\n"), setupRetry & 0x0F);
784 printf_P(
PSTR(
"Packets lost on\n current channel\t= %d\r\n"), observeTx >> 4);
785 printf_P(
PSTR(
"Retry attempts made for\n last transmission\t= %d\r\n"), observeTx & 0x0F);
801 if (autoAck == 0x3F || autoAck == 0) {
805 (
char*)(pgm_read_ptr(&
rf24_feature_e_str_P[
static_cast<uint8_t
>(
static_cast<bool>(autoAck) * 1)])));
809 printf_P(
PSTR(
"Auto Acknowledgment\t= 0b%c%c%c%c%c%c\r\n"),
810 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P5)) + 48),
811 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P4)) + 48),
812 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P3)) + 48),
813 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P2)) + 48),
814 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P1)) + 48),
815 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P0)) + 48));
820 print_address_register(
PSTR(
"TX address\t"),
TX_ADDR);
823 for (uint8_t i = 0; i < 6; ++i) {
824 bool isOpen = openPipes &
_BV(i);
829 print_address_register(
PSTR(
""),
static_cast<uint8_t
>(
RX_ADDR_P0 + i));
832 print_byte_register(
PSTR(
""),
static_cast<uint8_t
>(
RX_ADDR_P0 + i));
841 const char* format_string =
PSTR(
842 "================ SPI Configuration ================\n"
843 "CSN Pin\t\t\t= %d\n"
845 "SPI Frequency\t\t= %d Mhz\n"
846 "================ NRF Configuration ================\n"
847 "Channel\t\t\t= %u (~ %u MHz)\n"
848 "RF Data Rate\t\t" PRIPSTR "\n"
849 "RF Power Amplifier\t" PRIPSTR "\n"
850 "RF Low Noise Amplifier\t" PRIPSTR "\n"
852 "Address Length\t\t= %d bytes\n"
853 "Static Payload Length\t= %d bytes\n"
854 "Auto Retry Delay\t= %d microseconds\n"
855 "Auto Retry Attempts\t= %d maximum\n"
856 "Packets lost on\n current channel\t= %d\r\n"
857 "Retry attempts made for\n last transmission\t= %d\r\n"
859 "Custom ACK Payload\t" PRIPSTR "\n"
860 "Dynamic Payloads\t" PRIPSTR "\n"
861 "Auto Acknowledgment\t");
862 const char* format_str2 =
PSTR(
"\nPrimary Mode\t\t= %cX\nTX address\t\t= 0x");
863 const char* format_str3 =
PSTR(
"\nPipe %d (" PRIPSTR ") bound\t= 0x");
866 debugging_information, format_string, csn_pin, ce_pin,
867 static_cast<uint8_t
>(spi_speed / 1000000),
getChannel(),
881 if (autoAck == 0x3F || autoAck == 0) {
884 debugging_information + offset,
PSTR(
"" PRIPSTR ""),
885 (
char*)(pgm_read_ptr(&
rf24_feature_e_str_P[
static_cast<uint8_t
>(
static_cast<bool>(autoAck) * 1)])));
890 debugging_information + offset,
PSTR(
"= 0b%c%c%c%c%c%c"),
891 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P5)) + 48),
892 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P4)) + 48),
893 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P3)) + 48),
894 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P2)) + 48),
895 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P1)) + 48),
896 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P0)) + 48));
899 debugging_information + offset, format_str2,
901 offset += sprintf_address_register(debugging_information + offset,
TX_ADDR);
903 for (uint8_t i = 0; i < 6; ++i) {
905 debugging_information + offset, format_str3,
908 offset += sprintf_address_register(
909 debugging_information + offset,
static_cast<uint8_t
>(
RX_ADDR_P0 + i));
913 debugging_information + offset,
PSTR(
"%02X"),
929 encoded_details += 5;
931 else if (i != 0x18 && i != 0x19 && i != 0x1a && i != 0x1b) {
936 *encoded_details++ = ce_pin >> 4;
937 *encoded_details++ = ce_pin & 0xFF;
938 *encoded_details++ = csn_pin >> 4;
939 *encoded_details++ = csn_pin & 0xFF;
940 *encoded_details =
static_cast<uint8_t
>((spi_speed / 1000000) |
_BV(_is_p_variant * 4));
945#if defined(RF24_SPI_PTR) || defined(DOXYGEN_FORCED)
951 return _init_pins() && _init_radio();
960 return begin(spiBus);
978#if defined(RF24_LINUX)
979 #if defined(RF24_RPi)
984 case 8: csn_pin = 0;
break;
985 case 7: csn_pin = 1;
break;
986 case 18: csn_pin = 10;
break;
987 case 17: csn_pin = 11;
break;
988 case 16: csn_pin = 12;
break;
989 default: csn_pin = 0;
break;
993 _SPI.begin(csn_pin, spi_speed);
995#elif defined(XMEGA_D3)
996 _spi->begin(csn_pin);
998#elif defined(RF24_RP2)
1000 _spi->begin(PICO_DEFAULT_SPI ? spi1 : spi0);
1004 #if defined(RF24_SPI_PTR)
1012 return _init_pins() && _init_radio();
1017bool RF24::_init_pins()
1024#if defined(RF24_LINUX)
1030#elif defined(LITTLEWIRE)
1034#elif defined(XMEGA_D3)
1035 if (ce_pin != csn_pin) {
1045 if (ce_pin != csn_pin) {
1053 #if defined(__ARDUINO_X86__)
1063bool RF24::_init_radio()
1085 _is_p_variant = before_toggle == after_toggle;
1087 if (_is_p_variant) {
1095 write_register(
DYNPD, 0);
1097 write_register(
EN_AA, 0x3F);
1142 return ce_pin != RF24_PIN_INVALID && csn_pin != RF24_PIN_INVALID;
1149#if !defined(RF24_TINY) && !defined(LITTLEWIRE)
1181 config_reg =
static_cast<uint8_t
>(config_reg & ~_BV(
PRIM_RX));
1184#if defined(RF24_TINY) || defined(LITTLEWIRE)
1186 if (ce_pin == csn_pin) {
1199 config_reg =
static_cast<uint8_t
>(config_reg & ~_BV(
PWR_UP));
1221#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1223void RF24::errNotify()
1225 #if defined(RF24_DEBUG) || defined(RF24_LINUX)
1226 printf_P(
PSTR(
"RF24 HARDWARE FAIL: Radio not responding, verify pin connections, wiring, etc.\r\n"));
1228 #if defined(FAILURE_HANDLING)
1245#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1246 uint32_t timer =
millis();
1250#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1251 if (
millis() - timer > 95) {
1253 #if defined(FAILURE_HANDLING)
1277 return write(buf, len, 0);
1290 uint32_t timer =
millis();
1296 if (
millis() - timer > timeout) {
1300#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1301 if (
millis() - timer > (timeout + 95)) {
1303 #if defined(FAILURE_HANDLING)
1336#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1337 uint32_t timer =
millis();
1346#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1347 if (
millis() - timer > 95) {
1349 #if defined(FAILURE_HANDLING)
1391#if !defined(F_CPU) || F_CPU > 20000000
1394#ifdef ARDUINO_ARCH_STM32
1395 if (F_CPU > 20000000) {
1422 return static_cast<bool>(
static_cast<uint8_t
>(
isFifo(about_tx)) &
_BV(!check_empty));
1430#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1431 uint32_t timeout =
millis();
1440#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1441 if (
millis() - timeout > 95) {
1443 #if defined(FAILURE_HANDLING)
1463 uint32_t start =
millis();
1470 if (
millis() - start >= timeout) {
1476#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1477 if (
millis() - start > (timeout + 95)) {
1479 #if defined(FAILURE_HANDLING)
1527 *pipe_num = (get_status() >>
RX_P_NO) & 0x07;
1539 read_payload(buf, len);
1591 memcpy(pipe0_reading_address, &address,
addr_width);
1615 a_width =
static_cast<uint8_t
>(a_width - 2);
1617 write_register(
SETUP_AW,
static_cast<uint8_t
>(a_width % 4));
1618 addr_width =
static_cast<uint8_t
>((a_width % 4) + 2);
1621 write_register(
SETUP_AW,
static_cast<uint8_t
>(0));
1634 memcpy(pipe0_reading_address, address,
addr_width);
1666void RF24::toggle_features(
void)
1669#if defined(RF24_SPI_PTR)
1671 _spi->transfer(0x73);
1674 _SPI.transfer(0x73);
1714 write_register(
DYNPD, 0);
1770 const uint8_t* current =
reinterpret_cast<const uint8_t*
>(buf);
1789 return _is_p_variant;
1797 write_register(
EN_AA, 0x3F);
1800 write_register(
EN_AA, 0);
1815 en_aa |=
static_cast<uint8_t
>(
_BV(pipe));
1818 en_aa =
static_cast<uint8_t
>(en_aa & ~_BV(pipe));
1823 write_register(
EN_AA, en_aa);
1846 setup |= _pa_level_reg_value(level, lnaEnable);
1868 bool result =
false;
1873 setup |= _data_rate_reg_value(speed);
1912 config_reg =
static_cast<uint8_t
>(config_reg & ~(
_BV(
CRCO) |
_BV(
EN_CRC)));
1952 config_reg =
static_cast<uint8_t
>(config_reg & ~_BV(
EN_CRC));
1970 uint8_t dummy_buf[32];
1971 for (uint8_t i = 0; i < 32; ++i)
1972 dummy_buf[i] = 0xFF;
1976 write_register(
TX_ADDR,
reinterpret_cast<uint8_t*
>(&dummy_buf), 5);
1981 write_register(
W_TX_PAYLOAD,
reinterpret_cast<const uint8_t*
>(&dummy_buf), 32);
2014 write_register(
EN_RXADDR,
static_cast<uint8_t
>(isEnabled ? 0x3F : 0));
2021#if !defined(F_CPU) || F_CPU > 20000000
2027#if !defined(F_CPU) || F_CPU > 20000000
2037#if !defined(F_CPU) || F_CPU > 20000000
2047 return static_cast<uint8_t
>(0);
2052uint8_t RF24::_pa_level_reg_value(uint8_t level,
bool lnaEnable)
2057 return static_cast<uint8_t
>(((level >
RF24_PA_MAX ?
static_cast<uint8_t
>(
RF24_PA_MAX) : level) << 1) + lnaEnable);
2064 uint8_t setup = _data_rate_reg_value(speed);
2065 setup |= _pa_level_reg_value(level, lnaEnable);
static const PROGMEM char rf24_datarate_e_str_1[]
static const PROGMEM char rf24_feature_e_str_on[]
static const PROGMEM char rf24_feature_e_str_open[]
static const PROGMEM char rf24_feature_e_str_closed[]
static const PROGMEM char *const rf24_datarate_e_str_P[]
static const PROGMEM char rf24_pa_dbm_e_str_2[]
static const PROGMEM char rf24_model_e_str_0[]
static const PROGMEM char rf24_pa_dbm_e_str_0[]
static const PROGMEM char *const rf24_crclength_e_str_P[]
static const PROGMEM char *const rf24_feature_e_str_P[]
static const PROGMEM char rf24_datarate_e_str_0[]
static const PROGMEM char rf24_crclength_e_str_2[]
static const PROGMEM char *const rf24_pa_dbm_e_str_P[]
static const PROGMEM char rf24_feature_e_str_allowed[]
static const PROGMEM uint8_t child_pipe[]
static const PROGMEM char rf24_model_e_str_1[]
static const PROGMEM uint8_t child_pipe_enable[]
static const PROGMEM char rf24_crclength_e_str_1[]
static const PROGMEM char rf24_crclength_e_str_0[]
static const PROGMEM char *const rf24_model_e_str_P[]
static const PROGMEM char rf24_datarate_e_str_2[]
static const PROGMEM char rf24_pa_dbm_e_str_1[]
static const PROGMEM char rf24_pa_dbm_e_str_3[]
#define RF24_POWERUP_DELAY
#define RF24_SPI_SPEED
The default SPI speed (in Hz)
void disableAckPayload(void)
RF24(rf24_gpio_pin_t _cepin, rf24_gpio_pin_t _cspin, uint32_t _spi_speed=RF24_SPI_SPEED)
uint16_t sprintfPrettyDetails(char *debugging_information)
uint8_t getPayloadSize(void)
void startListening(void)
bool isAckPayloadAvailable(void)
void printPrettyDetails(void)
void setPayloadSize(uint8_t size)
bool writeAckPayload(uint8_t pipe, const void *buf, uint8_t len)
void stopConstCarrier(void)
rf24_fifo_state_e isFifo(bool about_tx)
bool dynamic_payloads_enabled
void enableDynamicPayloads(void)
bool writeFast(const void *buf, uint8_t len)
void disableDynamicPayloads(void)
void setRetries(uint8_t delay, uint8_t count)
bool write(const void *buf, uint8_t len)
void setChannel(uint8_t channel)
uint8_t getDynamicPayloadSize(void)
bool ack_payloads_enabled
rf24_datarate_e getDataRate(void)
void setCRCLength(rf24_crclength_e length)
void read(void *buf, uint8_t len)
void closeReadingPipe(uint8_t pipe)
void read_register(uint8_t reg, uint8_t *buf, uint8_t len)
void openReadingPipe(uint8_t number, const uint8_t *address)
void toggleAllPipes(bool isEnabled)
Open or close all data pipes.
void setPALevel(uint8_t level, bool lnaEnable=1)
rf24_crclength_e getCRCLength(void)
void encodeRadioDetails(uint8_t *encoded_status)
void maskIRQ(bool tx_ok, bool tx_fail, bool rx_ready)
void enableAckPayload(void)
void startConstCarrier(rf24_pa_dbm_e level, uint8_t channel)
void startFastWrite(const void *buf, uint8_t len, const bool multicast, bool startTx=1)
void setAddressWidth(uint8_t a_width)
void setRadiation(uint8_t level, rf24_datarate_e speed, bool lnaEnable=true)
configure the RF_SETUP register in 1 transaction
bool startWrite(const void *buf, uint8_t len, const bool multicast)
bool writeBlocking(const void *buf, uint8_t len, uint32_t timeout)
bool setDataRate(rf24_datarate_e speed)
void setAutoAck(bool enable)
void openWritingPipe(const uint8_t *address)
void whatHappened(bool &tx_ok, bool &tx_fail, bool &rx_ready)
#define pinMode(pin, direction)
#define delayMicroseconds(usec)
#define digitalWrite(pin, value)
#define W_TX_PAYLOAD_NO_ACK