LibDriver NRF24L01
Loading...
Searching...
No Matches
driver_nrf24l01.h
Go to the documentation of this file.
1
36
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
45extern "C"{
46#endif
47
53
58
62typedef enum
63{
67
80
84typedef enum
85{
89
102
113
123
134
145
157
161typedef 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;
176
192
196
203
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
295
302
311uint8_t nrf24l01_info(nrf24l01_info_t *info);
312
324
336uint8_t nrf24l01_init(nrf24l01_handle_t *handle);
337
350uint8_t nrf24l01_deinit(nrf24l01_handle_t *handle);
351
366uint8_t nrf24l01_send(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len);
367
380
394
408
421
434
448
462
476
490
503
516
529uint8_t nrf24l01_set_auto_retransmit_delay(nrf24l01_handle_t *handle, uint8_t delay);
530
542uint8_t nrf24l01_get_auto_retransmit_delay(nrf24l01_handle_t *handle, uint8_t *delay);
543
555uint8_t nrf24l01_auto_retransmit_delay_convert_to_register(nrf24l01_handle_t *handle, uint32_t us, uint8_t *reg);
556
568uint8_t nrf24l01_auto_retransmit_delay_convert_to_data(nrf24l01_handle_t *handle, uint8_t reg, uint32_t *us);
569
582uint8_t nrf24l01_set_auto_retransmit_count(nrf24l01_handle_t *handle, uint8_t count);
583
595uint8_t nrf24l01_get_auto_retransmit_count(nrf24l01_handle_t *handle, uint8_t *count);
596
609uint8_t nrf24l01_set_channel_frequency(nrf24l01_handle_t *handle, uint8_t freq);
610
622uint8_t nrf24l01_get_channel_frequency(nrf24l01_handle_t *handle, uint8_t *freq);
623
636
649
662
675
688
701
714
727
741
754
766uint8_t nrf24l01_get_data_pipe_number(nrf24l01_handle_t *handle, uint8_t *number);
767
779uint8_t nrf24l01_get_lost_packet_count(nrf24l01_handle_t *handle, uint8_t *count);
780
792uint8_t nrf24l01_get_retransmitted_packet_count(nrf24l01_handle_t *handle, uint8_t *count);
793
806
820uint8_t nrf24l01_set_rx_pipe_0_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len);
821
835uint8_t nrf24l01_get_rx_pipe_0_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len);
836
850uint8_t nrf24l01_set_rx_pipe_1_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len);
851
865uint8_t nrf24l01_get_rx_pipe_1_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len);
866
878uint8_t nrf24l01_set_rx_pipe_2_address(nrf24l01_handle_t *handle, uint8_t addr);
879
891uint8_t nrf24l01_get_rx_pipe_2_address(nrf24l01_handle_t *handle, uint8_t *addr);
892
904uint8_t nrf24l01_set_rx_pipe_3_address(nrf24l01_handle_t *handle, uint8_t addr);
905
917uint8_t nrf24l01_get_rx_pipe_3_address(nrf24l01_handle_t *handle, uint8_t *addr);
918
930uint8_t nrf24l01_set_rx_pipe_4_address(nrf24l01_handle_t *handle, uint8_t addr);
931
943uint8_t nrf24l01_get_rx_pipe_4_address(nrf24l01_handle_t *handle, uint8_t *addr);
944
956uint8_t nrf24l01_set_rx_pipe_5_address(nrf24l01_handle_t *handle, uint8_t addr);
957
969uint8_t nrf24l01_get_rx_pipe_5_address(nrf24l01_handle_t *handle, uint8_t *addr);
970
984uint8_t nrf24l01_set_tx_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len);
985
999uint8_t nrf24l01_get_tx_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len);
1000
1013uint8_t nrf24l01_set_pipe_0_payload_number(nrf24l01_handle_t *handle, uint8_t num);
1014
1026uint8_t nrf24l01_get_pipe_0_payload_number(nrf24l01_handle_t *handle, uint8_t *num);
1027
1040uint8_t nrf24l01_set_pipe_1_payload_number(nrf24l01_handle_t *handle, uint8_t num);
1041
1053uint8_t nrf24l01_get_pipe_1_payload_number(nrf24l01_handle_t *handle, uint8_t *num);
1054
1067uint8_t nrf24l01_set_pipe_2_payload_number(nrf24l01_handle_t *handle, uint8_t num);
1068
1080uint8_t nrf24l01_get_pipe_2_payload_number(nrf24l01_handle_t *handle, uint8_t *num);
1081
1094uint8_t nrf24l01_set_pipe_3_payload_number(nrf24l01_handle_t *handle, uint8_t num);
1095
1107uint8_t nrf24l01_get_pipe_3_payload_number(nrf24l01_handle_t *handle, uint8_t *num);
1108
1121uint8_t nrf24l01_set_pipe_4_payload_number(nrf24l01_handle_t *handle, uint8_t num);
1122
1134uint8_t nrf24l01_get_pipe_4_payload_number(nrf24l01_handle_t *handle, uint8_t *num);
1135
1148uint8_t nrf24l01_set_pipe_5_payload_number(nrf24l01_handle_t *handle, uint8_t num);
1149
1161uint8_t nrf24l01_get_pipe_5_payload_number(nrf24l01_handle_t *handle, uint8_t *num);
1162
1174uint8_t nrf24l01_get_fifo_status(nrf24l01_handle_t *handle, uint8_t *status);
1175
1189
1203
1216
1229
1242
1255
1268
1281
1295uint8_t nrf24l01_read_rx_payload(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len);
1296
1310uint8_t nrf24l01_write_tx_payload(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len);
1311
1322uint8_t nrf24l01_flush_tx(nrf24l01_handle_t *handle);
1323
1334uint8_t nrf24l01_flush_rx(nrf24l01_handle_t *handle);
1335
1347
1359uint8_t nrf24l01_get_rx_payload_width(nrf24l01_handle_t *handle, uint8_t *width);
1360
1375uint8_t nrf24l01_write_payload_with_ack(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, uint8_t *buf, uint8_t len);
1376
1390uint8_t nrf24l01_write_payload_with_no_ack(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len);
1391
1402uint8_t nrf24l01_nop(nrf24l01_handle_t *handle);
1403
1407
1414
1428uint8_t nrf24l01_set_reg(nrf24l01_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len);
1429
1443uint8_t nrf24l01_get_reg(nrf24l01_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len);
1444
1448
1452
1453#ifdef __cplusplus
1454}
1455#endif
1456
1457#endif
uint8_t nrf24l01_get_rx_pipe_2_address(nrf24l01_handle_t *handle, uint8_t *addr)
get the rx pipe 2 address
nrf24l01_output_power_t
nrf24l01 output power enumeration definition
uint8_t nrf24l01_get_pipe_4_payload_number(nrf24l01_handle_t *handle, uint8_t *num)
get the pipe 4 payload number
uint8_t nrf24l01_flush_tx(nrf24l01_handle_t *handle)
flush tx
uint8_t nrf24l01_get_auto_retransmit_delay(nrf24l01_handle_t *handle, uint8_t *delay)
get the auto retransmit delay
uint8_t nrf24l01_get_rx_pipe_3_address(nrf24l01_handle_t *handle, uint8_t *addr)
get the rx pipe 3 address
uint8_t nrf24l01_get_fifo_status(nrf24l01_handle_t *handle, uint8_t *status)
get the fifo status
uint8_t nrf24l01_get_pipe_1_payload_number(nrf24l01_handle_t *handle, uint8_t *num)
get the pipe 1 payload number
uint8_t nrf24l01_set_dynamic_payload(nrf24l01_handle_t *handle, nrf24l01_bool_t enable)
enable or disable the dynamic payload
struct nrf24l01_handle_s nrf24l01_handle_t
nrf24l01 handle structure definition
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_write_tx_payload(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len)
write the tx payload
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_get_interrupt(nrf24l01_handle_t *handle, nrf24l01_interrupt_t type, nrf24l01_bool_t *enable)
get the interrupt status
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
nrf24l01_config_t
nrf24l01 config enumeration definition
uint8_t nrf24l01_get_retransmitted_packet_count(nrf24l01_handle_t *handle, uint8_t *count)
get the retransmitted packet count
uint8_t nrf24l01_nop(nrf24l01_handle_t *handle)
nop
uint8_t nrf24l01_get_rx_pipe_1_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len)
get the rx pipe 1 address
uint8_t nrf24l01_set_auto_retransmit_count(nrf24l01_handle_t *handle, uint8_t count)
set the auto retransmit count
uint8_t nrf24l01_get_dynamic_payload(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable)
get the dynamic payload status
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_write_payload_with_no_ack(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len)
write the payload with no 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_get_received_power_detector(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable)
get the received power detector
uint8_t nrf24l01_get_rx_payload_width(nrf24l01_handle_t *handle, uint8_t *width)
get the rx payload width
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_get_payload_with_ack(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable)
get the payload with ack status
uint8_t nrf24l01_get_mode(nrf24l01_handle_t *handle, nrf24l01_mode_t *mode)
get the chip mode
struct nrf24l01_info_s nrf24l01_info_t
nrf24l01 information structure definition
nrf24l01_mode_t
nrf24l01 mode enumeration definition
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
uint8_t nrf24l01_set_channel_frequency(nrf24l01_handle_t *handle, uint8_t freq)
set the channel frequency
uint8_t nrf24l01_get_address_width(nrf24l01_handle_t *handle, nrf24l01_address_width_t *width)
get the address width
uint8_t nrf24l01_get_pipe_0_payload_number(nrf24l01_handle_t *handle, uint8_t *num)
get the pipe 0 payload number
uint8_t nrf24l01_get_auto_retransmit_count(nrf24l01_handle_t *handle, uint8_t *count)
get the auto retransmit count
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_get_pipe_2_payload_number(nrf24l01_handle_t *handle, uint8_t *num)
get the pipe 2 payload number
uint8_t nrf24l01_clear_interrupt(nrf24l01_handle_t *handle, nrf24l01_interrupt_t type)
clear the interrupt status
uint8_t nrf24l01_get_output_power(nrf24l01_handle_t *handle, nrf24l01_output_power_t *power)
get the output power
uint8_t nrf24l01_get_auto_acknowledgment(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t *enable)
get the auto acknowledgment status
uint8_t nrf24l01_get_rx_pipe_0_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len)
get the rx pipe 0 address
uint8_t nrf24l01_get_tx_address(nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len)
get the tx address
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
uint8_t nrf24l01_set_pipe_3_payload_number(nrf24l01_handle_t *handle, uint8_t num)
set the pipe 3 payload number
uint8_t nrf24l01_get_config(nrf24l01_handle_t *handle, nrf24l01_config_t config, nrf24l01_bool_t *enable)
get the configure
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
uint8_t nrf24l01_get_rx_pipe(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t *enable)
get the rx pipe status
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_get_data_pipe_number(nrf24l01_handle_t *handle, uint8_t *number)
get the data pipe number
uint8_t nrf24l01_get_data_rate(nrf24l01_handle_t *handle, nrf24l01_data_rate_t *rate)
get the data rate
uint8_t nrf24l01_read_rx_payload(nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len)
read the rx payload
uint8_t nrf24l01_get_rx_pipe_5_address(nrf24l01_handle_t *handle, uint8_t *addr)
get the rx pipe 5 address
uint8_t nrf24l01_get_channel_frequency(nrf24l01_handle_t *handle, uint8_t *freq)
get the channel frequency
uint8_t nrf24l01_set_rx_pipe_5_address(nrf24l01_handle_t *handle, uint8_t addr)
set the rx pipe 5 address
nrf24l01_interrupt_t
nrf24l01 interrupt enumeration definition
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
nrf24l01_address_width_t
nrf24l01 address width enumeration definition
uint8_t nrf24l01_get_lost_packet_count(nrf24l01_handle_t *handle, uint8_t *count)
get the lost packet count
nrf24l01_fifo_status_t
nrf24l01 fifo status enumeration definition
uint8_t nrf24l01_set_rx_pipe(nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t enable)
enable or disable rx pipe
nrf24l01_pipe_t
nrf24l01 pipe enumeration definition
uint8_t nrf24l01_get_continuous_carrier_transmit(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable)
get the continuous carrier transmit status
uint8_t nrf24l01_info(nrf24l01_info_t *info)
get chip's information
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_get_pipe_3_payload_number(nrf24l01_handle_t *handle, uint8_t *num)
get the pipe 3 payload number
uint8_t nrf24l01_set_rx_pipe_2_address(nrf24l01_handle_t *handle, uint8_t addr)
set the rx pipe 2 address
uint8_t nrf24l01_get_rx_pipe_4_address(nrf24l01_handle_t *handle, uint8_t *addr)
get the rx pipe 4 address
uint8_t nrf24l01_get_force_pll_lock_signal(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable)
get the force pll lock signal status
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_get_pipe_5_payload_number(nrf24l01_handle_t *handle, uint8_t *num)
get the pipe 5 payload number
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
nrf24l01_data_rate_t
nrf24l01 data rate enumeration definition
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_get_tx_payload_with_no_ack(nrf24l01_handle_t *handle, nrf24l01_bool_t *enable)
get the tx payload with no ack status
nrf24l01_bool_t
nrf24l01 bool enumeration definition
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_reuse_tx_payload(nrf24l01_handle_t *handle)
reuse the tx payload
uint8_t nrf24l01_set_rx_pipe_4_address(nrf24l01_handle_t *handle, uint8_t addr)
set the rx pipe 4 address
@ NRF24L01_OUTPUT_POWER_NEGATIVE_6_DBM
@ NRF24L01_OUTPUT_POWER_NEGATIVE_12_DBM
@ NRF24L01_OUTPUT_POWER_0_DBM
@ NRF24L01_OUTPUT_POWER_NEGATIVE_18_DBM
@ 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_ADDRESS_WIDTH_3_BYTES
@ NRF24L01_ADDRESS_WIDTH_ILLEGAL
@ NRF24L01_ADDRESS_WIDTH_4_BYTES
@ NRF24L01_ADDRESS_WIDTH_5_BYTES
@ NRF24L01_FIFO_STATUS_TX_FULL
@ NRF24L01_FIFO_STATUS_TX_REUSE
@ NRF24L01_FIFO_STATUS_TX_EMPTY
@ NRF24L01_FIFO_STATUS_RX_EMPTY
@ NRF24L01_FIFO_STATUS_RX_FULL
@ NRF24L01_PIPE_0
@ NRF24L01_PIPE_4
@ NRF24L01_PIPE_5
@ NRF24L01_PIPE_3
@ NRF24L01_PIPE_1
@ NRF24L01_PIPE_2
@ NRF24L01_DATA_RATE_250K
@ NRF24L01_DATA_RATE_1M
@ NRF24L01_DATA_RATE_2M
@ NRF24L01_BOOL_FALSE
@ NRF24L01_BOOL_TRUE
uint8_t nrf24l01_get_reg(nrf24l01_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
get the chip register
uint8_t nrf24l01_set_reg(nrf24l01_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
set the chip register
nrf24l01 handle structure definition
uint8_t(* gpio_write)(uint8_t value)
uint8_t(* spi_init)(void)
void(* delay_ms)(uint32_t ms)
uint8_t(* spi_read)(uint8_t reg, uint8_t *buf, uint16_t len)
uint8_t(* spi_write)(uint8_t reg, uint8_t *buf, uint16_t len)
void(* debug_print)(const char *const fmt,...)
uint8_t(* spi_deinit)(void)
uint8_t(* gpio_init)(void)
uint8_t(* gpio_deinit)(void)
void(* receive_callback)(uint8_t type, uint8_t num, uint8_t *buf, uint8_t len)
nrf24l01 information structure definition
char manufacturer_name[32]