18#ifndef NRF24L01P_NG_COMMUNICATION_H
19#define NRF24L01P_NG_COMMUNICATION_H
30#define NRF24L01P_NG_ADDR_MASK (0x1F)
35#define NRF24L01P_NG_PIPE_MASK (0x07)
41#define NRF24L01P_NG_CMD_R_REGISTER(reg) \
42 (0x00 | ((reg) & NRF24L01P_NG_ADDR_MASK))
48#define NRF24L01P_NG_CMD_W_REGISTER(reg) \
49 (0x20 | ((reg) & NRF24L01P_NG_ADDR_MASK))
55#define NRF24L01P_NG_CMD_R_RX_PAYLOAD (0x61)
61#define NRF24L01P_NG_CMD_W_TX_PAYLOAD (0xA0)
67#define NRF24L01P_NG_CMD_FLUSH_TX (0xE1)
73#define NRF24L01P_NG_CMD_FLUSH_RX (0xE2)
79#define NRF24L01P_NG_CMD_REUSE_TX_PL (0xE3)
85#define NRF24L01P_NG_CMD_R_RX_PL_WID (0x60)
91#define NRF24L01P_NG_CMD_W_ACK_PAYLOAD(pipe) \
92 (0xA8 | ((pipe) & NRF24L01P_NG_PIPE_MASK))
97#define NRF24L01P_NG_CMD_W_TX_PAYLOAD_NO_ACK (0xB0)
102#define NRF24L01P_NG_CMD_NOP (0xFF)
129 uint8_t *dest,
size_t len);
142 const uint8_t *src,
size_t len);
166 const void *src,
size_t len);
220 size_t len, uint8_t pipe);
233 const void *src,
size_t len);
Public interface for NRF24L01+ (NG) devices.
uint8_t nrf24l01p_ng_write_reg(const nrf24l01p_ng_t *dev, uint8_t reg, const uint8_t *src, size_t len)
Write a register value.
uint8_t nrf24l01p_ng_reuse_tx_pl(const nrf24l01p_ng_t *dev)
Reuse TX payload in FIFO.
uint8_t nrf24l01p_ng_read_rx_pl_width(const nrf24l01p_ng_t *dev, uint8_t *dest)
Read received payload width.
uint8_t nrf24l01p_ng_get_status(const nrf24l01p_ng_t *dev)
Get status register value.
void nrf24l01p_ng_release(nrf24l01p_ng_t *dev)
Release the SPI bus of the transceiver.
uint8_t nrf24l01p_ng_write_tx_payload(const nrf24l01p_ng_t *dev, const void *src, size_t len)
Write payload to be transmitted.
uint8_t nrf24l01p_ng_flush_rx(const nrf24l01p_ng_t *dev)
Flush RX FIFO.
uint8_t nrf24l01p_ng_write_ack_pl(const nrf24l01p_ng_t *dev, const void *src, size_t len, uint8_t pipe)
Write Payload to be transmitted in an ACK frame.
uint8_t nrf24l01p_ng_read_reg(const nrf24l01p_ng_t *dev, uint8_t reg, uint8_t *dest, size_t len)
Read a register value.
uint8_t nrf24l01p_ng_write_tx_pl_no_ack(const nrf24l01p_ng_t *dev, const void *src, size_t len)
Write payload to be transmitted but do not expect an ACK for this frame.
void nrf24l01p_ng_acquire(nrf24l01p_ng_t *dev)
Acquire the SPI bus of the transceiver.
uint8_t nrf24l01p_ng_read_rx_payload(const nrf24l01p_ng_t *dev, void *dest, size_t len)
Read received payload.
uint8_t nrf24l01p_ng_flush_tx(const nrf24l01p_ng_t *dev)
Flush TX FIFO.