| LibDriver NRF24L01 1.0.0 NRF24L01 full function 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;
48 uint8_t nrf24l01_interrupt_irq_handler(void)
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 */
81 DRIVER_NRF24L01_LINK_INIT(&gs_handle, nrf24l01_handle_t);
82 DRIVER_NRF24L01_LINK_SPI_INIT(&gs_handle, nrf24l01_interface_spi_init);
83 DRIVER_NRF24L01_LINK_SPI_DEINIT(&gs_handle, nrf24l01_interface_spi_deinit);
84 DRIVER_NRF24L01_LINK_SPI_READ(&gs_handle, nrf24l01_interface_spi_read);
85 DRIVER_NRF24L01_LINK_SPI_WRITE(&gs_handle, nrf24l01_interface_spi_write);
86 DRIVER_NRF24L01_LINK_GPIO_INIT(&gs_handle, nrf24l01_interface_gpio_init);
87 DRIVER_NRF24L01_LINK_GPIO_DEINIT(&gs_handle, nrf24l01_interface_gpio_deinit);
88 DRIVER_NRF24L01_LINK_GPIO_WRITE(&gs_handle, nrf24l01_interface_gpio_write);
89 DRIVER_NRF24L01_LINK_DELAY_MS(&gs_handle, nrf24l01_interface_delay_ms);
90 DRIVER_NRF24L01_LINK_DEBUG_PRINT(&gs_handle, nrf24l01_interface_debug_print);
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 */
113 res = nrf24l01_set_config(&gs_handle, NRF24L01_CONFIG_PWR_UP, NRF24L01_BOOL_TRUE);
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 */
123 res = nrf24l01_set_config(&gs_handle, NRF24L01_CONFIG_CRCO, NRF24L01_BASIC_DEFAULT_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 */
133 res = nrf24l01_set_config(&gs_handle, NRF24L01_CONFIG_EN_CRC, NRF24L01_BASIC_DEFAULT_ENABLE_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 */
143 res = nrf24l01_set_config(&gs_handle, NRF24L01_CONFIG_MASK_MAX_RT, NRF24L01_BOOL_FALSE);
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 */
153 res = nrf24l01_set_config(&gs_handle, NRF24L01_CONFIG_MASK_TX_DS, NRF24L01_BOOL_FALSE);
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 */
163 res = nrf24l01_set_config(&gs_handle, NRF24L01_CONFIG_MASK_RX_DR, NRF24L01_BOOL_FALSE);
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 */
198 res = nrf24l01_set_auto_acknowledgment(&gs_handle, NRF24L01_PIPE_0, NRF24L01_BASIC_DEFAULT_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 */
208 res = nrf24l01_set_auto_acknowledgment(&gs_handle, NRF24L01_PIPE_1, NRF24L01_BASIC_DEFAULT_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 */
218 res = nrf24l01_set_auto_acknowledgment(&gs_handle, NRF24L01_PIPE_2, NRF24L01_BASIC_DEFAULT_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 */
228 res = nrf24l01_set_auto_acknowledgment(&gs_handle, NRF24L01_PIPE_3, NRF24L01_BASIC_DEFAULT_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 */
238 res = nrf24l01_set_auto_acknowledgment(&gs_handle, NRF24L01_PIPE_4, NRF24L01_BASIC_DEFAULT_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 */
248 res = nrf24l01_set_auto_acknowledgment(&gs_handle, NRF24L01_PIPE_5, NRF24L01_BASIC_DEFAULT_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 */
258 res = nrf24l01_set_rx_pipe(&gs_handle, NRF24L01_PIPE_0, NRF24L01_BASIC_DEFAULT_RX_PIPE_0);
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 */
268 res = nrf24l01_set_rx_pipe(&gs_handle, NRF24L01_PIPE_1, NRF24L01_BASIC_DEFAULT_RX_PIPE_1);
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 */
278 res = nrf24l01_set_rx_pipe(&gs_handle, NRF24L01_PIPE_2, NRF24L01_BASIC_DEFAULT_RX_PIPE_2);
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 */
288 res = nrf24l01_set_rx_pipe(&gs_handle, NRF24L01_PIPE_3, NRF24L01_BASIC_DEFAULT_RX_PIPE_3);
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 */
298 res = nrf24l01_set_rx_pipe(&gs_handle, NRF24L01_PIPE_4, NRF24L01_BASIC_DEFAULT_RX_PIPE_4);
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 */
308 res = nrf24l01_set_rx_pipe(&gs_handle, NRF24L01_PIPE_5, NRF24L01_BASIC_DEFAULT_RX_PIPE_5);
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 */
318 res = nrf24l01_set_address_width(&gs_handle, NRF24L01_BASIC_DEFAULT_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 */
328 res = nrf24l01_auto_retransmit_delay_convert_to_register(&gs_handle, NRF24L01_BASIC_DEFAULT_RETRANSMIT_DELAY, (uint8_t *)&reg);
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 */
348 res = nrf24l01_set_auto_retransmit_count(&gs_handle, NRF24L01_BASIC_DEFAULT_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 */
358 res = nrf24l01_set_channel_frequency(&gs_handle, NRF24L01_BASIC_DEFAULT_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 */
368 res = nrf24l01_set_continuous_carrier_transmit(&gs_handle, NRF24L01_BOOL_FALSE);
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 */
378 res = nrf24l01_set_force_pll_lock_signal(&gs_handle, NRF24L01_BOOL_FALSE);
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 */
388 res = nrf24l01_set_data_rate(&gs_handle, NRF24L01_BASIC_DEFAULT_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 */
398 res = nrf24l01_set_output_power(&gs_handle, NRF24L01_BASIC_DEFAULT_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 */
408 res = nrf24l01_clear_interrupt(&gs_handle, NRF24L01_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 */
418 res = nrf24l01_clear_interrupt(&gs_handle, NRF24L01_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 */
428 res = nrf24l01_clear_interrupt(&gs_handle, NRF24L01_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 */
438 res = nrf24l01_clear_interrupt(&gs_handle, NRF24L01_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 */
448 res = nrf24l01_set_pipe_0_payload_number(&gs_handle, NRF24L01_BASIC_DEFAULT_PIPE_0_PAYLOAD);
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 */
458 res = nrf24l01_set_pipe_1_payload_number(&gs_handle, NRF24L01_BASIC_DEFAULT_PIPE_1_PAYLOAD);
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 */
468 res = nrf24l01_set_pipe_2_payload_number(&gs_handle, NRF24L01_BASIC_DEFAULT_PIPE_2_PAYLOAD);
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 */
478 res = nrf24l01_set_pipe_3_payload_number(&gs_handle, NRF24L01_BASIC_DEFAULT_PIPE_3_PAYLOAD);
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 */
488 res = nrf24l01_set_pipe_4_payload_number(&gs_handle, NRF24L01_BASIC_DEFAULT_PIPE_4_PAYLOAD);
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 */
498 res = nrf24l01_set_pipe_5_payload_number(&gs_handle, NRF24L01_BASIC_DEFAULT_PIPE_5_PAYLOAD);
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 */
508 res = nrf24l01_set_pipe_dynamic_payload(&gs_handle, NRF24L01_PIPE_0, NRF24L01_BASIC_DEFAULT_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 */
518 res = nrf24l01_set_pipe_dynamic_payload(&gs_handle, NRF24L01_PIPE_1, NRF24L01_BASIC_DEFAULT_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 */
528 res = nrf24l01_set_pipe_dynamic_payload(&gs_handle, NRF24L01_PIPE_2, NRF24L01_BASIC_DEFAULT_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 */
538 res = nrf24l01_set_pipe_dynamic_payload(&gs_handle, NRF24L01_PIPE_3, NRF24L01_BASIC_DEFAULT_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 */
548 res = nrf24l01_set_pipe_dynamic_payload(&gs_handle, NRF24L01_PIPE_4, NRF24L01_BASIC_DEFAULT_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 */
558 res = nrf24l01_set_pipe_dynamic_payload(&gs_handle, NRF24L01_PIPE_5, NRF24L01_BASIC_DEFAULT_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 */
568 res = nrf24l01_set_dynamic_payload(&gs_handle, NRF24L01_BASIC_DEFAULT_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 */
578 res = nrf24l01_set_payload_with_ack(&gs_handle, NRF24L01_BASIC_DEFAULT_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 */
588 res = nrf24l01_set_tx_payload_with_no_ack(&gs_handle, NRF24L01_BASIC_DEFAULT_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
697 uint8_t nrf24l01_basic_deinit(void)
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.h
driver nrf24l01 basic header file
nrf24l01_flush_tx
uint8_t nrf24l01_flush_tx(nrf24l01_handle_t *handle)
flush tx
Definition: driver_nrf24l01.c:3550
nrf24l01_set_dynamic_payload
uint8_t nrf24l01_set_dynamic_payload(nrf24l01_handle_t *handle, nrf24l01_bool_t enable)
enable or disable the dynamic payload
Definition: driver_nrf24l01.c:3194
nrf24l01_set_rx_pipe_3_address
uint8_t nrf24l01_set_rx_pipe_3_address(nrf24l01_handle_t *handle, uint8_t addr)
set the rx pipe 3 address
Definition: driver_nrf24l01.c:2246
nrf24l01_set_tx_address
uint8_t nrf24l01_set_tx_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len)
set the tx address
Definition: driver_nrf24l01.c:2458
nrf24l01_set_pipe_2_payload_number
uint8_t nrf24l01_set_pipe_2_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 2 payload number
Definition: driver_nrf24l01.c:2764
nrf24l01_set_pipe_0_payload_number
uint8_t nrf24l01_set_pipe_0_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 0 payload number
Definition: driver_nrf24l01.c:2608
nrf24l01_set_tx_payload_with_no_ack
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
Definition: driver_nrf24l01.c:3358
nrf24l01_set_pipe_dynamic_payload
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
Definition: driver_nrf24l01.c:3111
nrf24l01_set_auto_retransmit_count
uint8_t nrf24l01_set_auto_retransmit_count(nrf24l01_handle_t *handle, uint8_t count)
set the auto retransmit count
Definition: driver_nrf24l01.c:1136
nrf24l01_set_pipe_4_payload_number
uint8_t nrf24l01_set_pipe_4_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 4 payload number
Definition: driver_nrf24l01.c:2920
nrf24l01_send
uint8_t nrf24l01_send(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len)
send data
Definition: driver_nrf24l01.c:350
nrf24l01_set_payload_with_ack
uint8_t nrf24l01_set_payload_with_ack(nrf24l01_handle_t *handle, nrf24l01_bool_t enable)
enable or disable the payload with ack
Definition: driver_nrf24l01.c:3276
nrf24l01_set_config
uint8_t nrf24l01_set_config(nrf24l01_handle_t *handle, nrf24l01_config_t config, nrf24l01_bool_t enable)
enable or disable configure
Definition: driver_nrf24l01.c:577
nrf24l01_set_output_power
uint8_t nrf24l01_set_output_power(nrf24l01_handle_t *handle, nrf24l01_output_power_t power)
set the output power
Definition: driver_nrf24l01.c:1561
nrf24l01_set_rx_pipe_1_address
uint8_t nrf24l01_set_rx_pipe_1_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len)
set the rx pipe 1 address
Definition: driver_nrf24l01.c:2027
nrf24l01_set_channel_frequency
uint8_t nrf24l01_set_channel_frequency(nrf24l01_handle_t *handle, uint8_t freq)
set the channel frequency
Definition: driver_nrf24l01.c:1225
nrf24l01_irq_handler
uint8_t nrf24l01_irq_handler(nrf24l01_handle_t *handle)
irq handler
Definition: driver_nrf24l01.c:436
nrf24l01_set_auto_acknowledgment
uint8_t nrf24l01_set_auto_acknowledgment(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t enable)
enable or disable auto acknowledgment
Definition: driver_nrf24l01.c:743
nrf24l01_clear_interrupt
uint8_t nrf24l01_clear_interrupt(nrf24l01_handle_t *handle, nrf24l01_interrupt_t type)
clear the interrupt status
Definition: driver_nrf24l01.c:1681
nrf24l01_set_pipe_3_payload_number
uint8_t nrf24l01_set_pipe_3_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 3 payload number
Definition: driver_nrf24l01.c:2842
nrf24l01_auto_retransmit_delay_convert_to_register
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
Definition: driver_nrf24l01.c:1081
nrf24l01_set_rx_pipe_5_address
uint8_t nrf24l01_set_rx_pipe_5_address(nrf24l01_handle_t *handle, uint8_t addr)
set the rx pipe 5 address
Definition: driver_nrf24l01.c:2386
nrf24l01_set_address_width
uint8_t nrf24l01_set_address_width(nrf24l01_handle_t *handle, nrf24l01_address_width_t width)
set the address width
Definition: driver_nrf24l01.c:910
nrf24l01_set_active
uint8_t nrf24l01_set_active(nrf24l01_handle_t *handle, nrf24l01_bool_t enable)
enable or disable the chip
Definition: driver_nrf24l01.c:315
nrf24l01_set_rx_pipe
uint8_t nrf24l01_set_rx_pipe(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t enable)
enable or disable rx pipe
Definition: driver_nrf24l01.c:827
nrf24l01_set_pipe_5_payload_number
uint8_t nrf24l01_set_pipe_5_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 5 payload number
Definition: driver_nrf24l01.c:2998
nrf24l01_set_continuous_carrier_transmit
uint8_t nrf24l01_set_continuous_carrier_transmit(nrf24l01_handle_t *handle, nrf24l01_bool_t enable)
enable or disable continuous carrier transmit
Definition: driver_nrf24l01.c:1313
nrf24l01_init
uint8_t nrf24l01_init(nrf24l01_handle_t *handle)
initialize the chip
Definition: driver_nrf24l01.c:153
nrf24l01_set_force_pll_lock_signal
uint8_t nrf24l01_set_force_pll_lock_signal(nrf24l01_handle_t *handle, nrf24l01_bool_t enable)
enable or disable force pll lock signal
Definition: driver_nrf24l01.c:1395
nrf24l01_set_rx_pipe_2_address
uint8_t nrf24l01_set_rx_pipe_2_address(nrf24l01_handle_t *handle, uint8_t addr)
set the rx pipe 2 address
Definition: driver_nrf24l01.c:2176
nrf24l01_set_mode
uint8_t nrf24l01_set_mode(nrf24l01_handle_t *handle, nrf24l01_mode_t mode)
set the chip mode
Definition: driver_nrf24l01.c:660
nrf24l01_set_auto_retransmit_delay
uint8_t nrf24l01_set_auto_retransmit_delay(nrf24l01_handle_t *handle, uint8_t delay)
set the auto retransmit delay
Definition: driver_nrf24l01.c:993
nrf24l01_set_pipe_1_payload_number
uint8_t nrf24l01_set_pipe_1_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 1 payload number
Definition: driver_nrf24l01.c:2686
nrf24l01_flush_rx
uint8_t nrf24l01_flush_rx(nrf24l01_handle_t *handle)
flush rx
Definition: driver_nrf24l01.c:3584
nrf24l01_deinit
uint8_t nrf24l01_deinit(nrf24l01_handle_t *handle)
close the chip
Definition: driver_nrf24l01.c:249
nrf24l01_set_data_rate
uint8_t nrf24l01_set_data_rate(nrf24l01_handle_t *handle, nrf24l01_data_rate_t rate)
set the data rate
Definition: driver_nrf24l01.c:1477
nrf24l01_set_rx_pipe_0_address
uint8_t nrf24l01_set_rx_pipe_0_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len)
set the rx pipe 0 address
Definition: driver_nrf24l01.c:1876
nrf24l01_set_rx_pipe_4_address
uint8_t nrf24l01_set_rx_pipe_4_address(nrf24l01_handle_t *handle, uint8_t addr)
set the rx pipe 4 address
Definition: driver_nrf24l01.c:2316
NRF24L01_CONFIG_CRCO
@ NRF24L01_CONFIG_CRCO
Definition: driver_nrf24l01.h:77
NRF24L01_CONFIG_EN_CRC
@ NRF24L01_CONFIG_EN_CRC
Definition: driver_nrf24l01.h:76
NRF24L01_CONFIG_MASK_TX_DS
@ NRF24L01_CONFIG_MASK_TX_DS
Definition: driver_nrf24l01.h:74
NRF24L01_CONFIG_MASK_MAX_RT
@ NRF24L01_CONFIG_MASK_MAX_RT
Definition: driver_nrf24l01.h:75
NRF24L01_CONFIG_PWR_UP
@ NRF24L01_CONFIG_PWR_UP
Definition: driver_nrf24l01.h:78
NRF24L01_CONFIG_MASK_RX_DR
@ NRF24L01_CONFIG_MASK_RX_DR
Definition: driver_nrf24l01.h:73
NRF24L01_MODE_RX
@ NRF24L01_MODE_RX
Definition: driver_nrf24l01.h:87
NRF24L01_MODE_TX
@ NRF24L01_MODE_TX
Definition: driver_nrf24l01.h:86
NRF24L01_INTERRUPT_TX_DS
@ NRF24L01_INTERRUPT_TX_DS
Definition: driver_nrf24l01.h:141
NRF24L01_INTERRUPT_MAX_RT
@ NRF24L01_INTERRUPT_MAX_RT
Definition: driver_nrf24l01.h:142
NRF24L01_INTERRUPT_RX_DR
@ NRF24L01_INTERRUPT_RX_DR
Definition: driver_nrf24l01.h:140
NRF24L01_INTERRUPT_TX_FULL
@ NRF24L01_INTERRUPT_TX_FULL
Definition: driver_nrf24l01.h:143
NRF24L01_PIPE_0
@ NRF24L01_PIPE_0
Definition: driver_nrf24l01.h:95
NRF24L01_PIPE_4
@ NRF24L01_PIPE_4
Definition: driver_nrf24l01.h:99
NRF24L01_PIPE_5
@ NRF24L01_PIPE_5
Definition: driver_nrf24l01.h:100
NRF24L01_PIPE_3
@ NRF24L01_PIPE_3
Definition: driver_nrf24l01.h:98
NRF24L01_PIPE_1
@ NRF24L01_PIPE_1
Definition: driver_nrf24l01.h:96
NRF24L01_PIPE_2
@ NRF24L01_PIPE_2
Definition: driver_nrf24l01.h:97
NRF24L01_BOOL_FALSE
@ NRF24L01_BOOL_FALSE
Definition: driver_nrf24l01.h:64
NRF24L01_BOOL_TRUE
@ NRF24L01_BOOL_TRUE
Definition: driver_nrf24l01.h:65
NRF24L01_BASIC_DEFAULT_PIPE_3_AUTO_ACKNOWLEDGMENT
#define NRF24L01_BASIC_DEFAULT_PIPE_3_AUTO_ACKNOWLEDGMENT
Definition: driver_nrf24l01_basic.h:61
NRF24L01_BASIC_DEFAULT_RX_ADDR_3
#define NRF24L01_BASIC_DEFAULT_RX_ADDR_3
Definition: driver_nrf24l01_basic.h:94
NRF24L01_BASIC_DEFAULT_RX_ADDR_5
#define NRF24L01_BASIC_DEFAULT_RX_ADDR_5
Definition: driver_nrf24l01_basic.h:96
NRF24L01_BASIC_DEFAULT_RX_PIPE_3
#define NRF24L01_BASIC_DEFAULT_RX_PIPE_3
Definition: driver_nrf24l01_basic.h:67
NRF24L01_BASIC_DEFAULT_PIPE_4_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_4_PAYLOAD
Definition: driver_nrf24l01_basic.h:80
NRF24L01_BASIC_DEFAULT_RETRANSMIT_COUNT
#define NRF24L01_BASIC_DEFAULT_RETRANSMIT_COUNT
Definition: driver_nrf24l01_basic.h:72
NRF24L01_BASIC_DEFAULT_RX_ADDR_2
#define NRF24L01_BASIC_DEFAULT_RX_ADDR_2
Definition: driver_nrf24l01_basic.h:93
nrf24l01_basic_send
uint8_t nrf24l01_basic_send(uint8_t *addr, uint8_t *buf, uint8_t len)
basic example send
Definition: driver_nrf24l01_basic.c:719
NRF24L01_BASIC_DEFAULT_PIPE_2_AUTO_ACKNOWLEDGMENT
#define NRF24L01_BASIC_DEFAULT_PIPE_2_AUTO_ACKNOWLEDGMENT
Definition: driver_nrf24l01_basic.h:60
NRF24L01_BASIC_DEFAULT_CHANNEL_FREQUENCY
#define NRF24L01_BASIC_DEFAULT_CHANNEL_FREQUENCY
Definition: driver_nrf24l01_basic.h:73
NRF24L01_BASIC_DEFAULT_PIPE_4_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_4_DYNAMIC_PAYLOAD
Definition: driver_nrf24l01_basic.h:86
NRF24L01_BASIC_DEFAULT_CRCO
#define NRF24L01_BASIC_DEFAULT_CRCO
nrf24l01 basic example default definition
Definition: driver_nrf24l01_basic.h:56
NRF24L01_BASIC_DEFAULT_PIPE_3_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_3_PAYLOAD
Definition: driver_nrf24l01_basic.h:79
NRF24L01_BASIC_DEFAULT_RX_PIPE_1
#define NRF24L01_BASIC_DEFAULT_RX_PIPE_1
Definition: driver_nrf24l01_basic.h:65
NRF24L01_BASIC_DEFAULT_RX_ADDR_0
#define NRF24L01_BASIC_DEFAULT_RX_ADDR_0
Definition: driver_nrf24l01_basic.h:91
nrf24l01_type_t
nrf24l01_type_t
nrf24l01 type enumeration definition
Definition: driver_nrf24l01_basic.h:102
NRF24L01_BASIC_DEFAULT_RX_PIPE_0
#define NRF24L01_BASIC_DEFAULT_RX_PIPE_0
Definition: driver_nrf24l01_basic.h:64
nrf24l01_interrupt_irq_handler
uint8_t nrf24l01_interrupt_irq_handler(void)
nrf24l01 irq
Definition: driver_nrf24l01_basic.c:48
NRF24L01_BASIC_DEFAULT_PIPE_0_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_0_DYNAMIC_PAYLOAD
Definition: driver_nrf24l01_basic.h:82
NRF24L01_BASIC_DEFAULT_PIPE_0_AUTO_ACKNOWLEDGMENT
#define NRF24L01_BASIC_DEFAULT_PIPE_0_AUTO_ACKNOWLEDGMENT
Definition: driver_nrf24l01_basic.h:58
NRF24L01_BASIC_DEFAULT_PAYLOAD_WITH_ACK
#define NRF24L01_BASIC_DEFAULT_PAYLOAD_WITH_ACK
Definition: driver_nrf24l01_basic.h:89
NRF24L01_BASIC_DEFAULT_RX_PIPE_4
#define NRF24L01_BASIC_DEFAULT_RX_PIPE_4
Definition: driver_nrf24l01_basic.h:68
NRF24L01_BASIC_DEFAULT_PIPE_3_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_3_DYNAMIC_PAYLOAD
Definition: driver_nrf24l01_basic.h:85
NRF24L01_BASIC_DEFAULT_DATA_RATE
#define NRF24L01_BASIC_DEFAULT_DATA_RATE
Definition: driver_nrf24l01_basic.h:74
NRF24L01_BASIC_DEFAULT_PIPE_1_AUTO_ACKNOWLEDGMENT
#define NRF24L01_BASIC_DEFAULT_PIPE_1_AUTO_ACKNOWLEDGMENT
Definition: driver_nrf24l01_basic.h:59
NRF24L01_BASIC_DEFAULT_RX_ADDR_1
#define NRF24L01_BASIC_DEFAULT_RX_ADDR_1
Definition: driver_nrf24l01_basic.h:92
nrf24l01_basic_deinit
uint8_t nrf24l01_basic_deinit(void)
basic example deinit
Definition: driver_nrf24l01_basic.c:697
NRF24L01_BASIC_DEFAULT_OUTPUT_POWER
#define NRF24L01_BASIC_DEFAULT_OUTPUT_POWER
Definition: driver_nrf24l01_basic.h:75
NRF24L01_BASIC_DEFAULT_PIPE_5_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_5_PAYLOAD
Definition: driver_nrf24l01_basic.h:81
NRF24L01_BASIC_DEFAULT_PIPE_2_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_2_DYNAMIC_PAYLOAD
Definition: driver_nrf24l01_basic.h:84
NRF24L01_BASIC_DEFAULT_PIPE_1_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_1_PAYLOAD
Definition: driver_nrf24l01_basic.h:77
NRF24L01_BASIC_DEFAULT_PIPE_5_AUTO_ACKNOWLEDGMENT
#define NRF24L01_BASIC_DEFAULT_PIPE_5_AUTO_ACKNOWLEDGMENT
Definition: driver_nrf24l01_basic.h:63
NRF24L01_BASIC_DEFAULT_PIPE_1_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_1_DYNAMIC_PAYLOAD
Definition: driver_nrf24l01_basic.h:83
NRF24L01_BASIC_DEFAULT_RX_PIPE_2
#define NRF24L01_BASIC_DEFAULT_RX_PIPE_2
Definition: driver_nrf24l01_basic.h:66
NRF24L01_BASIC_DEFAULT_PIPE_0_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_0_PAYLOAD
Definition: driver_nrf24l01_basic.h:76
NRF24L01_BASIC_DEFAULT_RX_PIPE_5
#define NRF24L01_BASIC_DEFAULT_RX_PIPE_5
Definition: driver_nrf24l01_basic.h:69
NRF24L01_BASIC_DEFAULT_RX_ADDR_4
#define NRF24L01_BASIC_DEFAULT_RX_ADDR_4
Definition: driver_nrf24l01_basic.h:95
NRF24L01_BASIC_DEFAULT_TX_PAYLOAD_WITH_NO_ACK
#define NRF24L01_BASIC_DEFAULT_TX_PAYLOAD_WITH_NO_ACK
Definition: driver_nrf24l01_basic.h:90
NRF24L01_BASIC_DEFAULT_ENABLE_CRC
#define NRF24L01_BASIC_DEFAULT_ENABLE_CRC
Definition: driver_nrf24l01_basic.h:57
NRF24L01_BASIC_DEFAULT_PIPE_2_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_2_PAYLOAD
Definition: driver_nrf24l01_basic.h:78
NRF24L01_BASIC_DEFAULT_PIPE_4_AUTO_ACKNOWLEDGMENT
#define NRF24L01_BASIC_DEFAULT_PIPE_4_AUTO_ACKNOWLEDGMENT
Definition: driver_nrf24l01_basic.h:62
nrf24l01_basic_init
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
Definition: driver_nrf24l01_basic.c:69
NRF24L01_BASIC_DEFAULT_PIPE_5_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_PIPE_5_DYNAMIC_PAYLOAD
Definition: driver_nrf24l01_basic.h:87
NRF24L01_BASIC_DEFAULT_DYNAMIC_PAYLOAD
#define NRF24L01_BASIC_DEFAULT_DYNAMIC_PAYLOAD
Definition: driver_nrf24l01_basic.h:88
NRF24L01_BASIC_DEFAULT_ADDRESS_WIDTH
#define NRF24L01_BASIC_DEFAULT_ADDRESS_WIDTH
Definition: driver_nrf24l01_basic.h:70
NRF24L01_BASIC_DEFAULT_RETRANSMIT_DELAY
#define NRF24L01_BASIC_DEFAULT_RETRANSMIT_DELAY
Definition: driver_nrf24l01_basic.h:71
NRF24L01_TYPE_TX
@ NRF24L01_TYPE_TX
Definition: driver_nrf24l01_basic.h:103
nrf24l01_interface_spi_read
uint8_t nrf24l01_interface_spi_read(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus read
Definition: driver_nrf24l01_interface_template.c:73
nrf24l01_interface_spi_deinit
uint8_t nrf24l01_interface_spi_deinit(void)
interface spi bus deinit
Definition: driver_nrf24l01_interface_template.c:58
nrf24l01_interface_delay_ms
void nrf24l01_interface_delay_ms(uint32_t ms)
interface delay ms
Definition: driver_nrf24l01_interface_template.c:135
nrf24l01_interface_debug_print
void nrf24l01_interface_debug_print(const char *const fmt,...)
interface print format data
Definition: driver_nrf24l01_interface_template.c:145
nrf24l01_interface_gpio_deinit
uint8_t nrf24l01_interface_gpio_deinit(void)
interface gpio deinit
Definition: driver_nrf24l01_interface_template.c:112
nrf24l01_interface_gpio_init
uint8_t nrf24l01_interface_gpio_init(void)
interface gpio init
Definition: driver_nrf24l01_interface_template.c:100
nrf24l01_interface_spi_init
uint8_t nrf24l01_interface_spi_init(void)
interface spi bus init
Definition: driver_nrf24l01_interface_template.c:46
nrf24l01_interface_spi_write
uint8_t nrf24l01_interface_spi_write(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus write
Definition: driver_nrf24l01_interface_template.c:88
nrf24l01_interface_gpio_write
uint8_t nrf24l01_interface_gpio_write(uint8_t data)
interface gpio write
Definition: driver_nrf24l01_interface_template.c:125
DRIVER_NRF24L01_LINK_DELAY_MS
#define DRIVER_NRF24L01_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
Definition: driver_nrf24l01.h:274
DRIVER_NRF24L01_LINK_SPI_INIT
#define DRIVER_NRF24L01_LINK_SPI_INIT(HANDLE, FUC)
link spi_init function
Definition: driver_nrf24l01.h:218
DRIVER_NRF24L01_LINK_GPIO_WRITE
#define DRIVER_NRF24L01_LINK_GPIO_WRITE(HANDLE, FUC)
link gpio_write function
Definition: driver_nrf24l01.h:266
DRIVER_NRF24L01_LINK_DEBUG_PRINT
#define DRIVER_NRF24L01_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
Definition: driver_nrf24l01.h:282
DRIVER_NRF24L01_LINK_GPIO_INIT
#define DRIVER_NRF24L01_LINK_GPIO_INIT(HANDLE, FUC)
link gpio_init function
Definition: driver_nrf24l01.h:250
DRIVER_NRF24L01_LINK_SPI_READ
#define DRIVER_NRF24L01_LINK_SPI_READ(HANDLE, FUC)
link spi_read function
Definition: driver_nrf24l01.h:234
DRIVER_NRF24L01_LINK_SPI_WRITE
#define DRIVER_NRF24L01_LINK_SPI_WRITE(HANDLE, FUC)
link gpio_write function
Definition: driver_nrf24l01.h:242
DRIVER_NRF24L01_LINK_GPIO_DEINIT
#define DRIVER_NRF24L01_LINK_GPIO_DEINIT(HANDLE, FUC)
link gpio_deinit function
Definition: driver_nrf24l01.h:258
DRIVER_NRF24L01_LINK_INIT
#define DRIVER_NRF24L01_LINK_INIT(HANDLE, STRUCTURE)
initialize nrf24l01_handle_t structure
Definition: driver_nrf24l01.h:210
DRIVER_NRF24L01_LINK_SPI_DEINIT
#define DRIVER_NRF24L01_LINK_SPI_DEINIT(HANDLE, FUC)
link spi_deinit function
Definition: driver_nrf24l01.h:226
DRIVER_NRF24L01_LINK_RECEIVE_CALLBACK
#define DRIVER_NRF24L01_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
link receive_callback function
Definition: driver_nrf24l01.h:290
nrf24l01_handle_s
nrf24l01 handle structure definition
Definition: driver_nrf24l01.h:162