Loading...
Searching...
No Matches

Detailed Description

#include <stdint.h>
#include <stdio.h>
#include "periph/gpio.h"
#include "periph/spi.h"
+ Include dependency graph for nrf24l01p.h:

Go to the source code of this file.

Data Structures

struct  nrf24l01p_t
 Structure that represents the hardware setup of the nrf24l01+ transceiver. More...
 

Enumerations

enum  nrf24l01p_aw_t { NRF24L01P_AW_3BYTE , NRF24L01P_AW_4BYTE , NRF24L01P_AW_5BYTE }
 Defines the address width of the nrf24l01+ transceiver. More...
 
enum  nrf24l01p_dr_t { NRF24L01P_DR_250KBS , NRF24L01P_DR_1MBS , NRF24L01P_DR_2MBS }
 Defines the RF datarate. More...
 
enum  nrf24l01p_pwr_t { NRF24L01P_PWR_N18DBM = 0 , NRF24L01P_PWR_N12DBM , NRF24L01P_PWR_N6DBM , NRF24L01P_PWR_0DBM }
 Defines the RF power level. More...
 
enum  nrf24l01p_rx_pipe_t {
  NRF24L01P_PIPE0 = 0 , NRF24L01P_PIPE1 , NRF24L01P_PIPE2 , NRF24L01P_PIPE3 ,
  NRF24L01P_PIPE4 , NRF24L01P_PIPE5
}
 Defines the datapipe on which the receiver searches for packets. More...
 
enum  nrf24l01p_crc_t { NRF24L01P_CRC_1BYTE = 0 , NRF24L01P_CRC_2BYTE }
 Defines the error detection encoding scheme for the nrf24l01p transceiver. More...
 
enum  nrf24l01p_retransmit_delay_t {
  NRF24L01P_RETR_250US = 0 , NRF24L01P_RETR_500US , NRF24L01P_RETR_750US , NRF24L01P_RETR_1000US ,
  NRF24L01P_RETR_1250US , NRF24L01P_RETR_1500US , NRF24L01P_RETR_1750US , NRF24L01P_RETR_2000US ,
  NRF24L01P_RETR_2250US , NRF24L01P_RETR_2500US , NRF24L01P_RETR_2750US , NRF24L01P_RETR_3000US ,
  NRF24L01P_RETR_3250US , NRF24L01P_RETR_3500US , NRF24L01P_RETR_3750US , NRF24L01P_RETR_4000US
}
 Defines the automatic retransmission delay defined from end of transmission to start of next treansmission. More...
 
enum  nrf24l01p_rx_event_t { RCV_PKT_NRF24L01P = 0 }
 Defines states for the nrf24l01+ transceiver. More...
 

Functions

int nrf24l01p_read_reg (const nrf24l01p_t *dev, char reg, char *answer)
 Read one register of the nrf24l01+ transceiver.
 
int nrf24l01p_write_reg (const nrf24l01p_t *dev, char reg, char write)
 Write one register to the nrf24l01+ transceiver.
 
int nrf24l01p_init (nrf24l01p_t *dev, spi_t spi, gpio_t ce, gpio_t csn, gpio_t irq)
 Initialize the nrf24l01+ transceiver.
 
int nrf24l01p_on (const nrf24l01p_t *dev)
 Power on the nrf24l01+ transceiver.
 
int nrf24l01p_off (const nrf24l01p_t *dev)
 Power off the nrf24l01+ transceiver.
 
void nrf24l01p_transmit (const nrf24l01p_t *dev)
 Transmit payload laying in TX FIFO of the nrf24l01+ transceiver.
 
int nrf24l01p_read_payload (const nrf24l01p_t *dev, char *answer, unsigned int size)
 Read payload from RX FIFO of the nrf24l01+ transceiver.
 
void nrf24l01p_register (nrf24l01p_t *dev, unsigned int *pid)
 Register a given ID to the nrf24l01+ transceiver.
 
int nrf24l01p_enable_dynamic_payload (const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe)
 Enable dynamic payload for the pipe on give nrf24l01+ transceiver.
 
int nrf24l01p_enable_dynamic_ack (const nrf24l01p_t *dev)
 Enable dynamic ack for the nrf24l01+ transceiver.
 
int nrf24l01p_unregister (nrf24l01p_t *dev, unsigned int pid)
 Unregister the nrf24l01+ transceiver from his ID.
 
void nrf24l01p_get_id (const nrf24l01p_t *dev, unsigned int *pid)
 Get ID from the nrf24l01p transceiver.
 
void nrf24l01p_start (const nrf24l01p_t *dev)
 Start searching packets while in RX mode.
 
