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;
565 : ce_pin(_cepin), csn_pin(_cspin), spi_speed(_spi_speed), payload_size(32), _is_p_variant(false), _is_p0_rx(false), addr_width(5), dynamic_payloads_enabled(true), csDelay(5)
573 : ce_pin(RF24_PIN_INVALID), csn_pin(RF24_PIN_INVALID), spi_speed(_spi_speed), payload_size(32), _is_p_variant(false), _is_p0_rx(false), addr_width(5), dynamic_payloads_enabled(true), csDelay(5)
580void RF24::_init_obj()
584#if defined(RF24_SPI_PTR) && !defined(RF24_RP2)
588 pipe0_reading_address[0] = 0;
589 if (spi_speed <= 35000) {
598 const uint8_t max_channel = 125;
615 for (uint8_t i = 0; i < 6; ++i) {
616 write_register(
static_cast<uint8_t
>(
RX_PW_P0 + i), payload_size);
679 #if defined(RF24_LINUX)
680 printf(
"================ SPI Configuration ================\n");
681 uint8_t bus_ce =
static_cast<uint8_t
>(csn_pin % 10);
682 uint8_t bus_numb =
static_cast<uint8_t
>((csn_pin - bus_ce) / 10);
683 printf(
"CSN Pin\t\t= /dev/spidev%d.%d\n", bus_numb, bus_ce);
684 printf(
"CE Pin\t\t= Custom GPIO%d\n", ce_pin);
686 printf_P(
PSTR(
"SPI Speedz\t= %d Mhz\n"),
static_cast<uint8_t
>(spi_speed / 1000000));
687 #if defined(RF24_LINUX)
688 printf(
"================ NRF Configuration ================\n");
691 print_status(get_status());
695 print_address_register(
PSTR(
"TX_ADDR\t"),
TX_ADDR);
698 print_byte_register(
PSTR(
"EN_AA\t"),
EN_AA);
700 print_byte_register(
PSTR(
"RF_CH\t"),
RF_CH);
703 print_byte_register(
PSTR(
"DYNPD/FEATURE"),
DYNPD, 2);
723 #if defined(RF24_LINUX)
724 printf(
"================ SPI Configuration ================\n");
725 uint8_t bus_ce =
static_cast<uint8_t
>(csn_pin % 10);
726 uint8_t bus_numb =
static_cast<uint8_t
>((csn_pin - bus_ce) / 10);
727 printf(
"CSN Pin\t\t\t= /dev/spidev%d.%d\n", bus_numb, bus_ce);
728 printf(
"CE Pin\t\t\t= Custom GPIO%d\n", ce_pin);
730 printf_P(
PSTR(
"SPI Frequency\t\t= %d Mhz\n"),
static_cast<uint8_t
>(spi_speed / 1000000));
731 #if defined(RF24_LINUX)
732 printf(
"================ NRF Configuration ================\n");
736 uint16_t frequency =
static_cast<uint16_t
>(channel + 2400);
737 printf_P(
PSTR(
"Channel\t\t\t= %u (~ %u MHz)\r\n"), channel, frequency);
758 printf_P(
PSTR(
"Auto Retry Delay\t= %d microseconds\r\n"), (setupRetry >>
ARD) * 250 + 250);
759 printf_P(
PSTR(
"Auto Retry Attempts\t= %d maximum\r\n"), setupRetry & 0x0F);
762 printf_P(
PSTR(
"Packets lost on\n current channel\t= %d\r\n"), observeTx >> 4);
763 printf_P(
PSTR(
"Retry attempts made for\n last transmission\t= %d\r\n"), observeTx & 0x0F);
779 if (autoAck == 0x3F || autoAck == 0) {
783 (
char*)(pgm_read_ptr(&
rf24_feature_e_str_P[
static_cast<uint8_t
>(
static_cast<bool>(autoAck) * 1)])));
787 printf_P(
PSTR(
"Auto Acknowledgment\t= 0b%c%c%c%c%c%c\r\n"),
788 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P5)) + 48),
789 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P4)) + 48),
790 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P3)) + 48),
791 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P2)) + 48),
792 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P1)) + 48),
793 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P0)) + 48));
798 print_address_register(
PSTR(
"TX address\t"),
TX_ADDR);
801 for (uint8_t i = 0; i < 6; ++i) {
802 bool isOpen = openPipes &
_BV(i);
807 print_address_register(
PSTR(
""),
static_cast<uint8_t
>(
RX_ADDR_P0 + i));
810 print_byte_register(
PSTR(
""),
static_cast<uint8_t
>(
RX_ADDR_P0 + i));
819 const char* format_string =
PSTR(
820 "================ SPI Configuration ================\n"
821 "CSN Pin\t\t\t= %d\n"
823 "SPI Frequency\t\t= %d Mhz\n"
824 "================ NRF Configuration ================\n"
825 "Channel\t\t\t= %u (~ %u MHz)\n"
826 "RF Data Rate\t\t" PRIPSTR "\n"
827 "RF Power Amplifier\t" PRIPSTR "\n"
828 "RF Low Noise Amplifier\t" PRIPSTR "\n"
830 "Address Length\t\t= %d bytes\n"
831 "Static Payload Length\t= %d bytes\n"
832 "Auto Retry Delay\t= %d microseconds\n"
833 "Auto Retry Attempts\t= %d maximum\n"
834 "Packets lost on\n current channel\t= %d\r\n"
835 "Retry attempts made for\n last transmission\t= %d\r\n"
837 "Custom ACK Payload\t" PRIPSTR "\n"
838 "Dynamic Payloads\t" PRIPSTR "\n"
839 "Auto Acknowledgment\t");
840 const char* format_str2 =
PSTR(
"\nPrimary Mode\t\t= %cX\nTX address\t\t= 0x");
841 const char* format_str3 =
PSTR(
"\nPipe %d (" PRIPSTR ") bound\t= 0x");
844 debugging_information, format_string, csn_pin, ce_pin,
845 static_cast<uint8_t
>(spi_speed / 1000000),
getChannel(),
859 if (autoAck == 0x3F || autoAck == 0) {
862 debugging_information + offset,
PSTR(
"" PRIPSTR ""),
863 (
char*)(pgm_read_ptr(&
rf24_feature_e_str_P[
static_cast<uint8_t
>(
static_cast<bool>(autoAck) * 1)])));
868 debugging_information + offset,
PSTR(
"= 0b%c%c%c%c%c%c"),
869 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P5)) + 48),
870 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P4)) + 48),
871 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P3)) + 48),
872 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P2)) + 48),
873 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P1)) + 48),
874 static_cast<char>(
static_cast<bool>(autoAck &
_BV(
ENAA_P0)) + 48));
877 debugging_information + offset, format_str2,
879 offset += sprintf_address_register(debugging_information + offset,
TX_ADDR);
881 for (uint8_t i = 0; i < 6; ++i) {
883 debugging_information + offset, format_str3,
886 offset += sprintf_address_register(
887 debugging_information + offset,
static_cast<uint8_t
>(
RX_ADDR_P0 + i));
891 debugging_information + offset,
PSTR(
"%02X"),
907 encoded_details += 5;
909 else if (i != 0x18 && i != 0x19 && i != 0x1a && i != 0x1b) {
914 *encoded_details++ = ce_pin >> 4;
915 *encoded_details++ = ce_pin & 0xFF;
916 *encoded_details++ = csn_pin >> 4;
917 *encoded_details++ = csn_pin & 0xFF;
918 *encoded_details =
static_cast<uint8_t
>((spi_speed / 1000000) |
_BV(_is_p_variant * 4));
923#if defined(RF24_SPI_PTR) || defined(DOXYGEN_FORCED)
929 return _init_pins() && _init_radio();
938 return begin(spiBus);
956#if defined(RF24_LINUX)
957 #if defined(RF24_RPi)
962 case 8: csn_pin = 0;
break;
963 case 7: csn_pin = 1;
break;
964 case 18: csn_pin = 10;
break;
965 case 17: csn_pin = 11;
break;
966 case 16: csn_pin = 12;
break;
967 default: csn_pin = 0;
break;
971 _SPI.begin(csn_pin, spi_speed);
973#elif defined(XMEGA_D3)
974 _spi->begin(csn_pin);
976#elif defined(RF24_RP2)
978 _spi->begin(PICO_DEFAULT_SPI ? spi1 : spi0);
982 #if defined(RF24_SPI_PTR)
990 return _init_pins() && _init_radio();
995bool RF24::_init_pins()
1002#if defined(RF24_LINUX)
1008#elif defined(LITTLEWIRE)
1012#elif defined(XMEGA_D3)
1013 if (ce_pin != csn_pin) {
1023 if (ce_pin != csn_pin) {
1031 #if defined(__ARDUINO_X86__)
1041bool RF24::_init_radio()
1063 _is_p_variant = before_toggle == after_toggle;
1065 if (_is_p_variant) {
1073 write_register(
DYNPD, 0);
1075 write_register(
EN_AA, 0x3F);
1120 return ce_pin != RF24_PIN_INVALID && csn_pin != RF24_PIN_INVALID;
1127#if !defined(RF24_TINY) && !defined(LITTLEWIRE)
1159 config_reg =
static_cast<uint8_t
>(config_reg & ~_BV(
PRIM_RX));
1162#if defined(RF24_TINY) || defined(LITTLEWIRE)
1164 if (ce_pin == csn_pin) {
1177 config_reg =
static_cast<uint8_t
>(config_reg & ~_BV(
PWR_UP));
1199#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1201void RF24::errNotify()
1203 #if defined(RF24_DEBUG) || defined(RF24_LINUX)
1204 printf_P(
PSTR(
"RF24 HARDWARE FAIL: Radio not responding, verify pin connections, wiring, etc.\r\n"));
1206 #if defined(FAILURE_HANDLING)
1223#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1224 uint32_t timer =
millis();
1228#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1229 if (
millis() - timer > 95) {
1231 #if defined(FAILURE_HANDLING)
1255 return write(buf, len, 0);
1268 uint32_t timer =
millis();
1274 if (
millis() - timer > timeout) {
1278#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1279 if (
millis() - timer > (timeout + 95)) {
1281 #if defined(FAILURE_HANDLING)
1314#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1315 uint32_t timer =
millis();
1324#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1325 if (
millis() - timer > 95) {
1327 #if defined(FAILURE_HANDLING)
1369#if !defined(F_CPU) || F_CPU > 20000000
1394 return static_cast<bool>(
isFifo(about_tx) &
_BV(!check_empty));
1402#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1403 uint32_t timeout =
millis();
1412#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1413 if (
millis() - timeout > 95) {
1415 #if defined(FAILURE_HANDLING)
1435 uint32_t start =
millis();
1442 if (
millis() - start >= timeout) {
1448#if defined(FAILURE_HANDLING) || defined(RF24_LINUX)
1449 if (
millis() - start > (timeout + 95)) {
1451 #if defined(FAILURE_HANDLING)
1505 *pipe_num = (get_status() >>
RX_P_NO) & 0x07;
1516 read_payload(buf, len);
1568 memcpy(pipe0_reading_address, &address,
addr_width);
1592 a_width =
static_cast<uint8_t
>(a_width - 2);
1594 write_register(
SETUP_AW,
static_cast<uint8_t
>(a_width % 4));
1595 addr_width =
static_cast<uint8_t
>((a_width % 4) + 2);
1598 write_register(
SETUP_AW,
static_cast<uint8_t
>(0));
1611 memcpy(pipe0_reading_address, address,
addr_width);
1643void RF24::toggle_features(
void)
1646#if defined(RF24_SPI_PTR)
1648 _spi->transfer(0x73);
1651 _SPI.transfer(0x73);
1691 write_register(
DYNPD, 0);
1747 const uint8_t* current =
reinterpret_cast<const uint8_t*
>(buf);
1767 return _is_p_variant;
1775 write_register(
EN_AA, 0x3F);
1778 write_register(
EN_AA, 0);
1793 en_aa |=
static_cast<uint8_t
>(
_BV(pipe));
1796 en_aa =
static_cast<uint8_t
>(en_aa & ~_BV(pipe));
1801 write_register(
EN_AA, en_aa);
1824 setup |= _pa_level_reg_value(level, lnaEnable);
1846 bool result =
false;
1851 setup |= _data_rate_reg_value(speed);
1890 config_reg =
static_cast<uint8_t
>(config_reg & ~(
_BV(
CRCO) |
_BV(
EN_CRC)));
1930 config_reg =
static_cast<uint8_t
>(config_reg & ~_BV(
EN_CRC));
1948 uint8_t dummy_buf[32];
1949 for (uint8_t i = 0; i < 32; ++i)
1950 dummy_buf[i] = 0xFF;
1954 write_register(
TX_ADDR,
reinterpret_cast<uint8_t*
>(&dummy_buf), 5);
1959 write_register(
W_TX_PAYLOAD,
reinterpret_cast<const uint8_t*
>(&dummy_buf), 32);
1992 write_register(
EN_RXADDR,
static_cast<uint8_t
>(isEnabled ? 0x3F : 0));
1999#if !defined(F_CPU) || F_CPU > 20000000
2005#if !defined(F_CPU) || F_CPU > 20000000
2015#if !defined(F_CPU) || F_CPU > 20000000
2025 return static_cast<uint8_t
>(0);
2030uint8_t RF24::_pa_level_reg_value(uint8_t level,
bool lnaEnable)
2035 return static_cast<uint8_t
>(((level >
RF24_PA_MAX ?
static_cast<uint8_t
>(
RF24_PA_MAX) : level) << 1) + lnaEnable);
2042 uint8_t setup = _data_rate_reg_value(speed);
2043 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_NO_FETCH_PIPE
A sentinel used to control fetching the pipe info in RF24::available().
#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)
uint8_t isFifo(bool about_tx)
void stopConstCarrier(void)
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