18#ifndef NRF24L01P_NG_TYPES_H
19#define NRF24L01P_NG_TYPES_H
31#define NRF24L01P_NG_TRANSITION_TO_POWER_DOWN (1 << 3)
36#define NRF24L01P_NG_TRANSITION_TO_STANDBY_1 (1 << 4)
41#define NRF24L01P_NG_TRANSITION_TO_STANDBY_2 (1 << 5)
46#define NRF24L01P_NG_TRANSITION_TO_RX_MODE (1 << 6)
51#define NRF24L01P_NG_TRANSITION_TO_TX_MODE (1 << 7)
197 if (address_width <= 3) {
200 if (address_width == 4) {
219 return (retr_delay + 1) * 250;
232 if (retr_delay >= 4000) {
235 if (retr_delay < 250) {
352 if (data_rate <= 250) {
355 if (data_rate <= 1000) {
enum nrf24l01p_ng_rfdr nrf24l01p_ng_rfdr_t
Possible values to configure the data rate.
nrf24l01p_ng_pipe
Enumeration of NRF24L01+ data pipes.
@ NRF24L01P_NG_PX_NUM_OF
Number of supported pipes.
#define NRF24L01P_NG_TRANSITION_TO_STANDBY_2
Flag that indicates that a state transition to STANDBY_2 can be done.
nrf24l01p_ng_rfdr
Possible values to configure the data rate.
@ NRF24L01P_NG_RF_DR_250KBPS
250 kbit/s
@ NRF24L01P_NG_RF_DR_2MBPS
2 Mbit/s
@ NRF24L01P_NG_RF_DR_NUM_OF
Number of possible values to configure the data rate.
@ NRF24L01P_NG_RF_DR_1MBPS
1 Mbit/s
#define NRF24L01P_NG_TRANSITION_TO_POWER_DOWN
Flag that indicates that a state transition to POWER_DOWN can be done.
nrf24l01p_ng_crc
Possible values to configure the CRC length.
@ NRF24L01P_NG_CRC_2BYTE
2 bytes CRC length
@ NRF24L01P_NG_CRC_0BYTE
0 bytes CRC length
@ NRF24L01P_NG_CRC_1BYTE
1 byte CRC length
#define NRF24L01P_NG_TRANSITION_TO_RX_MODE
Flag that indicates that a state transition to RX_MODE can be done.
static nrf24l01p_ng_tx_power_t nrf24l01p_ng_valtoe_tx_power(int16_t power)
Convert RF power in [dbm] to nrf24l01p_ng_tx_power_t.
#define NRF24L01P_NG_TRANSITION_TO_STANDBY_1
Flag that indicates that a state transition to STANDBY_1 can be done.
static nrf24l01p_ng_aw_t nrf24l01p_ng_valtoe_aw(uint8_t address_width)
Convert address width in [bytes] to nrf24l01p_ng_aw_t.
static uint16_t nrf24l01p_ng_etoval_rfdr(nrf24l01p_ng_rfdr_t data_rate)
Convert nrf24l01p_ng_rfdr_t to actual air data rate.
enum nrf24l01p_ng_aw nrf24l01p_ng_aw_t
Possible values to configure the layer-2 address width.
nrf24l01p_ng_state
NRF24L01+ operation states.
@ NRF24L01P_NG_STATE_RX_MODE
Constantly search for a valid packet.
@ NRF24L01P_NG_STATE_POWER_DOWN
Register values are available and maintained, SPI active.
@ NRF24L01P_NG_STATE_STANDBY_2
TX FIFO empty, fill up TX FIFO again.
@ NRF24L01P_NG_STATE_STANDBY_1
Idle.
@ NRF24L01P_NG_STATE_UNDEFINED
State right after voltage supply.
@ NRF24L01P_NG_STATE_TX_MODE
Transmit next packet.
enum nrf24l01p_ng_pipe nrf24l01p_ng_pipe_t
Enumeration of NRF24L01+ data pipes.
static uint8_t nrf24l01p_ng_etoval_aw(nrf24l01p_ng_aw_t address_width)
Convert nrf24l01p_ng_aw_t to actual address width.
nrf24l01p_ng_aw
Possible values to configure the layer-2 address width.
@ NRF24L01P_NG_AW_NUM_OF
Number of possible values to configure the layer-2 address width.
@ NRF24L01P_NG_AW_4BYTE
Use a 4 bytes long layer-2 address.
@ NRF24L01P_NG_AW_5BYTE
Use a 5 bytes long layer-2 address.
@ NRF24L01P_NG_AW_3BYTE
Use a 3 bytes long layer-2 address.
static nrf24l01p_ng_ard_t nrf24l01p_ng_valtoe_ard(uint16_t retr_delay)
Convert retransmission delay in [us] to nrf24l01p_ng_ard_t.
enum nrf24l01p_ng_ard nrf24l01p_ng_ard_t
Possible values to configure the retransmission delay in ESB.
nrf24l01p_ng_tx_power
Possible values to configure the radio power.
@ NRF24L01P_NG_TX_POWER_MINUS_6DBM
-6 dBm
@ NRF24L01P_NG_TX_POWER_0DBM
0 dBm
@ NRF24L01P_NG_TX_POWER_NUM_OF
Number of possible values to configure the radio power.
@ NRF24L01P_NG_TX_POWER_MINUS_18DBM
-18 dBm
@ NRF24L01P_NG_TX_POWER_MINUS_12DBM
-12 dBm
static nrf24l01p_ng_crc_t nrf24l01p_ng_valtoe_crc(uint8_t crc_len)
Convert CRC length in [bytes] to nrf24l01p_ng_crc_t.
enum nrf24l01p_ng_state nrf24l01p_ng_state_t
NRF24L01+ operation states.
enum nrf24l01p_ng_crc nrf24l01p_ng_crc_t
Possible values to configure the CRC length.
#define NRF24L01P_NG_TRANSITION_TO_TX_MODE
Flag that indicates that a state transition to TX_MODE can be done.
nrf24l01p_ng_ard
Possible values to configure the retransmission delay in ESB.
@ NRF24L01P_NG_ARD_2000US
2000 us
@ NRF24L01P_NG_ARD_3000US
3000 us
@ NRF24L01P_NG_ARD_3750US
3750 us
@ NRF24L01P_NG_ARD_1750US
1750 us
@ NRF24L01P_NG_ARD_3250US
3250 us
@ NRF24L01P_NG_ARD_NUM_OF
Number of possible values to configure the retransmission delay.
@ NRF24L01P_NG_ARD_2750US
2750 us
@ NRF24L01P_NG_ARD_250US
250 us
@ NRF24L01P_NG_ARD_750US
750 us
@ NRF24L01P_NG_ARD_4000US
4000 us
@ NRF24L01P_NG_ARD_2250US
2250 us
@ NRF24L01P_NG_ARD_2500US
2500 us
@ NRF24L01P_NG_ARD_3500US
3500 us
@ NRF24L01P_NG_ARD_1250US
1250 us
@ NRF24L01P_NG_ARD_1000US
1000 us
@ NRF24L01P_NG_ARD_500US
500 us
@ NRF24L01P_NG_ARD_1500US
1500 us
static uint16_t nrf24l01p_ng_etoval_ard(nrf24l01p_ng_ard_t retr_delay)
Convert nrf24l01p_ng_ard_t to actual retransmission delay.
static int8_t nrf24l01p_ng_etoval_tx_power(nrf24l01p_ng_tx_power_t power)
Convert nrf24l01p_ng_tx_power_t to actual Tx power.
static nrf24l01p_ng_rfdr_t nrf24l01p_ng_valtoe_rfdr(uint16_t data_rate)
Convert Air data rate in [kbit/s] to nrf24l01p_ng_rfdr_t.
enum nrf24l01p_ng_tx_power nrf24l01p_ng_tx_power_t
Possible values to configure the radio power.
static uint8_t nrf24l01p_ng_etoval_crc(nrf24l01p_ng_crc_t crc_len)
Convert nrf24l01p_ng_crc_t to actual CRC length.