void nrf24l01p_stop (const nrf24l01p_t *dev)
 Stop searching packets while in RX mode.
 
int nrf24l01p_preload (const nrf24l01p_t *dev, char *data, unsigned int size)
 Preload TX FIFO with payload to transmit.
 
int nrf24l01p_set_channel (const nrf24l01p_t *dev, uint8_t chan)
 Set the RF channel for the nrf24l01+ transceiver.
 
int nrf24l01p_set_address_width (const nrf24l01p_t *dev, nrf24l01p_aw_t aw)
 Set the address width for the nrf24l01+ transceiver.
 
int nrf24l01p_set_payload_width (const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, uint8_t width)
 Set the RX payload width for the nrf24l01+ transceiver.
 
int nrf24l01p_set_tx_address (const nrf24l01p_t *dev, const uint8_t *saddr, unsigned int length)
 Set the TX address for the nrf24l01+ transceiver (byte array).
 
int nrf24l01p_set_tx_address_long (const nrf24l01p_t *dev, uint64_t saddr, unsigned int length)
 Set the TX address for the nrf24l01+ transceiver (long int).
 
int nrf24l01p_set_rx_address (const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, const uint8_t *saddr, unsigned int length)
 Set the RX address for the nrf24l01+ transceiver (byte array).
 
int nrf24l01p_set_rx_address_long (const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, uint64_t saddr, unsigned int length)
 Set the RX address for the nrf24l01+ transceiver (long int).
 
uint64_t nrf24l01p_get_tx_address_long (const nrf24l01p_t *dev)
 Get the TX address for the nrf24l01+ transceiver (long int).
 
uint64_t nrf24l01p_get_rx_address_long (const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe)
 Get the RX address for the nrf24l01+ transceiver (long int).
 
int nrf24l01p_set_datarate (const nrf24l01p_t *dev, nrf24l01p_dr_t dr)
 Get the TX address for the nrf24l01+ transceiver (long int).
 
int nrf24l01p_get_status (const nrf24l01p_t *dev)
 Get the status (register) of the nrf24l01+ transceiver device.
 
int nrf24l01p_set_power (const nrf24l01p_t *dev, int pwr)
 Set the transmit power for the nrf24l01+ transceiver device.
 
int nrf24l01p_get_power (const nrf24l01p_t *dev)
 Get the transmit power for the nrf24l01+ transceiver device.
 
int nrf24l01p_set_txmode (const nrf24l01p_t *dev)
 Set the nrf24l01+ into TX mode.
 
int nrf24l01p_set_rxmode (const nrf24l01p_t *dev)
 Set the nrf24l01+ into RX mode.
 
int nrf24l01p_reset_all_interrupts (const nrf24l01p_t *dev)
 Reset all interrupts on the nrf24l01+ transceiver.
 
int nrf24l01p_reset_interrupts (const nrf24l01p_t *dev, char intrs)
 Reset interrupts on the nrf24l01+ transceiver.
 
int nrf24l01p_mask_interrupt (const nrf24l01p_t *dev, char intr)
 Mask one interrupt on the nrf24l01+ transceiver.
 
int nrf24l01p_unmask_interrupt (const nrf24l01p_t *dev, char intr)
 Unmask one interrupt on the nrf24l01+ transceiver.
 
int nrf24l01p_enable_pipe (const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe)
 Enable RX datapipe on the nrf24l01+ transceiver.
 
int nrf24l01p_disable_pipe (const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe)
 Disable RX datapipe on the nrf24l01+ transceiver.
 
int nrf24l01p_disable_crc (const nrf24l01p_t *dev)
 Disable CRC error detection on the nrf24l01+ transceiver.
 
int nrf24l01p_enable_crc (const nrf24l01p_t *dev, nrf24l01p_crc_t crc)
 Enable CRC error detection on the nrf24l01+ transceiver.
 
int nrf24l01p_setup_auto_ack (const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, nrf24l01p_retransmit_delay_t delay_retrans, char count_retrans)
 Setup and enable automatic ACK and retransmission on the nrf24l01+ transceiver.
 
int nrf24l01p_disable_all_auto_ack (const nrf24l01p_t *dev)
 Disable automatic ACK on the nrf24l01+ transceiver.
 
int nrf24l01p_flush_tx_fifo (const nrf24l01p_t *dev)
 Flush TX FIFO on the nrf24l01+ transceiver.
 
int nrf24l01p_flush_rx_fifo (const nrf24l01p_t *dev)
 Flush RX FIFO on the nrf24l01+ transceiver.
 
void nrf24l01p_rx_cb (void *arg)
 Callback that is called when interrupt occurs on interrupt pin from the nrf24l01+ transceiver.