![]() |
LibDriver NRF24L01
1.0.0
NRF24L01 full-featured driver
|
driver nrf24l01 source file More...
#include "driver_nrf24l01.h"
Go to the source code of this file.
Functions | |
uint8_t | nrf24l01_init (nrf24l01_handle_t *handle) |
initialize the chip More... | |
uint8_t | nrf24l01_deinit (nrf24l01_handle_t *handle) |
close the chip More... | |
uint8_t | nrf24l01_set_active (nrf24l01_handle_t *handle, nrf24l01_bool_t enable) |
enable or disable the chip More... | |
uint8_t | nrf24l01_send (nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len) |
send data More... | |
uint8_t | nrf24l01_irq_handler (nrf24l01_handle_t *handle) |
irq handler More... | |
uint8_t | nrf24l01_set_config (nrf24l01_handle_t *handle, nrf24l01_config_t config, nrf24l01_bool_t enable) |
enable or disable configure More... | |
uint8_t | nrf24l01_get_config (nrf24l01_handle_t *handle, nrf24l01_config_t config, nrf24l01_bool_t *enable) |
get the configure More... | |
uint8_t | nrf24l01_set_mode (nrf24l01_handle_t *handle, nrf24l01_mode_t mode) |
set the chip mode More... | |
uint8_t | nrf24l01_get_mode (nrf24l01_handle_t *handle, nrf24l01_mode_t *mode) |
get the chip mode More... | |
uint8_t | nrf24l01_set_auto_acknowledgment (nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t enable) |
enable or disable auto acknowledgment More... | |
uint8_t | nrf24l01_get_auto_acknowledgment (nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t *enable) |
get the auto acknowledgment status More... | |
uint8_t | nrf24l01_set_rx_pipe (nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t enable) |
enable or disable rx pipe More... | |
uint8_t | nrf24l01_get_rx_pipe (nrf24l01_handle_t *handle, nrf24l01_pipe_t pipe, nrf24l01_bool_t *enable) |
get the rx pipe status More... | |
uint8_t | nrf24l01_set_address_width (nrf24l01_handle_t *handle, nrf24l01_address_width_t width) |
set the address width More... | |
uint8_t | nrf24l01_get_address_width (nrf24l01_handle_t *handle, nrf24l01_address_width_t *width) |
get the address width More... | |
uint8_t | nrf24l01_set_auto_retransmit_delay (nrf24l01_handle_t *handle, uint8_t delay) |
set the auto retransmit delay More... | |
uint8_t | nrf24l01_get_auto_retransmit_delay (nrf24l01_handle_t *handle, uint8_t *delay) |
get the auto retransmit delay More... | |
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 More... | |
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 More... | |
uint8_t | nrf24l01_set_auto_retransmit_count (nrf24l01_handle_t *handle, uint8_t count) |
set the auto retransmit count More... | |
uint8_t | nrf24l01_get_auto_retransmit_count (nrf24l01_handle_t *handle, uint8_t *count) |
get the auto retransmit count More... | |
uint8_t | nrf24l01_set_channel_frequency (nrf24l01_handle_t *handle, uint8_t freq) |
set the channel frequency More... | |
uint8_t | nrf24l01_get_channel_frequency (nrf24l01_handle_t *handle, uint8_t *freq) |
get the channel frequency More... | |
uint8_t | nrf24l01_set_continuous_carrier_transmit (nrf24l01_handle_t *handle, nrf24l01_bool_t enable) |
enable or disable continuous carrier transmit More... | |
uint8_t | nrf24l01_get_continuous_carrier_transmit (nrf24l01_handle_t *handle, nrf24l01_bool_t *enable) |
get the continuous carrier transmit status More... | |
uint8_t | nrf24l01_set_force_pll_lock_signal (nrf24l01_handle_t *handle, nrf24l01_bool_t enable) |
enable or disable force pll lock signal More... | |
uint8_t | nrf24l01_get_force_pll_lock_signal (nrf24l01_handle_t *handle, nrf24l01_bool_t *enable) |
get the force pll lock signal status More... | |
uint8_t | nrf24l01_set_data_rate (nrf24l01_handle_t *handle, nrf24l01_data_rate_t rate) |
set the data rate More... | |
uint8_t | nrf24l01_get_data_rate (nrf24l01_handle_t *handle, nrf24l01_data_rate_t *rate) |
get the data rate More... | |
uint8_t | nrf24l01_set_output_power (nrf24l01_handle_t *handle, nrf24l01_output_power_t power) |
set the output power More... | |
uint8_t | nrf24l01_get_output_power (nrf24l01_handle_t *handle, nrf24l01_output_power_t *power) |
get the output power More... | |
uint8_t | nrf24l01_get_interrupt (nrf24l01_handle_t *handle, nrf24l01_interrupt_t type, nrf24l01_bool_t *enable) |
get the interrupt status More... | |
uint8_t | nrf24l01_clear_interrupt (nrf24l01_handle_t *handle, nrf24l01_interrupt_t type) |
clear the interrupt status More... | |
uint8_t | nrf24l01_get_data_pipe_number (nrf24l01_handle_t *handle, uint8_t *number) |
get the data pipe number More... | |
uint8_t | nrf24l01_get_lost_packet_count (nrf24l01_handle_t *handle, uint8_t *count) |
get the lost packet count More... | |
uint8_t | nrf24l01_get_retransmitted_packet_count (nrf24l01_handle_t *handle, uint8_t *count) |
get the retransmitted packet count More... | |
uint8_t | nrf24l01_get_received_power_detector (nrf24l01_handle_t *handle, nrf24l01_bool_t *enable) |
get the received power detector More... | |
uint8_t | nrf24l01_set_rx_pipe_0_address (nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len) |
set the rx pipe 0 address More... | |
uint8_t | nrf24l01_get_rx_pipe_0_address (nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len) |
get the rx pipe 0 address More... | |
uint8_t | nrf24l01_set_rx_pipe_1_address (nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len) |
set the rx pipe 1 address More... | |
uint8_t | nrf24l01_get_rx_pipe_1_address (nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len) |
get the rx pipe 1 address More... | |
uint8_t | nrf24l01_set_rx_pipe_2_address (nrf24l01_handle_t *handle, uint8_t addr) |
set the rx pipe 2 address More... | |
uint8_t | nrf24l01_get_rx_pipe_2_address (nrf24l01_handle_t *handle, uint8_t *addr) |
get the rx pipe 2 address More... | |
uint8_t | nrf24l01_set_rx_pipe_3_address (nrf24l01_handle_t *handle, uint8_t addr) |
set the rx pipe 3 address More... | |
uint8_t | nrf24l01_get_rx_pipe_3_address (nrf24l01_handle_t *handle, uint8_t *addr) |
get the rx pipe 3 address More... | |
uint8_t | nrf24l01_set_rx_pipe_4_address (nrf24l01_handle_t *handle, uint8_t addr) |
set the rx pipe 4 address More... | |
uint8_t | nrf24l01_get_rx_pipe_4_address (nrf24l01_handle_t *handle, uint8_t *addr) |
get the rx pipe 4 address More... | |
uint8_t | nrf24l01_set_rx_pipe_5_address (nrf24l01_handle_t *handle, uint8_t addr) |
set the rx pipe 5 address More... | |
uint8_t | nrf24l01_get_rx_pipe_5_address (nrf24l01_handle_t *handle, uint8_t *addr) |
get the rx pipe 5 address More... | |
uint8_t | nrf24l01_set_tx_address (nrf24l01_handle_t *handle, uint8_t *addr, uint8_t len) |
set the tx address More... | |
uint8_t | nrf24l01_get_tx_address (nrf24l01_handle_t *handle, uint8_t *addr, uint8_t *len) |
get the tx address More... | |
uint8_t | nrf24l01_set_pipe_0_payload_number (nrf24l01_handle_t *handle, uint8_t num) |
set the pipe 0 payload number More... | |
uint8_t | nrf24l01_get_pipe_0_payload_number (nrf24l01_handle_t *handle, uint8_t *num) |
get the pipe 0 payload number More... | |
uint8_t | nrf24l01_set_pipe_1_payload_number (nrf24l01_handle_t *handle, uint8_t num) |
set the pipe 1 payload number More... | |
uint8_t | nrf24l01_get_pipe_1_payload_number (nrf24l01_handle_t *handle, uint8_t *num) |
get the pipe 1 payload number More... | |
uint8_t | nrf24l01_set_pipe_2_payload_number (nrf24l01_handle_t *handle, uint8_t num) |
set the pipe 2 payload number More... | |
uint8_t | nrf24l01_get_pipe_2_payload_number (nrf24l01_handle_t *handle, uint8_t *num) |
get the pipe 2 payload number More... | |
uint8_t | nrf24l01_set_pipe_3_payload_number (nrf24l01_handle_t *handle, uint8_t num) |
set the pipe 3 payload number More... | |
uint8_t | nrf24l01_get_pipe_3_payload_number (nrf24l01_handle_t *handle, uint8_t *num) |
get the pipe 3 payload number More... | |
uint8_t | nrf24l01_set_pipe_4_payload_number (nrf24l01_handle_t *handle, uint8_t num) |
set the pipe 4 payload number More... | |
uint8_t | nrf24l01_get_pipe_4_payload_number (nrf24l01_handle_t *handle, uint8_t *num) |
get the pipe 4 payload number More... | |
uint8_t | nrf24l01_set_pipe_5_payload_number (nrf24l01_handle_t *handle, uint8_t num) |
set the pipe 5 payload number More... | |
uint8_t | nrf24l01_get_pipe_5_payload_number (nrf24l01_handle_t *handle, uint8_t *num) |
get the pipe 5 payload number More... | |
uint8_t | nrf24l01_get_fifo_status (nrf24l01_handle_t *handle, uint8_t *status) |
get the fifo status More... | |
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 More... | |
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 More... | |
uint8_t | nrf24l01_set_dynamic_payload (nrf24l01_handle_t *handle, nrf24l01_bool_t enable) |
enable or disable the dynamic payload More... | |
uint8_t | nrf24l01_get_dynamic_payload (nrf24l01_handle_t *handle, nrf24l01_bool_t *enable) |
get the dynamic payload status More... | |
uint8_t | nrf24l01_set_payload_with_ack (nrf24l01_handle_t *handle, nrf24l01_bool_t enable) |
enable or disable the payload with ack More... | |
uint8_t | nrf24l01_get_payload_with_ack (nrf24l01_handle_t *handle, nrf24l01_bool_t *enable) |
get the payload with ack status More... | |
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 More... | |
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 More... | |
uint8_t | nrf24l01_read_rx_payload (nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len) |
read the rx payload More... | |
uint8_t | nrf24l01_write_tx_payload (nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len) |
write the tx payload More... | |
uint8_t | nrf24l01_flush_tx (nrf24l01_handle_t *handle) |
flush tx More... | |
uint8_t | nrf24l01_flush_rx (nrf24l01_handle_t *handle) |
flush rx More... | |
uint8_t | nrf24l01_reuse_tx_payload (nrf24l01_handle_t *handle) |
reuse the tx payload More... | |
uint8_t | nrf24l01_get_rx_payload_width (nrf24l01_handle_t *handle, uint8_t *width) |
get the rx payload width More... | |
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 More... | |
uint8_t | nrf24l01_write_payload_with_no_ack (nrf24l01_handle_t *handle, uint8_t *buf, uint8_t len) |
write the payload with no ack More... | |
uint8_t | nrf24l01_nop (nrf24l01_handle_t *handle) |
nop More... | |
uint8_t | nrf24l01_set_reg (nrf24l01_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
set the chip register More... | |
uint8_t | nrf24l01_get_reg (nrf24l01_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
get the chip register More... | |
uint8_t | nrf24l01_info (nrf24l01_info_t *info) |
get chip's information More... | |
driver nrf24l01 source file
Copyright (c) 2015 - present LibDriver All rights reserved
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Date | Version | Author | Description |
---|---|---|---|
2021/11/28 | 1.0 | Shifeng Li | first upload |
Definition in file driver_nrf24l01.c.
#define CHIP_NAME "Nordic nRF24L01" |
#define DRIVER_VERSION 1000 |
driver version
Definition at line 49 of file driver_nrf24l01.c.
#define MANUFACTURER_NAME "Nordic" |
manufacturer name
Definition at line 43 of file driver_nrf24l01.c.
#define MAX_CURRENT 13.50f |
chip max current
Definition at line 46 of file driver_nrf24l01.c.
#define NRF24L01_COMMAND_FLUSH_RX 0xE2 |
flush rx command
Definition at line 59 of file driver_nrf24l01.c.
#define NRF24L01_COMMAND_FLUSH_TX 0xE1 |
flush tx command
Definition at line 58 of file driver_nrf24l01.c.
#define NRF24L01_COMMAND_NOP 0xFF |
nop command
Definition at line 64 of file driver_nrf24l01.c.
#define NRF24L01_COMMAND_R_REGISTER 0x00 |
#define NRF24L01_COMMAND_R_RX_PAYLOAD 0x61 |
read payload command
Definition at line 56 of file driver_nrf24l01.c.
#define NRF24L01_COMMAND_R_RX_PL_WID 0x60 |
read rx payload width for the top command
Definition at line 61 of file driver_nrf24l01.c.
#define NRF24L01_COMMAND_REUSE_TX_PL 0xE3 |
reuse tx payload command
Definition at line 60 of file driver_nrf24l01.c.
#define NRF24L01_COMMAND_W_ACK_PAYLOAD 0xA8 |
write ack payload command
Definition at line 62 of file driver_nrf24l01.c.
#define NRF24L01_COMMAND_W_REGISTER 0x20 |
write command
Definition at line 55 of file driver_nrf24l01.c.
#define NRF24L01_COMMAND_W_TX_PAYLOAD 0xA0 |
write payload command
Definition at line 57 of file driver_nrf24l01.c.
#define NRF24L01_COMMAND_W_TX_PAYLOAD_NO_ACK 0xB0 |
write ack payload with ack command
Definition at line 63 of file driver_nrf24l01.c.
#define NRF24L01_REG_CONFIG 0x00 |
#define NRF24L01_REG_DYNPD 0x1C |
enable dynamic payload length register
Definition at line 93 of file driver_nrf24l01.c.
#define NRF24L01_REG_EN_AA 0x01 |
enable auto acknowledgment register
Definition at line 70 of file driver_nrf24l01.c.
#define NRF24L01_REG_EN_RXADDR 0x02 |
enabled rx addresses register
Definition at line 71 of file driver_nrf24l01.c.
#define NRF24L01_REG_FEATURE 0x1D |
feature register
Definition at line 94 of file driver_nrf24l01.c.
#define NRF24L01_REG_FIFO_STATUS 0x17 |
fifo status register
Definition at line 92 of file driver_nrf24l01.c.
#define NRF24L01_REG_OBSERVE_TX 0x08 |
transmit observe register
Definition at line 77 of file driver_nrf24l01.c.
#define NRF24L01_REG_RF_CH 0x05 |
rf channel register
Definition at line 74 of file driver_nrf24l01.c.
#define NRF24L01_REG_RF_SETUP 0x06 |
rf setup register register
Definition at line 75 of file driver_nrf24l01.c.
#define NRF24L01_REG_RPD 0x09 |
received power detector register
Definition at line 78 of file driver_nrf24l01.c.
#define NRF24L01_REG_RX_ADDR_P0 0x0A |
receive address data pipe 0 register
Definition at line 79 of file driver_nrf24l01.c.
#define NRF24L01_REG_RX_ADDR_P1 0x0B |
receive address data pipe 1 register
Definition at line 80 of file driver_nrf24l01.c.
#define NRF24L01_REG_RX_ADDR_P2 0x0C |
receive address data pipe 2 register
Definition at line 81 of file driver_nrf24l01.c.
#define NRF24L01_REG_RX_ADDR_P3 0x0D |
receive address data pipe 3 register
Definition at line 82 of file driver_nrf24l01.c.
#define NRF24L01_REG_RX_ADDR_P4 0x0E |
receive address data pipe 4 register
Definition at line 83 of file driver_nrf24l01.c.
#define NRF24L01_REG_RX_ADDR_P5 0x0F |
receive address data pipe 5 register
Definition at line 84 of file driver_nrf24l01.c.
#define NRF24L01_REG_RX_PW_P0 0x11 |
number of bytes in rx payload in data pipe 0 register
Definition at line 86 of file driver_nrf24l01.c.
#define NRF24L01_REG_RX_PW_P1 0x12 |
number of bytes in rx payload in data pipe 1 register
Definition at line 87 of file driver_nrf24l01.c.
#define NRF24L01_REG_RX_PW_P2 0x13 |
number of bytes in rx payload in data pipe 2 register
Definition at line 88 of file driver_nrf24l01.c.
#define NRF24L01_REG_RX_PW_P3 0x14 |
number of bytes in rx payload in data pipe 3 register
Definition at line 89 of file driver_nrf24l01.c.
#define NRF24L01_REG_RX_PW_P4 0x15 |
number of bytes in rx payload in data pipe 4 register
Definition at line 90 of file driver_nrf24l01.c.
#define NRF24L01_REG_RX_PW_P5 0x16 |
number of bytes in rx payload in data pipe 5 register
Definition at line 91 of file driver_nrf24l01.c.
#define NRF24L01_REG_SETUP_AW 0x03 |
setup of address widths register
Definition at line 72 of file driver_nrf24l01.c.
#define NRF24L01_REG_SETUP_RETR 0x04 |
setup of automatic retransmission register
Definition at line 73 of file driver_nrf24l01.c.
#define NRF24L01_REG_STATUS 0x07 |
status register
Definition at line 76 of file driver_nrf24l01.c.
#define NRF24L01_REG_TX_ADDR 0x10 |
transmit address register
Definition at line 85 of file driver_nrf24l01.c.
#define SUPPLY_VOLTAGE_MAX 3.6f |
chip max supply voltage
Definition at line 45 of file driver_nrf24l01.c.
#define SUPPLY_VOLTAGE_MIN 1.9f |
chip min supply voltage
Definition at line 44 of file driver_nrf24l01.c.
#define TEMPERATURE_MAX 85.0f |
chip max operating temperature
Definition at line 48 of file driver_nrf24l01.c.
#define TEMPERATURE_MIN -40.0f |
chip min operating temperature
Definition at line 47 of file driver_nrf24l01.c.