LibDriver NRF24L01  1.0.0
NRF24L01 full-featured driver
driver_nrf24l01_basic.c
Go to the documentation of this file.
1 
37 #include "driver_nrf24l01_basic.h"
38 
39 static nrf24l01_handle_t gs_handle;
49 {
50  if (nrf24l01_irq_handler(&gs_handle) != 0)
51  {
52  return 1;
53  }
54  else
55  {
56  return 0;
57  }
58 }
59 
69 uint8_t nrf24l01_basic_init(nrf24l01_type_t type, void (*callback)(uint8_t type, uint8_t num, uint8_t *buf, uint8_t len))
70 {
71  uint8_t res;
72  uint8_t reg;
73  uint8_t addr0[5] = NRF24L01_BASIC_DEFAULT_RX_ADDR_0;
74  uint8_t addr1[5] = NRF24L01_BASIC_DEFAULT_RX_ADDR_1;
75  uint8_t addr2[5] = NRF24L01_BASIC_DEFAULT_RX_ADDR_2;
76  uint8_t addr3[5] = NRF24L01_BASIC_DEFAULT_RX_ADDR_3;
77  uint8_t addr4[5] = NRF24L01_BASIC_DEFAULT_RX_ADDR_4;
78  uint8_t addr5[5] = NRF24L01_BASIC_DEFAULT_RX_ADDR_5;
79 
80  /* link function */
91  DRIVER_NRF24L01_LINK_RECEIVE_CALLBACK(&gs_handle, callback);
92 
93  /* init */
94  res = nrf24l01_init(&gs_handle);
95  if (res != 0)
96  {
97  nrf24l01_interface_debug_print("nrf24l01: init failed.\n");
98 
99  return 1;
100  }
101 
102  /* set active false */
103  res = nrf24l01_set_active(&gs_handle, NRF24L01_BOOL_FALSE);
104  if (res != 0)
105  {
106  nrf24l01_interface_debug_print("nrf24l01: set active failed.\n");
107  (void)nrf24l01_deinit(&gs_handle);
108 
109  return 1;
110  }
111 
112  /* enable power up */
114  if (res != 0)
115  {
116  nrf24l01_interface_debug_print("nrf24l01: set config failed.\n");
117  (void)nrf24l01_deinit(&gs_handle);
118 
119  return 1;
120  }
121 
122  /* set crco */
124  if (res != 0)
125  {
126  nrf24l01_interface_debug_print("nrf24l01: set config failed.\n");
127  (void)nrf24l01_deinit(&gs_handle);
128 
129  return 1;
130  }
131 
132  /* set crc */
134  if (res != 0)
135  {
136  nrf24l01_interface_debug_print("nrf24l01: set config failed.\n");
137  (void)nrf24l01_deinit(&gs_handle);
138 
139  return 1;
140  }
141 
142  /* enable max rt */
144  if (res != 0)
145  {
146  nrf24l01_interface_debug_print("nrf24l01: set config failed.\n");
147  (void)nrf24l01_deinit(&gs_handle);
148 
149  return 1;
150  }
151 
152  /* enable tx ds */
154  if (res != 0)
155  {
156  nrf24l01_interface_debug_print("nrf24l01: set config failed.\n");
157  (void)nrf24l01_deinit(&gs_handle);
158 
159  return 1;
160  }
161 
162  /* enable rx dr */
164  if (res != 0)
165  {
166  nrf24l01_interface_debug_print("nrf24l01: set config failed.\n");
167  (void)nrf24l01_deinit(&gs_handle);
168 
169  return 1;
170  }
171 
172  if (type == NRF24L01_TYPE_TX)
173  {
174  /* set tx mode */
175  res = nrf24l01_set_mode(&gs_handle, NRF24L01_MODE_TX);
176  if (res != 0)
177  {
178  nrf24l01_interface_debug_print("nrf24l01: set mode failed.\n");
179  (void)nrf24l01_deinit(&gs_handle);
180 
181  return 1;
182  }
183  }
184  else
185  {
186  /* set rx mode */
187  res = nrf24l01_set_mode(&gs_handle, NRF24L01_MODE_RX);
188  if (res != 0)
189  {
190  nrf24l01_interface_debug_print("nrf24l01: set mode failed.\n");
191  (void)nrf24l01_deinit(&gs_handle);
192 
193  return 1;
194  }
195  }
196 
197  /* set pipe 0 auto acknowledgment */
199  if (res != 0)
200  {
201  nrf24l01_interface_debug_print("nrf24l01: set auto acknowledgment failed.\n");
202  (void)nrf24l01_deinit(&gs_handle);
203 
204  return 1;
205  }
206 
207  /* set pipe 1 auto acknowledgment */
209  if (res != 0)
210  {
211  nrf24l01_interface_debug_print("nrf24l01: set auto acknowledgment failed.\n");
212  (void)nrf24l01_deinit(&gs_handle);
213 
214  return 1;
215  }
216 
217  /* set pipe 2 auto acknowledgment */
219  if (res != 0)
220  {
221  nrf24l01_interface_debug_print("nrf24l01: set auto acknowledgment failed.\n");
222  (void)nrf24l01_deinit(&gs_handle);
223 
224  return 1;
225  }
226 
227  /* set pipe 3 auto acknowledgment */
229  if (res != 0)
230  {
231  nrf24l01_interface_debug_print("nrf24l01: set auto acknowledgment failed.\n");
232  (void)nrf24l01_deinit(&gs_handle);
233 
234  return 1;
235  }
236 
237  /* set pipe 4 auto acknowledgment */
239  if (res != 0)
240  {
241  nrf24l01_interface_debug_print("nrf24l01: set auto acknowledgment failed.\n");
242  (void)nrf24l01_deinit(&gs_handle);
243 
244  return 1;
245  }
246 
247  /* set pipe 5 auto acknowledgment */
249  if (res != 0)
250  {
251  nrf24l01_interface_debug_print("nrf24l01: set auto acknowledgment failed.\n");
252  (void)nrf24l01_deinit(&gs_handle);
253 
254  return 1;
255  }
256 
257  /* set pipe 0 rx */
259  if (res != 0)
260  {
261  nrf24l01_interface_debug_print("nrf24l01: set rx pipe failed.\n");
262  (void)nrf24l01_deinit(&gs_handle);
263 
264  return 1;
265  }
266 
267  /* set pipe 1 rx */
269  if (res != 0)
270  {
271  nrf24l01_interface_debug_print("nrf24l01: set rx pipe failed.\n");
272  (void)nrf24l01_deinit(&gs_handle);
273 
274  return 1;
275  }
276 
277  /* set pipe 2 rx */
279  if (res != 0)
280  {
281  nrf24l01_interface_debug_print("nrf24l01: set rx pipe failed.\n");
282  (void)nrf24l01_deinit(&gs_handle);
283 
284  return 1;
285  }
286 
287  /* set pipe 3 rx */
289  if (res != 0)
290  {
291  nrf24l01_interface_debug_print("nrf24l01: set rx pipe failed.\n");
292  (void)nrf24l01_deinit(&gs_handle);
293 
294  return 1;
295  }
296 
297  /* set pipe 4 rx */
299  if (res != 0)
300  {
301  nrf24l01_interface_debug_print("nrf24l01: set rx pipe failed.\n");
302  (void)nrf24l01_deinit(&gs_handle);
303 
304  return 1;
305  }
306 
307  /* set pipe 5 rx */
309  if (res != 0)
310  {
311  nrf24l01_interface_debug_print("nrf24l01: set rx pipe failed.\n");
312  (void)nrf24l01_deinit(&gs_handle);
313 
314  return 1;
315  }
316 
317  /* set address width */
319  if (res != 0)
320  {
321  nrf24l01_interface_debug_print("nrf24l01: set address width failed.\n");
322  (void)nrf24l01_deinit(&gs_handle);
323 
324  return 1;
325  }
326 
327  /* convert auto retransmit delay */
329  if (res != 0)
330  {
331  nrf24l01_interface_debug_print("nrf24l01: auto retransmit delay failed.\n");
332  (void)nrf24l01_deinit(&gs_handle);
333 
334  return 1;
335  }
336 
337  /* set auto retransmit delay */
338  res = nrf24l01_set_auto_retransmit_delay(&gs_handle, reg);
339  if (res != 0)
340  {
341  nrf24l01_interface_debug_print("nrf24l01: auto retransmit delay failed.\n");
342  (void)nrf24l01_deinit(&gs_handle);
343 
344  return 1;
345  }
346 
347  /* set the auto retransmit count */
349  if (res != 0)
350  {
351  nrf24l01_interface_debug_print("nrf24l01: auto retransmit count failed.\n");
352  (void)nrf24l01_deinit(&gs_handle);
353 
354  return 1;
355  }
356 
357  /* set the channel frequency */
359  if (res != 0)
360  {
361  nrf24l01_interface_debug_print("nrf24l01: set channel frequency failed.\n");
362  (void)nrf24l01_deinit(&gs_handle);
363 
364  return 1;
365  }
366 
367  /* disable continuous carrier transmit */
369  if (res != 0)
370  {
371  nrf24l01_interface_debug_print("nrf24l01: set continuous carrier transmit failed.\n");
372  (void)nrf24l01_deinit(&gs_handle);
373 
374  return 1;
375  }
376 
377  /* disable force pll lock signal */
379  if (res != 0)
380  {
381  nrf24l01_interface_debug_print("nrf24l01: set force pll lock signal failed.\n");
382  (void)nrf24l01_deinit(&gs_handle);
383 
384  return 1;
385  }
386 
387  /* set data rate */
389  if (res != 0)
390  {
391  nrf24l01_interface_debug_print("nrf24l01: set data rate 2M failed.\n");
392  (void)nrf24l01_deinit(&gs_handle);
393 
394  return 1;
395  }
396 
397  /* set output power */
399  if (res != 0)
400  {
401  nrf24l01_interface_debug_print("nrf24l01: set output power failed.\n");
402  (void)nrf24l01_deinit(&gs_handle);
403 
404  return 1;
405  }
406 
407  /* clear interrupt rx_dr */
409  if (res != 0)
410  {
411  nrf24l01_interface_debug_print("nrf24l01: clear interrupt failed.\n");
412  (void)nrf24l01_deinit(&gs_handle);
413 
414  return 1;
415  }
416 
417  /* clear interrupt tx_ds */
419  if (res != 0)
420  {
421  nrf24l01_interface_debug_print("nrf24l01: clear interrupt failed.\n");
422  (void)nrf24l01_deinit(&gs_handle);
423 
424  return 1;
425  }
426 
427  /* clear interrupt max_rt */
429  if (res != 0)
430  {
431  nrf24l01_interface_debug_print("nrf24l01: clear interrupt failed.\n");
432  (void)nrf24l01_deinit(&gs_handle);
433 
434  return 1;
435  }
436 
437  /* clear interrupt tx_full */
439  if (res != 0)
440  {
441  nrf24l01_interface_debug_print("nrf24l01: clear interrupt failed.\n");
442  (void)nrf24l01_deinit(&gs_handle);
443 
444  return 1;
445  }
446 
447  /* set pipe 0 payload number */
449  if (res != 0)
450  {
451  nrf24l01_interface_debug_print("nrf24l01: set pipe 0 payload number failed.\n");
452  (void)nrf24l01_deinit(&gs_handle);
453 
454  return 1;
455  }
456 
457  /* set pipe 1 payload number */
459  if (res != 0)
460  {
461  nrf24l01_interface_debug_print("nrf24l01: set pipe 1 payload number failed.\n");
462  (void)nrf24l01_deinit(&gs_handle);
463 
464  return 1;
465  }
466 
467  /* set pipe 2 payload number */
469  if (res != 0)
470  {
471  nrf24l01_interface_debug_print("nrf24l01: set pipe 2 payload number failed.\n");
472  (void)nrf24l01_deinit(&gs_handle);
473 
474  return 1;
475  }
476 
477  /* set pipe 3 payload number */
479  if (res != 0)
480  {
481  nrf24l01_interface_debug_print("nrf24l01: set pipe 3 payload number failed.\n");
482  (void)nrf24l01_deinit(&gs_handle);
483 
484  return 1;
485  }
486 
487  /* set pipe 4 payload number */
489  if (res != 0)
490  {
491  nrf24l01_interface_debug_print("nrf24l01: set pipe 4 payload number failed.\n");
492  (void)nrf24l01_deinit(&gs_handle);
493 
494  return 1;
495  }
496 
497  /* set pipe 5 payload number */
499  if (res != 0)
500  {
501  nrf24l01_interface_debug_print("nrf24l01: set pipe 5 payload number failed.\n");
502  (void)nrf24l01_deinit(&gs_handle);
503 
504  return 1;
505  }
506 
507  /* set pipe 0 dynamic payload */
509  if (res != 0)
510  {
511  nrf24l01_interface_debug_print("nrf24l01: set pipe dynamic payload failed.\n");
512  (void)nrf24l01_deinit(&gs_handle);
513 
514  return 1;
515  }
516 
517  /* set pipe 1 dynamic payload */
519  if (res != 0)
520  {
521  nrf24l01_interface_debug_print("nrf24l01: set pipe dynamic payload failed.\n");
522  (void)nrf24l01_deinit(&gs_handle);
523 
524  return 1;
525  }
526 
527  /* set pipe 2 dynamic payload */
529  if (res != 0)
530  {
531  nrf24l01_interface_debug_print("nrf24l01: set pipe dynamic payload failed.\n");
532  (void)nrf24l01_deinit(&gs_handle);
533 
534  return 1;
535  }
536 
537  /* set pipe 3 dynamic payload */
539  if (res != 0)
540  {
541  nrf24l01_interface_debug_print("nrf24l01: set pipe dynamic payload failed.\n");
542  (void)nrf24l01_deinit(&gs_handle);
543 
544  return 1;
545  }
546 
547  /* set pipe 4 dynamic payload */
549  if (res != 0)
550  {
551  nrf24l01_interface_debug_print("nrf24l01: set pipe dynamic payload failed.\n");
552  (void)nrf24l01_deinit(&gs_handle);
553 
554  return 1;
555  }
556 
557  /* set pipe 5 dynamic payload */
559  if (res != 0)
560  {
561  nrf24l01_interface_debug_print("nrf24l01: set pipe dynamic payload failed.\n");
562  (void)nrf24l01_deinit(&gs_handle);
563 
564  return 1;
565  }
566 
567  /* set dynamic payload */
569  if (res != 0)
570  {
571  nrf24l01_interface_debug_print("nrf24l01: set dynamic payload failed.\n");
572  (void)nrf24l01_deinit(&gs_handle);
573 
574  return 1;
575  }
576 
577  /* set payload with ack */
579  if (res != 0)
580  {
581  nrf24l01_interface_debug_print("nrf24l01: set payload with ack failed.\n");
582  (void)nrf24l01_deinit(&gs_handle);
583 
584  return 1;
585  }
586 
587  /* set tx payload with no ack */
589  if (res != 0)
590  {
591  nrf24l01_interface_debug_print("nrf24l01: set tx payload with no ack failed.\n");
592  (void)nrf24l01_deinit(&gs_handle);
593 
594  return 1;
595  }
596 
597  /* set rx pipe 0 address */
598  res = nrf24l01_set_rx_pipe_0_address(&gs_handle, (uint8_t *)addr0, NRF24L01_BASIC_DEFAULT_ADDRESS_WIDTH + 2);
599  if (res != 0)
600  {
601  nrf24l01_interface_debug_print("nrf24l01: set rx pipe 0 address failed.\n");
602  (void)nrf24l01_deinit(&gs_handle);
603 
604  return 1;
605  }
606 
607  /* set rx pipe 1 address */
608  res = nrf24l01_set_rx_pipe_1_address(&gs_handle, (uint8_t *)addr1, NRF24L01_BASIC_DEFAULT_ADDRESS_WIDTH + 2);
609  if (res != 0)
610  {
611  nrf24l01_interface_debug_print("nrf24l01: set rx pipe 1 address failed.\n");
612  (void)nrf24l01_deinit(&gs_handle);
613 
614  return 1;
615  }
616 
617  /* set rx pipe 2 address */
618  res = nrf24l01_set_rx_pipe_2_address(&gs_handle, addr2[4]);
619  if (res != 0)
620  {
621  nrf24l01_interface_debug_print("nrf24l01: set rx pipe 2 address failed.\n");
622  (void)nrf24l01_deinit(&gs_handle);
623 
624  return 1;
625  }
626 
627  /* set rx pipe 3 address */
628  res = nrf24l01_set_rx_pipe_3_address(&gs_handle, addr3[4]);
629  if (res != 0)
630  {
631  nrf24l01_interface_debug_print("nrf24l01: set rx pipe 3 address failed.\n");
632  (void)nrf24l01_deinit(&gs_handle);
633 
634  return 1;
635  }
636 
637  /* set rx pipe 4 address */
638  res = nrf24l01_set_rx_pipe_4_address(&gs_handle, addr4[4]);
639  if (res != 0)
640  {
641  nrf24l01_interface_debug_print("nrf24l01: set rx pipe 4 address failed.\n");
642  (void)nrf24l01_deinit(&gs_handle);
643 
644  return 1;
645  }
646 
647  /* set rx pipe 5 address */
648  res = nrf24l01_set_rx_pipe_5_address(&gs_handle, addr5[4]);
649  if (res != 0)
650  {
651  nrf24l01_interface_debug_print("nrf24l01: set rx pipe 5 address failed.\n");
652  (void)nrf24l01_deinit(&gs_handle);
653 
654  return 1;
655  }
656 
657  /* flush tx */
658  res = nrf24l01_flush_tx(&gs_handle);
659  if (res != 0)
660  {
661  nrf24l01_interface_debug_print("nrf24l01: flush tx failed.\n");
662  (void)nrf24l01_deinit(&gs_handle);
663 
664  return 1;
665  }
666 
667  /* flush rx */
668  res = nrf24l01_flush_rx(&gs_handle);
669  if (res != 0)
670  {
671  nrf24l01_interface_debug_print("nrf24l01: flush rx failed.\n");
672  (void)nrf24l01_deinit(&gs_handle);
673 
674  return 1;
675  }
676 
677  /* set active true */
678  res = nrf24l01_set_active(&gs_handle, NRF24L01_BOOL_TRUE);
679  if (res != 0)
680  {
681  nrf24l01_interface_debug_print("nrf24l01: set active failed.\n");
682  (void)nrf24l01_deinit(&gs_handle);
683 
684  return 1;
685  }
686 
687  return 0;
688 }
689 
698 {
699  if (nrf24l01_deinit(&gs_handle) != 0)
700  {
701  return 1;
702  }
703  else
704  {
705  return 0;
706  }
707 }
708 
719 uint8_t nrf24l01_basic_send(uint8_t *addr, uint8_t *buf, uint8_t len)
720 {
721  uint8_t res;
722 
723  /* set active false */
724  res = nrf24l01_set_active(&gs_handle, NRF24L01_BOOL_FALSE);
725  if (res != 0)
726  {
727  return 1;
728  }
729 
730  /* set tx address */
731  res = nrf24l01_set_tx_address(&gs_handle, (uint8_t *)addr, NRF24L01_BASIC_DEFAULT_ADDRESS_WIDTH + 2);
732  if (res != 0)
733  {
734  return 1;
735  }
736 
737  /* set rx pipe 0 address */
738  res = nrf24l01_set_rx_pipe_0_address(&gs_handle, (uint8_t *)addr, NRF24L01_BASIC_DEFAULT_ADDRESS_WIDTH + 2);
739  if (res != 0)
740  {
741  return 1;
742  }
743 
744  /* send data */
745  res = nrf24l01_send(&gs_handle, (uint8_t *)buf, len);
746  if (res != 0)
747  {
748  return 1;
749  }
750 
751  return 0;
752 }
driver nrf24l01 basic header file
uint8_t nrf24l01_flush_tx(nrf24l01_handle_t *handle)
flush tx
uint8_t nrf24l01_set_dynamic_payload(nrf24l01_handle_t *handle, nrf24l01_bool_t enable)
enable or disable the dynamic payload
uint8_t nrf24l01_set_rx_pipe_3_address(nrf24l01_handle_t *handle, uint8_t addr)
set the rx pipe 3 address
uint8_t nrf24l01_set_tx_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len)
set the tx address
uint8_t nrf24l01_set_pipe_2_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 2 payload number
uint8_t nrf24l01_set_pipe_0_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 0 payload number
uint8_t nrf24l01_set_tx_payload_with_no_ack(nrf24l01_handle_t *handle, nrf24l01_bool_t enable)
enable or disable the tx payload with no ack
uint8_t nrf24l01_set_pipe_dynamic_payload(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t enable)
enable or disable the pipe dynamic payload
uint8_t nrf24l01_set_auto_retransmit_count(nrf24l01_handle_t *handle, uint8_t count)
set the auto retransmit count
uint8_t nrf24l01_set_pipe_4_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 4 payload number
uint8_t nrf24l01_send(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len)
send data
uint8_t nrf24l01_set_payload_with_ack(nrf24l01_handle_t *handle, nrf24l01_bool_t enable)
enable or disable the payload with ack
uint8_t nrf24l01_set_config(nrf24l01_handle_t *handle, nrf24l01_config_t config, nrf24l01_bool_t enable)
enable or disable configure
uint8_t nrf24l01_set_output_power(nrf24l01_handle_t *handle, nrf24l01_output_power_t power)
set the output power
uint8_t nrf24l01_set_rx_pipe_1_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len)
set the rx pipe 1 address
uint8_t nrf24l01_set_channel_frequency(nrf24l01_handle_t *handle, uint8_t freq)
set the channel frequency
uint8_t nrf24l01_irq_handler(nrf24l01_handle_t *handle)
irq handler
uint8_t nrf24l01_set_auto_acknowledgment(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t enable)
enable or disable auto acknowledgment
uint8_t nrf24l01_clear_interrupt(nrf24l01_handle_t *handle, nrf24l01_interrupt_t type)
clear the interrupt status
uint8_t nrf24l01_set_pipe_3_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 3 payload number
uint8_t nrf24l01_auto_retransmit_delay_convert_to_register(nrf24l01_handle_t *handle, uint32_t us, uint8_t *reg)
convert the delay to the register raw data
uint8_t nrf24l01_set_rx_pipe_5_address(nrf24l01_handle_t *handle, uint8_t addr)
set the rx pipe 5 address
uint8_t nrf24l01_set_address_width(nrf24l01_handle_t *handle, nrf24l01_address_width_t width)
set the address width
uint8_t nrf24l01_set_active(nrf24l01_handle_t *handle, nrf24l01_bool_t enable)
enable or disable the chip
uint8_t nrf24l01_set_rx_pipe(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t enable)
enable or disable rx pipe
uint8_t nrf24l01_set_pipe_5_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 5 payload number
uint8_t nrf24l01_set_continuous_carrier_transmit(nrf24l01_handle_t *handle, nrf24l01_bool_t enable)
enable or disable continuous carrier transmit
uint8_t nrf24l01_init(nrf24l01_handle_t *handle)
initialize the chip
uint8_t nrf24l01_set_force_pll_lock_signal(nrf24l01_handle_t *handle, nrf24l01_bool_t enable)
enable or disable force pll lock signal
uint8_t nrf24l01_set_rx_pipe_2_address(nrf24l01_handle_t *handle, uint8_t addr)
set the rx pipe 2 address
uint8_t nrf24l01_set_mode(nrf24l01_handle_t *handle, nrf24l01_mode_t mode)
set the chip mode
uint8_t nrf24l01_set_auto_retransmit_delay(nrf24l01_handle_t *handle, uint8_t delay)
set the auto retransmit delay
uint8_t nrf24l01_set_pipe_1_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 1 payload number
uint8_t nrf24l01_flush_rx(nrf24l01_handle_t *handle)
flush rx
uint8_t nrf24l01_deinit(nrf24l01_handle_t *handle)
close the chip
uint8_t nrf24l01_set_data_rate(nrf24l01_handle_t *handle, nrf24l01_data_rate_t rate)
set the data rate
uint8_t nrf24l01_set_rx_pipe_0_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len)
set the rx pipe 0 address
uint8_t nrf24l01_set_rx_pipe_4_address(nrf24l01_handle_t *handle, uint8_t addr)
set the rx pipe 4 address
@ NRF24L01_CONFIG_CRCO
@ NRF24L01_CONFIG_EN_CRC
@ NRF24L01_CONFIG_MASK_TX_DS
@ NRF24L01_CONFIG_MASK_MAX_RT
@ NRF24L01_CONFIG_PWR_UP
@ NRF24L01_CONFIG_MASK_RX_DR
@ NRF24L01_MODE_RX
@ NRF24L01_MODE_TX
@ NRF24L01_INTERRUPT_TX_DS
@ NRF24L01_INTERRUPT_MAX_RT
@ NRF24L01_INTERRUPT_RX_DR
@ NRF24L01_INTERRUPT_TX_FULL
@ NRF24L01_PIPE_0
@ NRF24L01_PIPE_4
@ NRF24L01_PIPE_5
@ NRF24L01_PIPE_3
@ NRF24L01_PIPE_1
@ NRF24L01_PIPE_2
@ NRF24L01_BOOL_FALSE
@ NRF24L01_BOOL_TRUE
#define NRF24L01_BASIC_DEFAULT_PIPE_3_AUTO_ACKNOWLEDGMENT
#define NRF24L01_BASIC_DEFAULT_RX_ADDR_3
#define NRF24L01_BASIC_DEFAULT_RX_ADDR_5
#define NRF24L01_BASIC_DEFAULT_RX_PIPE_3
#define NRF24L01_BASIC_DEFAULT_PIPE_4_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_RETRANSMIT_COUNT
#define NRF24L01_BASIC_DEFAULT_RX_ADDR_2
uint8_t nrf24l01_basic_send(uint8_t *addr, uint8_t *buf, uint8_t len)
basic example send
#define NRF24L01_BASIC_DEFAULT_PIPE_2_AUTO_ACKNOWLEDGMENT
#define NRF24L01_BASIC_DEFAULT_CHANNEL_FREQUENCY
#define NRF24L01_BASIC_DEFAULT_PIPE_4_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_CRCO
nrf24l01 basic example default definition
#define NRF24L01_BASIC_DEFAULT_PIPE_3_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_RX_PIPE_1
#define NRF24L01_BASIC_DEFAULT_RX_ADDR_0
nrf24l01_type_t
nrf24l01 type enumeration definition
#define NRF24L01_BASIC_DEFAULT_RX_PIPE_0
uint8_t nrf24l01_interrupt_irq_handler(void)
nrf24l01 irq
#define NRF24L01_BASIC_DEFAULT_PIPE_0_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_0_AUTO_ACKNOWLEDGMENT
#define NRF24L01_BASIC_DEFAULT_PAYLOAD_WITH_ACK
#define NRF24L01_BASIC_DEFAULT_RX_PIPE_4
#define NRF24L01_BASIC_DEFAULT_PIPE_3_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_DATA_RATE
#define NRF24L01_BASIC_DEFAULT_PIPE_1_AUTO_ACKNOWLEDGMENT
#define NRF24L01_BASIC_DEFAULT_RX_ADDR_1
uint8_t nrf24l01_basic_deinit(void)
basic example deinit
#define NRF24L01_BASIC_DEFAULT_OUTPUT_POWER
#define NRF24L01_BASIC_DEFAULT_PIPE_5_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_2_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_1_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_5_AUTO_ACKNOWLEDGMENT
#define NRF24L01_BASIC_DEFAULT_PIPE_1_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_RX_PIPE_2
#define NRF24L01_BASIC_DEFAULT_PIPE_0_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_RX_PIPE_5
#define NRF24L01_BASIC_DEFAULT_RX_ADDR_4
#define NRF24L01_BASIC_DEFAULT_TX_PAYLOAD_WITH_NO_ACK
#define NRF24L01_BASIC_DEFAULT_ENABLE_CRC
#define NRF24L01_BASIC_DEFAULT_PIPE_2_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_4_AUTO_ACKNOWLEDGMENT
uint8_t nrf24l01_basic_init(nrf24l01_type_t type, void(*callback)(uint8_t type, uint8_t num, uint8_t *buf, uint8_t len))
basic example init
#define NRF24L01_BASIC_DEFAULT_PIPE_5_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_ADDRESS_WIDTH
#define NRF24L01_BASIC_DEFAULT_RETRANSMIT_DELAY
@ NRF24L01_TYPE_TX
uint8_t nrf24l01_interface_spi_read(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus read
uint8_t nrf24l01_interface_spi_deinit(void)
interface spi bus deinit
void nrf24l01_interface_delay_ms(uint32_t ms)
interface delay ms
void nrf24l01_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t nrf24l01_interface_gpio_deinit(void)
interface gpio deinit
uint8_t nrf24l01_interface_gpio_init(void)
interface gpio init
uint8_t nrf24l01_interface_spi_init(void)
interface spi bus init
uint8_t nrf24l01_interface_spi_write(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus write
uint8_t nrf24l01_interface_gpio_write(uint8_t data)
interface gpio write
nrf24l01 handle structure definition