My Project
|
nRF24L01 Wireless Transceiver Driver for STM32 More...
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "main.h"
#include "stm32f1xx_hal.h"
Go to the source code of this file.
Classes | |
struct | nrf24l01_data_pipe |
Data pipe configuration structure. More... | |
struct | nrf24l01_device |
Main nRF24L01 device configuration structure. More... |
Macros | |
#define | EMPTY_DATA (uint8_t *)0xFF |
Empty data placeholder for uninitialized pointers. | |
#define | CONFIG 0x00 |
#define | EN_AA 0x01 |
#define | EN_RXADDR 0x02 |
#define | SETUP_AW 0x03 |
#define | SETUP_RETR 0x04 |
#define | RF_CH 0x05 |
#define | RF_SETUP 0x06 |
#define | STATUS 0x07 |
#define | OBSERVE_TX 0x08 |
#define | PRD 0x09 |
#define | RX_ADDR_P0 0x0A |
#define | RX_ADDR_P1 0x0B |
#define | RX_ADDR_P2 0x0C |
#define | RX_ADDR_P3 0x0D |
#define | RX_ADDR_P4 0x0E |
#define | RX_ADDR_P5 0x0F |
#define | TX_ADDR 0x10 |
#define | RX_PW_P0 0x11 |
#define | RX_PW_P1 0x12 |
#define | RX_PW_P2 0x13 |
#define | RX_PW_P3 0x14 |
#define | RX_PW_P4 0x15 |
#define | RX_PW_P5 0x16 |
#define | FIFO_STATUS 0x17 |
#define | DYNPD 0x1C |
#define | FEATURE 0x1D |
#define | MASK_RX_DR 0b01000000 |
#define | MASK_TX_DS 0b00100000 |
#define | MASK_MAX_RT 0b00010000 |
#define | EN_CRC 0b00001000 |
#define | CRCO 0b00000100 |
#define | PWR_UP 0b00000010 |
#define | PRIM_RX 0b00000001 |
#define | ENAA_P5 0b00100000 |
#define | ENAA_P4 0b00010000 |
#define | ENAA_P3 0b00001000 |
#define | ENAA_P2 0b00000100 |
#define | ENAA_P1 0b00000010 |
#define | ENAA_P0 0b00000001 |
#define | ERX_P5 0b00100000 |
#define | ERX_P4 0b00010000 |
#define | ERX_P3 0b00001000 |
#define | ERX_P2 0b00000100 |
#define | ERX_P1 0b00000010 |
#define | ERX_P0 0b00000001 |
#define | AW 0b00000011 |
#define | AW0 0b00000001 |
#define | AW1 0b00000010 |
#define | ARD 0b11110000 |
#define | ARD0 0b00010000 |
#define | ARD1 0b00100000 |
#define | ARD2 0b01000000 |
#define | ARD3 0b10000000 |
#define | ARC 0b00001111 |
#define | ARC0 0b00000001 |
#define | ARC1 0b00000010 |
#define | ARC2 0b00000100 |
#define | ARC3 0b00001000 |
#define | RF_CH0 0b00000001 |
#define | RF_CH1 0b00000010 |
#define | RF_CH2 0b00000100 |
#define | RF_CH3 0b00001000 |
#define | RF_CH4 0b00010000 |
#define | RF_CH5 0b00100000 |
#define | RF_CH6 0b01000000 |
#define | PLL_LOCK 0b00010000 |
#define | RF_DR 0b00001000 |
#define | RF_PWR 0b00000110 |
#define | RF_PWR0 0b00000010 |
#define | RF_PWR1 0b00000100 |
#define | LNA_HCURR 0b00000001 |
#define | RX_DR 0b01000000 |
#define | TX_DS 0b00100000 |
#define | MAX_RT 0b00010000 |
#define | RX_P_NO 0b00001110 |
#define | RX_P_NO0 0b00000010 |
#define | RX_P_NO1 0b00000100 |
#define | RX_P_NO2 0b00001000 |
#define | TX_FULL 0b00000001 |
#define | PLOS_CNT 0b11110000 |
#define | PLOS_CNT0 0b00010000 |
#define | PLOS_CNT1 0b00100000 |
#define | PLOS_CNT2 0b01000000 |
#define | PLOS_CNT3 0b10000000 |
#define | ARC_CNT 0b00001111 |
#define | ARC_CNT0 0b00000001 |
#define | ARC_CNT1 0b00000010 |
#define | ARC_CNT2 0b00000100 |
#define | ARC_CNT3 0b00001000 |
#define | CD 0b00000001 |
#define | TX_REUSE 0b01000000 |
#define | FIFO_FULL 0b00100000 |
#define | TX_EMPTY 0b00010000 |
#define | RX_FULL 0b00000010 |
#define | RX_EMPTY 0b00000001 |
#define | EN_DPL 0b00000100 |
#define | EN_ACK_PAY 0b00000010 |
#define | EN_DYN_ACK 0b00000001 |
#define | R_REGISTER 0x00 |
#define | W_REGISTER 0x20 |
#define | R_RX_PAYLOAD 0x61 |
#define | W_TX_PAYLOAD 0xA0 |
#define | FLUSH_TX 0xE1 |
#define | FLUSH_RX 0xE2 |
#define | REUSE_TX_PL 0xE3 |
#define | ACTIVATE 0x50 |
#define | R_RX_PL_WID 0x60 |
#define | W_ACK_PAYLOAD 0xA8 |
#define | W_TX_PAYLOAD_NOACK 0xB0 |
#define | NOP 0xFF |
Functions | |
nrf24l01_device | nrf24l01_get_default_config () |
Get default device configuration. | |
uint8_t | nrf24l01_init (nrf24l01_device *device) |
Initialize nRF24L01 device. | |
void | nrf24l01_deinit (nrf24l01_device *device) |
Deinitialize nRF24L01 device. | |
uint8_t | nrf24l01_init_data_pipe (nrf24l01_device *device, uint8_t pipe_number) |
Initialize specific data pipe. | |
void | nrf24l01_delay (nrf24l01_device *device, uint16_t us) |
Generate microsecond delay. | |
uint8_t | nrf24l01_chip_select (nrf24l01_device *device) |
Select nRF24L01 chip (CSN low) | |
uint8_t | nrf24l01_chip_deselect (nrf24l01_device *device) |
Deselect nRF24L01 chip (CSN high) | |
uint8_t | nrf24l01_chip_enable (nrf24l01_device *device) |
Enable nRF24L01 chip (CE high) | |
uint8_t | nrf24l01_chip_disable (nrf24l01_device *device) |
Disable nRF24L01 chip (CE low) | |
uint8_t | nrf24l01_send_command (nrf24l01_device *device, uint8_t command) |
Send single byte command. | |
uint8_t | nrf24l01_read_register (nrf24l01_device *device, uint8_t reg, uint8_t *data, uint16_t length) |
Read from nRF24L01 register. | |
uint8_t | nrf24l01_write_register (nrf24l01_device *device, uint8_t reg, uint8_t *data, uint16_t length) |
Write to nRF24L01 register. | |
uint8_t | nrf24l01_read_rx_payload (nrf24l01_device *device, uint8_t *data, uint16_t length) |
Read RX payload from FIFO. | |
uint8_t | nrf24l01_write_tx_payload (nrf24l01_device *device, uint8_t *data, uint16_t length) |
Write TX payload to FIFO. | |
uint8_t | nrf24l01_write_ack_payload (nrf24l01_device *device, uint8_t *data, uint8_t pipe, uint16_t length) |
Write ACK payload for specific pipe. | |
uint8_t | nrf24l01_write_tx_payload_no_ack (nrf24l01_device *device, uint8_t *data, uint16_t length) |
Write TX payload without expecting ACK. | |
uint8_t | nrf24l01_read_rx_payload_width (nrf24l01_device *device, uint8_t *data) |
Read top RX payload width. | |
uint8_t | nrf24l01_flush_tx (nrf24l01_device *device) |
Flush TX FIFO. | |
uint8_t | nrf24l01_flush_rx (nrf24l01_device *device) |
Flush RX FIFO. | |
uint8_t | nrf24l01_reuse_tx_payload (nrf24l01_device *device) |
Reuse last transmitted payload. | |
uint8_t | nrf24l01_activate_extra_features (nrf24l01_device *device) |
Activate extra features. | |
uint8_t | nrf24l01_nop (nrf24l01_device *device) |
No operation command. | |
uint8_t | nrf24l01_power_up (nrf24l01_device *device) |
Power up the nRF24L01 device. | |
uint8_t | nrf24l01_power_down (nrf24l01_device *device) |
Power down the nRF24L01 device. | |
uint8_t | nrf24l01_transmit (nrf24l01_device *device) |
Configure device for transmit mode. | |
uint8_t | nrf24l01_listen (nrf24l01_device *device) |
Configure device for receive mode. | |
uint8_t | nrf24l01_dynamic_payload_length (nrf24l01_device *device, uint8_t enable) |
Enable/disable dynamic payload length. | |
uint8_t | nrf24l01_payload_with_ack (nrf24l01_device *device, uint8_t enable) |
Enable/disable payload with ACK. | |
uint8_t | nrf24l01_dynamic_ack (nrf24l01_device *device, uint8_t enable) |
Enable/disable dynamic ACK. | |
uint8_t | nrf24l01_data_pipe_dynamic_payload_length (nrf24l01_device *device, uint8_t pipe_number, uint8_t enable) |
Enable/disable dynamic payload length for specific pipe. | |
uint8_t | nrf24l01_data_pipe_enable (nrf24l01_device *device, uint8_t pipe_number, uint8_t enable) |
Enable/disable specific data pipe. | |
uint8_t | nrf24l01_data_pipe_auto_ack (nrf24l01_device *device, uint8_t pipe_number, uint8_t enable) |
Enable/disable auto-acknowledgment for specific pipe. | |
uint8_t | nrf24l01_data_pipe_address (nrf24l01_device *device, uint8_t pipe_number, uint8_t *address, uint8_t length) |
Set receive address for specific data pipe. | |
uint8_t | nrf24l01_data_pipe_payload_width (nrf24l01_device *device, uint8_t pipe_number, uint8_t width) |
Set payload width for specific data pipe. | |
uint8_t | nrf24l01_interrupt (nrf24l01_device *device, nrf24l01_irq irq, uint8_t enable) |
Enable/disable specific interrupt. | |
uint8_t | nrf24l01_clear_interrupt_flag (nrf24l01_device *device, nrf24l01_irq irq) |
Clear specific interrupt flag. |
nRF24L01 Wireless Transceiver Driver for STM32
This library provides a comprehensive driver for the nRF24L01 2.4GHz wireless transceiver module. It supports all major features including multi-pipe communication, auto-acknowledgment, dynamic payload lengths, and various power/data rate configurations.