| LibDriver NRF24L01 1.0.0 NRF24L01 full function driver

driver_nrf24l01.h
Go to the documentation of this file.
1
37 #ifndef DRIVER_NRF24L01_H
38 #define DRIVER_NRF24L01_H
39
40 #include <stdio.h>
41 #include <stdint.h>
42 #include <string.h>
43
44 #ifdef __cplusplus
45 extern "C"{
46 #endif
47
62 typedef enum
63 {
64 NRF24L01_BOOL_FALSE = 0x00,
65 NRF24L01_BOOL_TRUE = 0x01,
66 } nrf24l01_bool_t;
67
71 typedef enum
72 {
73 NRF24L01_CONFIG_MASK_RX_DR = 6,
74 NRF24L01_CONFIG_MASK_TX_DS = 5,
75 NRF24L01_CONFIG_MASK_MAX_RT = 4,
76 NRF24L01_CONFIG_EN_CRC = 3,
77 NRF24L01_CONFIG_CRCO = 2,
78 NRF24L01_CONFIG_PWR_UP = 1,
79 } nrf24l01_config_t;
80
84 typedef enum
85 {
86 NRF24L01_MODE_TX = 0x00,
87 NRF24L01_MODE_RX = 0x01,
88 } nrf24l01_mode_t;
89
93 typedef enum
94 {
95 NRF24L01_PIPE_0 = 0,
96 NRF24L01_PIPE_1 = 1,
97 NRF24L01_PIPE_2 = 2,
98 NRF24L01_PIPE_3 = 3,
99 NRF24L01_PIPE_4 = 4,
100 NRF24L01_PIPE_5 = 5,
101 } nrf24l01_pipe_t;
102
106 typedef enum
107 {
108 NRF24L01_ADDRESS_WIDTH_ILLEGAL = 0,
109 NRF24L01_ADDRESS_WIDTH_3_BYTES = 1,
110 NRF24L01_ADDRESS_WIDTH_4_BYTES = 2,
111 NRF24L01_ADDRESS_WIDTH_5_BYTES = 3,
112 } nrf24l01_address_width_t;
113
117 typedef enum
118 {
119 NRF24L01_DATA_RATE_1M = 0,
120 NRF24L01_DATA_RATE_2M = 1,
121 NRF24L01_DATA_RATE_250K = 2,
122 } nrf24l01_data_rate_t;
123
127 typedef enum
128 {
129 NRF24L01_OUTPUT_POWER_NEGATIVE_18_DBM = 0,
130 NRF24L01_OUTPUT_POWER_NEGATIVE_12_DBM = 1,
131 NRF24L01_OUTPUT_POWER_NEGATIVE_6_DBM = 2,
132 NRF24L01_OUTPUT_POWER_0_DBM = 3,
133 } nrf24l01_output_power_t;
134
138 typedef enum
139 {
140 NRF24L01_INTERRUPT_RX_DR = 6,
141 NRF24L01_INTERRUPT_TX_DS = 5,
142 NRF24L01_INTERRUPT_MAX_RT = 4,
143 NRF24L01_INTERRUPT_TX_FULL = 0,
144 } nrf24l01_interrupt_t;
145
149 typedef enum
150 {
151 NRF24L01_FIFO_STATUS_TX_REUSE = 6,
152 NRF24L01_FIFO_STATUS_TX_FULL = 5,
153 NRF24L01_FIFO_STATUS_TX_EMPTY = 4,
154 NRF24L01_FIFO_STATUS_RX_FULL = 1,
155 NRF24L01_FIFO_STATUS_RX_EMPTY = 0,
156 } nrf24l01_fifo_status_t;
157
161 typedef struct nrf24l01_handle_s
162 {
163 uint8_t (*gpio_init)(void);
164 uint8_t (*gpio_deinit)(void);
165 uint8_t (*gpio_write)(uint8_t value);
166 uint8_t (*spi_init)(void);
167 uint8_t (*spi_deinit)(void);
168 uint8_t (*spi_read)(uint8_t reg, uint8_t *buf, uint16_t len);
169 uint8_t (*spi_write)(uint8_t reg, uint8_t *buf, uint16_t len);
170 void (*delay_ms)(uint32_t ms);
171 void (*debug_print)(const char *const fmt, ...);
172 void (*receive_callback)(uint8_t type, uint8_t num, uint8_t *buf, uint8_t len);
173 uint8_t inited;
174 uint8_t finished;
175 } nrf24l01_handle_t;
176
180 typedef struct nrf24l01_info_s
181 {
182 char chip_name[32];
183 char manufacturer_name[32];
184 char interface[8];
185 float supply_voltage_min_v;
186 float supply_voltage_max_v;
187 float max_current_ma;
188 float temperature_min;
189 float temperature_max;
190 uint32_t driver_version;
191 } nrf24l01_info_t;
192
210 #define DRIVER_NRF24L01_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
211
218 #define DRIVER_NRF24L01_LINK_SPI_INIT(HANDLE, FUC) (HANDLE)->spi_init = FUC
219
226 #define DRIVER_NRF24L01_LINK_SPI_DEINIT(HANDLE, FUC) (HANDLE)->spi_deinit = FUC
227
234 #define DRIVER_NRF24L01_LINK_SPI_READ(HANDLE, FUC) (HANDLE)->spi_read = FUC
235
242 #define DRIVER_NRF24L01_LINK_SPI_WRITE(HANDLE, FUC) (HANDLE)->spi_write = FUC
243
250 #define DRIVER_NRF24L01_LINK_GPIO_INIT(HANDLE, FUC) (HANDLE)->gpio_init = FUC
251
258 #define DRIVER_NRF24L01_LINK_GPIO_DEINIT(HANDLE, FUC) (HANDLE)->gpio_deinit = FUC
259
266 #define DRIVER_NRF24L01_LINK_GPIO_WRITE(HANDLE, FUC) (HANDLE)->gpio_write = FUC
267
274 #define DRIVER_NRF24L01_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
275
282 #define DRIVER_NRF24L01_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
283
290 #define DRIVER_NRF24L01_LINK_RECEIVE_CALLBACK(HANDLE, FUC) (HANDLE)->receive_callback = FUC
291
311 uint8_t nrf24l01_info(nrf24l01_info_t *info);
312
323 uint8_t nrf24l01_irq_handler(nrf24l01_handle_t *handle);
324
336 uint8_t nrf24l01_init(nrf24l01_handle_t *handle);
337
350 uint8_t nrf24l01_deinit(nrf24l01_handle_t *handle);
351
366 uint8_t nrf24l01_send(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len);
367
379 uint8_t nrf24l01_set_active(nrf24l01_handle_t *handle, nrf24l01_bool_t enable);
380
393 uint8_t nrf24l01_set_config(nrf24l01_handle_t *handle, nrf24l01_config_t config, nrf24l01_bool_t enable);
394
407 uint8_t nrf24l01_get_config(nrf24l01_handle_t *handle, nrf24l01_config_t config, nrf24l01_bool_t *enable);
408
420 uint8_t nrf24l01_set_mode(nrf24l01_handle_t *handle, nrf24l01_mode_t mode);
421
433 uint8_t nrf24l01_get_mode(nrf24l01_handle_t *handle, nrf24l01_mode_t *mode);
434
447 uint8_t nrf24l01_set_auto_acknowledgment(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t enable);
448
461 uint8_t nrf24l01_get_auto_acknowledgment(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t *enable);
462
475 uint8_t nrf24l01_set_rx_pipe(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t enable);
476
489 uint8_t nrf24l01_get_rx_pipe(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t *enable);
490
502 uint8_t nrf24l01_set_address_width(nrf24l01_handle_t *handle, nrf24l01_address_width_t width);
503
515 uint8_t nrf24l01_get_address_width(nrf24l01_handle_t *handle, nrf24l01_address_width_t *width);
516
529 uint8_t nrf24l01_set_auto_retransmit_delay(nrf24l01_handle_t *handle, uint8_t delay);
530
542 uint8_t nrf24l01_get_auto_retransmit_delay(nrf24l01_handle_t *handle, uint8_t *delay);
543
555 uint8_t nrf24l01_auto_retransmit_delay_convert_to_register(nrf24l01_handle_t *handle, uint32_t us, uint8_t *reg);
556
568 uint8_t nrf24l01_auto_retransmit_delay_convert_to_data(nrf24l01_handle_t *handle, uint8_t reg, uint32_t *us);
569
582 uint8_t nrf24l01_set_auto_retransmit_count(nrf24l01_handle_t *handle, uint8_t count);
583
595 uint8_t nrf24l01_get_auto_retransmit_count(nrf24l01_handle_t *handle, uint8_t *count);
596
609 uint8_t nrf24l01_set_channel_frequency(nrf24l01_handle_t *handle, uint8_t freq);
610
622 uint8_t nrf24l01_get_channel_frequency(nrf24l01_handle_t *handle, uint8_t *freq);
623
635 uint8_t nrf24l01_set_continuous_carrier_transmit(nrf24l01_handle_t *handle, nrf24l01_bool_t enable);
636
648 uint8_t nrf24l01_get_continuous_carrier_transmit(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable);
649
661 uint8_t nrf24l01_set_force_pll_lock_signal(nrf24l01_handle_t *handle, nrf24l01_bool_t enable);
662
674 uint8_t nrf24l01_get_force_pll_lock_signal(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable);
675
687 uint8_t nrf24l01_set_data_rate(nrf24l01_handle_t *handle, nrf24l01_data_rate_t rate);
688
700 uint8_t nrf24l01_get_data_rate(nrf24l01_handle_t *handle, nrf24l01_data_rate_t *rate);
701
713 uint8_t nrf24l01_set_output_power(nrf24l01_handle_t *handle, nrf24l01_output_power_t power);
714
726 uint8_t nrf24l01_get_output_power(nrf24l01_handle_t *handle, nrf24l01_output_power_t *power);
727
740 uint8_t nrf24l01_get_interrupt(nrf24l01_handle_t *handle, nrf24l01_interrupt_t type, nrf24l01_bool_t *enable);
741
753 uint8_t nrf24l01_clear_interrupt(nrf24l01_handle_t *handle, nrf24l01_interrupt_t type);
754
766 uint8_t nrf24l01_get_data_pipe_number(nrf24l01_handle_t *handle, uint8_t *number);
767
779 uint8_t nrf24l01_get_lost_packet_count(nrf24l01_handle_t *handle, uint8_t *count);
780
792 uint8_t nrf24l01_get_retransmitted_packet_count(nrf24l01_handle_t *handle, uint8_t *count);
793
805 uint8_t nrf24l01_get_received_power_detector(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable);
806
820 uint8_t nrf24l01_set_rx_pipe_0_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len);
821
835 uint8_t nrf24l01_get_rx_pipe_0_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len);
836
850 uint8_t nrf24l01_set_rx_pipe_1_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len);
851
865 uint8_t nrf24l01_get_rx_pipe_1_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len);
866
878 uint8_t nrf24l01_set_rx_pipe_2_address(nrf24l01_handle_t *handle, uint8_t addr);
879
891 uint8_t nrf24l01_get_rx_pipe_2_address(nrf24l01_handle_t *handle, uint8_t *addr);
892
904 uint8_t nrf24l01_set_rx_pipe_3_address(nrf24l01_handle_t *handle, uint8_t addr);
905
917 uint8_t nrf24l01_get_rx_pipe_3_address(nrf24l01_handle_t *handle, uint8_t *addr);
918
930 uint8_t nrf24l01_set_rx_pipe_4_address(nrf24l01_handle_t *handle, uint8_t addr);
931
943 uint8_t nrf24l01_get_rx_pipe_4_address(nrf24l01_handle_t *handle, uint8_t *addr);
944
956 uint8_t nrf24l01_set_rx_pipe_5_address(nrf24l01_handle_t *handle, uint8_t addr);
957
969 uint8_t nrf24l01_get_rx_pipe_5_address(nrf24l01_handle_t *handle, uint8_t *addr);
970
984 uint8_t nrf24l01_set_tx_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len);
985
999 uint8_t nrf24l01_get_tx_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len);
1000
1013 uint8_t nrf24l01_set_pipe_0_payload_number(nrf24l01_handle_t *handle, uint8_t num);
1014
1026 uint8_t nrf24l01_get_pipe_0_payload_number(nrf24l01_handle_t *handle, uint8_t *num);
1027
1040 uint8_t nrf24l01_set_pipe_1_payload_number(nrf24l01_handle_t *handle, uint8_t num);
1041
1053 uint8_t nrf24l01_get_pipe_1_payload_number(nrf24l01_handle_t *handle, uint8_t *num);
1054
1067 uint8_t nrf24l01_set_pipe_2_payload_number(nrf24l01_handle_t *handle, uint8_t num);
1068
1080 uint8_t nrf24l01_get_pipe_2_payload_number(nrf24l01_handle_t *handle, uint8_t *num);
1081
1094 uint8_t nrf24l01_set_pipe_3_payload_number(nrf24l01_handle_t *handle, uint8_t num);
1095
1107 uint8_t nrf24l01_get_pipe_3_payload_number(nrf24l01_handle_t *handle, uint8_t *num);
1108
1121 uint8_t nrf24l01_set_pipe_4_payload_number(nrf24l01_handle_t *handle, uint8_t num);
1122
1134 uint8_t nrf24l01_get_pipe_4_payload_number(nrf24l01_handle_t *handle, uint8_t *num);
1135
1148 uint8_t nrf24l01_set_pipe_5_payload_number(nrf24l01_handle_t *handle, uint8_t num);
1149
1161 uint8_t nrf24l01_get_pipe_5_payload_number(nrf24l01_handle_t *handle, uint8_t *num);
1162
1174 uint8_t nrf24l01_get_fifo_status(nrf24l01_handle_t *handle, uint8_t *status);
1175
1188 uint8_t nrf24l01_set_pipe_dynamic_payload(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t enable);
1189
1202 uint8_t nrf24l01_get_pipe_dynamic_payload(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t *enable);
1203
1215 uint8_t nrf24l01_set_dynamic_payload(nrf24l01_handle_t *handle, nrf24l01_bool_t enable);
1216
1228 uint8_t nrf24l01_get_dynamic_payload(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable);
1229
1241 uint8_t nrf24l01_set_payload_with_ack(nrf24l01_handle_t *handle, nrf24l01_bool_t enable);
1242
1254 uint8_t nrf24l01_get_payload_with_ack(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable);
1255
1267 uint8_t nrf24l01_set_tx_payload_with_no_ack(nrf24l01_handle_t *handle, nrf24l01_bool_t enable);
1268
1280 uint8_t nrf24l01_get_tx_payload_with_no_ack(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable);
1281
1295 uint8_t nrf24l01_read_rx_payload(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len);
1296
1310 uint8_t nrf24l01_write_tx_payload(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len);
1311
1322 uint8_t nrf24l01_flush_tx(nrf24l01_handle_t *handle);
1323
1334 uint8_t nrf24l01_flush_rx(nrf24l01_handle_t *handle);
1335
1346 uint8_t nrf24l01_reuse_tx_payload(nrf24l01_handle_t *handle);
1347
1359 uint8_t nrf24l01_get_rx_payload_width(nrf24l01_handle_t *handle, uint8_t *width);
1360
1375 uint8_t nrf24l01_write_payload_with_ack(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, uint8_t *buf, uint8_t len);
1376
1390 uint8_t nrf24l01_write_payload_with_no_ack(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len);
1391
1402 uint8_t nrf24l01_nop(nrf24l01_handle_t *handle);
1403
1428 uint8_t nrf24l01_set_reg(nrf24l01_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len);
1429
1443 uint8_t nrf24l01_get_reg(nrf24l01_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len);
1444
1453 #ifdef __cplusplus
1454 }
1455 #endif
1456
1457 #endif
nrf24l01_get_rx_pipe_2_address
uint8_t nrf24l01_get_rx_pipe_2_address(nrf24l01_handle_t *handle, uint8_t *addr)
get the rx pipe 2 address
Definition: driver_nrf24l01.c:2211
nrf24l01_output_power_t
nrf24l01_output_power_t
nrf24l01 output power enumeration definition
Definition: driver_nrf24l01.h:128
nrf24l01_get_pipe_4_payload_number
uint8_t nrf24l01_get_pipe_4_payload_number(nrf24l01_handle_t *handle, uint8_t *num)
get the pipe 4 payload number
Definition: driver_nrf24l01.c:2961
nrf24l01_flush_tx
uint8_t nrf24l01_flush_tx(nrf24l01_handle_t *handle)
flush tx
Definition: driver_nrf24l01.c:3550
nrf24l01_get_auto_retransmit_delay
uint8_t nrf24l01_get_auto_retransmit_delay(nrf24l01_handle_t *handle, uint8_t *delay)
get the auto retransmit delay
Definition: driver_nrf24l01.c:1044
nrf24l01_get_rx_pipe_3_address
uint8_t nrf24l01_get_rx_pipe_3_address(nrf24l01_handle_t *handle, uint8_t *addr)
get the rx pipe 3 address
Definition: driver_nrf24l01.c:2281
nrf24l01_get_fifo_status
uint8_t nrf24l01_get_fifo_status(nrf24l01_handle_t *handle, uint8_t *status)
get the fifo status
Definition: driver_nrf24l01.c:3075
nrf24l01_get_pipe_1_payload_number
uint8_t nrf24l01_get_pipe_1_payload_number(nrf24l01_handle_t *handle, uint8_t *num)
get the pipe 1 payload number
Definition: driver_nrf24l01.c:2727
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_handle_t
struct nrf24l01_handle_s nrf24l01_handle_t
nrf24l01 handle structure definition
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_write_tx_payload
uint8_t nrf24l01_write_tx_payload(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len)
write the tx payload
Definition: driver_nrf24l01.c:3495
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_get_interrupt
uint8_t nrf24l01_get_interrupt(nrf24l01_handle_t *handle, nrf24l01_interrupt_t type, nrf24l01_bool_t *enable)
get the interrupt status
Definition: driver_nrf24l01.c:1644
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_config_t
nrf24l01_config_t
nrf24l01 config enumeration definition
Definition: driver_nrf24l01.h:72
nrf24l01_get_retransmitted_packet_count
uint8_t nrf24l01_get_retransmitted_packet_count(nrf24l01_handle_t *handle, uint8_t *count)
get the retransmitted packet count
Definition: driver_nrf24l01.c:1800
nrf24l01_nop
uint8_t nrf24l01_nop(nrf24l01_handle_t *handle)
nop
Definition: driver_nrf24l01.c:3806
nrf24l01_get_rx_pipe_1_address
uint8_t nrf24l01_get_rx_pipe_1_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len)
get the rx pipe 1 address
Definition: driver_nrf24l01.c:2103
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_get_dynamic_payload
uint8_t nrf24l01_get_dynamic_payload(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable)
get the dynamic payload status
Definition: driver_nrf24l01.c:3239
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_write_payload_with_no_ack
uint8_t nrf24l01_write_payload_with_no_ack(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len)
write the payload with no ack
Definition: driver_nrf24l01.c:3750
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_get_received_power_detector
uint8_t nrf24l01_get_received_power_detector(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable)
get the received power detector
Definition: driver_nrf24l01.c:1837
nrf24l01_get_rx_payload_width
uint8_t nrf24l01_get_rx_payload_width(nrf24l01_handle_t *handle, uint8_t *width)
get the rx payload width
Definition: driver_nrf24l01.c:3653
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_get_payload_with_ack
uint8_t nrf24l01_get_payload_with_ack(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable)
get the payload with ack status
Definition: driver_nrf24l01.c:3321
nrf24l01_get_mode
uint8_t nrf24l01_get_mode(nrf24l01_handle_t *handle, nrf24l01_mode_t *mode)
get the chip mode
Definition: driver_nrf24l01.c:705
nrf24l01_info_t
struct nrf24l01_info_s nrf24l01_info_t
nrf24l01 information structure definition
nrf24l01_mode_t
nrf24l01_mode_t
nrf24l01 mode enumeration definition
Definition: driver_nrf24l01.h:85
nrf24l01_auto_retransmit_delay_convert_to_data
uint8_t nrf24l01_auto_retransmit_delay_convert_to_data(nrf24l01_handle_t *handle, uint8_t reg, uint32_t *us)
convert the register raw data to the delay
Definition: driver_nrf24l01.c:1108
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_get_address_width
uint8_t nrf24l01_get_address_width(nrf24l01_handle_t *handle, nrf24l01_address_width_t *width)
get the address width
Definition: driver_nrf24l01.c:955
nrf24l01_get_pipe_0_payload_number
uint8_t nrf24l01_get_pipe_0_payload_number(nrf24l01_handle_t *handle, uint8_t *num)
get the pipe 0 payload number
Definition: driver_nrf24l01.c:2649
nrf24l01_get_auto_retransmit_count
uint8_t nrf24l01_get_auto_retransmit_count(nrf24l01_handle_t *handle, uint8_t *count)
get the auto retransmit count
Definition: driver_nrf24l01.c:1187
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_get_pipe_2_payload_number
uint8_t nrf24l01_get_pipe_2_payload_number(nrf24l01_handle_t *handle, uint8_t *num)
get the pipe 2 payload number
Definition: driver_nrf24l01.c:2805
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_get_output_power
uint8_t nrf24l01_get_output_power(nrf24l01_handle_t *handle, nrf24l01_output_power_t *power)
get the output power
Definition: driver_nrf24l01.c:1606
nrf24l01_get_auto_acknowledgment
uint8_t nrf24l01_get_auto_acknowledgment(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t *enable)
get the auto acknowledgment status
Definition: driver_nrf24l01.c:789
nrf24l01_get_rx_pipe_0_address
uint8_t nrf24l01_get_rx_pipe_0_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len)
get the rx pipe 0 address
Definition: driver_nrf24l01.c:1952
nrf24l01_get_tx_address
uint8_t nrf24l01_get_tx_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len)
get the tx address
Definition: driver_nrf24l01.c:2534
nrf24l01_get_pipe_dynamic_payload
uint8_t nrf24l01_get_pipe_dynamic_payload(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t *enable)
get the pipe dynamic payload status
Definition: driver_nrf24l01.c:3157
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_get_config
uint8_t nrf24l01_get_config(nrf24l01_handle_t *handle, nrf24l01_config_t config, nrf24l01_bool_t *enable)
get the configure
Definition: driver_nrf24l01.c:623
nrf24l01_write_payload_with_ack
uint8_t nrf24l01_write_payload_with_ack(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, uint8_t *buf, uint8_t len)
write the payload with ack
Definition: driver_nrf24l01.c:3691
nrf24l01_get_rx_pipe
uint8_t nrf24l01_get_rx_pipe(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t *enable)
get the rx pipe status
Definition: driver_nrf24l01.c:873
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_get_data_pipe_number
uint8_t nrf24l01_get_data_pipe_number(nrf24l01_handle_t *handle, uint8_t *number)
get the data pipe number
Definition: driver_nrf24l01.c:1726
nrf24l01_get_data_rate
uint8_t nrf24l01_get_data_rate(nrf24l01_handle_t *handle, nrf24l01_data_rate_t *rate)
get the data rate
Definition: driver_nrf24l01.c:1524
nrf24l01_read_rx_payload
uint8_t nrf24l01_read_rx_payload(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len)
read the rx payload
Definition: driver_nrf24l01.c:3442
nrf24l01_get_rx_pipe_5_address
uint8_t nrf24l01_get_rx_pipe_5_address(nrf24l01_handle_t *handle, uint8_t *addr)
get the rx pipe 5 address
Definition: driver_nrf24l01.c:2421
nrf24l01_get_channel_frequency
uint8_t nrf24l01_get_channel_frequency(nrf24l01_handle_t *handle, uint8_t *freq)
get the channel frequency
Definition: driver_nrf24l01.c:1276
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_interrupt_t
nrf24l01_interrupt_t
nrf24l01 interrupt enumeration definition
Definition: driver_nrf24l01.h:139
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_address_width_t
nrf24l01_address_width_t
nrf24l01 address width enumeration definition
Definition: driver_nrf24l01.h:107
nrf24l01_get_lost_packet_count
uint8_t nrf24l01_get_lost_packet_count(nrf24l01_handle_t *handle, uint8_t *count)
get the lost packet count
Definition: driver_nrf24l01.c:1763
nrf24l01_fifo_status_t
nrf24l01_fifo_status_t
nrf24l01 fifo status enumeration definition
Definition: driver_nrf24l01.h:150
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_pipe_t
nrf24l01_pipe_t
nrf24l01 pipe enumeration definition
Definition: driver_nrf24l01.h:94
nrf24l01_get_continuous_carrier_transmit
uint8_t nrf24l01_get_continuous_carrier_transmit(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable)
get the continuous carrier transmit status
Definition: driver_nrf24l01.c:1358
nrf24l01_info
uint8_t nrf24l01_info(nrf24l01_info_t *info)
get chip's information
Definition: driver_nrf24l01.c:3892
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_get_pipe_3_payload_number
uint8_t nrf24l01_get_pipe_3_payload_number(nrf24l01_handle_t *handle, uint8_t *num)
get the pipe 3 payload number
Definition: driver_nrf24l01.c:2883
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_get_rx_pipe_4_address
uint8_t nrf24l01_get_rx_pipe_4_address(nrf24l01_handle_t *handle, uint8_t *addr)
get the rx pipe 4 address
Definition: driver_nrf24l01.c:2351
nrf24l01_get_force_pll_lock_signal
uint8_t nrf24l01_get_force_pll_lock_signal(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable)
get the force pll lock signal status
Definition: driver_nrf24l01.c:1440
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_get_pipe_5_payload_number
uint8_t nrf24l01_get_pipe_5_payload_number(nrf24l01_handle_t *handle, uint8_t *num)
get the pipe 5 payload number
Definition: driver_nrf24l01.c:3039
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_data_rate_t
nrf24l01_data_rate_t
nrf24l01 data rate enumeration definition
Definition: driver_nrf24l01.h:118
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_get_tx_payload_with_no_ack
uint8_t nrf24l01_get_tx_payload_with_no_ack(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable)
get the tx payload with no ack status
Definition: driver_nrf24l01.c:3403
nrf24l01_bool_t
nrf24l01_bool_t
nrf24l01 bool enumeration definition
Definition: driver_nrf24l01.h:63
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_reuse_tx_payload
uint8_t nrf24l01_reuse_tx_payload(nrf24l01_handle_t *handle)
reuse the tx payload
Definition: driver_nrf24l01.c:3618
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_OUTPUT_POWER_NEGATIVE_6_DBM
@ NRF24L01_OUTPUT_POWER_NEGATIVE_6_DBM
Definition: driver_nrf24l01.h:131
NRF24L01_OUTPUT_POWER_NEGATIVE_12_DBM
@ NRF24L01_OUTPUT_POWER_NEGATIVE_12_DBM
Definition: driver_nrf24l01.h:130
NRF24L01_OUTPUT_POWER_0_DBM
@ NRF24L01_OUTPUT_POWER_0_DBM
Definition: driver_nrf24l01.h:132
NRF24L01_OUTPUT_POWER_NEGATIVE_18_DBM
@ NRF24L01_OUTPUT_POWER_NEGATIVE_18_DBM
Definition: driver_nrf24l01.h:129
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_ADDRESS_WIDTH_3_BYTES
@ NRF24L01_ADDRESS_WIDTH_3_BYTES
Definition: driver_nrf24l01.h:109
NRF24L01_ADDRESS_WIDTH_ILLEGAL
@ NRF24L01_ADDRESS_WIDTH_ILLEGAL
Definition: driver_nrf24l01.h:108
NRF24L01_ADDRESS_WIDTH_4_BYTES
@ NRF24L01_ADDRESS_WIDTH_4_BYTES
Definition: driver_nrf24l01.h:110
NRF24L01_ADDRESS_WIDTH_5_BYTES
@ NRF24L01_ADDRESS_WIDTH_5_BYTES
Definition: driver_nrf24l01.h:111
NRF24L01_FIFO_STATUS_TX_FULL
@ NRF24L01_FIFO_STATUS_TX_FULL
Definition: driver_nrf24l01.h:152
NRF24L01_FIFO_STATUS_TX_REUSE
@ NRF24L01_FIFO_STATUS_TX_REUSE
Definition: driver_nrf24l01.h:151
NRF24L01_FIFO_STATUS_TX_EMPTY
@ NRF24L01_FIFO_STATUS_TX_EMPTY
Definition: driver_nrf24l01.h:153
NRF24L01_FIFO_STATUS_RX_EMPTY
@ NRF24L01_FIFO_STATUS_RX_EMPTY
Definition: driver_nrf24l01.h:155
NRF24L01_FIFO_STATUS_RX_FULL
@ NRF24L01_FIFO_STATUS_RX_FULL
Definition: driver_nrf24l01.h:154
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_DATA_RATE_250K
@ NRF24L01_DATA_RATE_250K
Definition: driver_nrf24l01.h:121
NRF24L01_DATA_RATE_1M
@ NRF24L01_DATA_RATE_1M
Definition: driver_nrf24l01.h:119
NRF24L01_DATA_RATE_2M
@ NRF24L01_DATA_RATE_2M
Definition: driver_nrf24l01.h:120
NRF24L01_BOOL_FALSE
@ NRF24L01_BOOL_FALSE
Definition: driver_nrf24l01.h:64
NRF24L01_BOOL_TRUE
@ NRF24L01_BOOL_TRUE
Definition: driver_nrf24l01.h:65
nrf24l01_get_reg
uint8_t nrf24l01_get_reg(nrf24l01_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
get the chip register
Definition: driver_nrf24l01.c:3870
nrf24l01_set_reg
uint8_t nrf24l01_set_reg(nrf24l01_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
set the chip register
Definition: driver_nrf24l01.c:3843
nrf24l01_handle_s
nrf24l01 handle structure definition
Definition: driver_nrf24l01.h:162
nrf24l01_handle_s::inited
uint8_t inited
Definition: driver_nrf24l01.h:173
nrf24l01_handle_s::gpio_write
uint8_t(* gpio_write)(uint8_t value)
Definition: driver_nrf24l01.h:165
nrf24l01_handle_s::spi_init
uint8_t(* spi_init)(void)
Definition: driver_nrf24l01.h:166
nrf24l01_handle_s::delay_ms
void(* delay_ms)(uint32_t ms)
Definition: driver_nrf24l01.h:170
nrf24l01_handle_s::spi_read
uint8_t(* spi_read)(uint8_t reg, uint8_t *buf, uint16_t len)
Definition: driver_nrf24l01.h:168
nrf24l01_handle_s::spi_write
uint8_t(* spi_write)(uint8_t reg, uint8_t *buf, uint16_t len)
Definition: driver_nrf24l01.h:169
nrf24l01_handle_s::debug_print
void(* debug_print)(const char *const fmt,...)
Definition: driver_nrf24l01.h:171
nrf24l01_handle_s::finished
uint8_t finished
Definition: driver_nrf24l01.h:174
nrf24l01_handle_s::spi_deinit
uint8_t(* spi_deinit)(void)
Definition: driver_nrf24l01.h:167
nrf24l01_handle_s::gpio_init
uint8_t(* gpio_init)(void)
Definition: driver_nrf24l01.h:163
nrf24l01_handle_s::gpio_deinit
uint8_t(* gpio_deinit)(void)
Definition: driver_nrf24l01.h:164
nrf24l01_handle_s::receive_callback
void(* receive_callback)(uint8_t type, uint8_t num, uint8_t *buf, uint8_t len)
Definition: driver_nrf24l01.h:172
nrf24l01_info_s
nrf24l01 information structure definition
Definition: driver_nrf24l01.h:181
nrf24l01_info_s::temperature_max
float temperature_max
Definition: driver_nrf24l01.h:189
nrf24l01_info_s::supply_voltage_max_v
float supply_voltage_max_v
Definition: driver_nrf24l01.h:186
nrf24l01_info_s::driver_version
uint32_t driver_version
Definition: driver_nrf24l01.h:190
nrf24l01_info_s::temperature_min
float temperature_min
Definition: driver_nrf24l01.h:188
nrf24l01_info_s::max_current_ma
float max_current_ma
Definition: driver_nrf24l01.h:187
nrf24l01_info_s::manufacturer_name
char manufacturer_name[32]
Definition: driver_nrf24l01.h:183
nrf24l01_info_s::supply_voltage_min_v
float supply_voltage_min_v
Definition: driver_nrf24l01.h:185
nrf24l01_info_s::interface
char interface[8]
Definition: driver_nrf24l01.h:184
nrf24l01_info_s::chip_name
char chip_name[32]
Definition: driver_nrf24l01.h:182