Loading...
Searching...
No Matches
nrf24l01p_ng_types.h File Reference

Definitions of user visible types for the NRF24L01+ (NG) device driver. More...

Detailed Description

Definitions of user visible types for the NRF24L01+ (NG) device driver.

Author
Fabian Hüßler fabia.nosp@m.n.hu.nosp@m.essle.nosp@m.r@ov.nosp@m.gu.de

Definition in file nrf24l01p_ng_types.h.

#include <stdint.h>
+ Include dependency graph for nrf24l01p_ng_types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define NRF24L01P_NG_TRANSITION_TO_POWER_DOWN   (1 << 3)
 Flag that indicates that a state transition to POWER_DOWN can be done.
 
#define NRF24L01P_NG_TRANSITION_TO_STANDBY_1   (1 << 4)
 Flag that indicates that a state transition to STANDBY_1 can be done.
 
#define NRF24L01P_NG_TRANSITION_TO_STANDBY_2   (1 << 5)
 Flag that indicates that a state transition to STANDBY_2 can be done.
 
#define NRF24L01P_NG_TRANSITION_TO_RX_MODE   (1 << 6)
 Flag that indicates that a state transition to RX_MODE can be done.
 
#define NRF24L01P_NG_TRANSITION_TO_TX_MODE   (1 << 7)
 Flag that indicates that a state transition to TX_MODE can be done.
 
enum  nrf24l01p_ng_state {
  NRF24L01P_NG_STATE_UNDEFINED , NRF24L01P_NG_STATE_POWER_DOWN , NRF24L01P_NG_STATE_STANDBY_1 , NRF24L01P_NG_STATE_STANDBY_2 ,
  NRF24L01P_NG_STATE_RX_MODE , NRF24L01P_NG_STATE_TX_MODE
}
 NRF24L01+ operation states. More...
 
enum  nrf24l01p_ng_pipe {
  NRF24L01P_NG_P0 = 0 , NRF24L01P_NG_P1 = 1 , NRF24L01P_NG_P2 = 2 , NRF24L01P_NG_P3 = 3 ,
  NRF24L01P_NG_P4 = 4 , NRF24L01P_NG_P5 = 5 , NRF24L01P_NG_PX_NUM_OF
}
 Enumeration of NRF24L01+ data pipes. More...
 
enum  nrf24l01p_ng_aw { NRF24L01P_NG_AW_3BYTE = 1 , NRF24L01P_NG_AW_4BYTE = 2 , NRF24L01P_NG_AW_5BYTE = 3 , NRF24L01P_NG_AW_NUM_OF }
 Possible values to configure the layer-2 address width. More...
 
enum  nrf24l01p_ng_ard {
  NRF24L01P_NG_ARD_250US = 0 , NRF24L01P_NG_ARD_500US = 1 , NRF24L01P_NG_ARD_750US = 2 , NRF24L01P_NG_ARD_1000US = 3 ,
  NRF24L01P_NG_ARD_1250US = 4 , NRF24L01P_NG_ARD_1500US = 5 , NRF24L01P_NG_ARD_1750US = 6 , NRF24L01P_NG_ARD_2000US = 7 ,
  NRF24L01P_NG_ARD_2250US = 8 , NRF24L01P_NG_ARD_2500US = 9 , NRF24L01P_NG_ARD_2750US = 10 , NRF24L01P_NG_ARD_3000US = 11 ,
  NRF24L01P_NG_ARD_3250US = 12 , NRF24L01P_NG_ARD_3500US = 13 , NRF24L01P_NG_ARD_3750US = 14 , NRF24L01P_NG_ARD_4000US = 15 ,
  NRF24L01P_NG_ARD_NUM_OF
}
 Possible values to configure the retransmission delay in ESB. More...
 
enum  nrf24l01p_ng_crc { NRF24L01P_NG_CRC_0BYTE = 1 , NRF24L01P_NG_CRC_1BYTE = 2 , NRF24L01P_NG_CRC_2BYTE = 3 }
 Possible values to configure the CRC length. More...
 
enum  nrf24l01p_ng_tx_power {
  NRF24L01P_NG_TX_POWER_MINUS_18DBM = 0 , NRF24L01P_NG_TX_POWER_MINUS_12DBM = 1 , NRF24L01P_NG_TX_POWER_MINUS_6DBM = 2 , NRF24L01P_NG_TX_POWER_0DBM = 3 ,
  NRF24L01P_NG_TX_POWER_NUM_OF
}
 Possible values to configure the radio power. More...
 
enum  nrf24l01p_ng_rfdr { NRF24L01P_NG_RF_DR_1MBPS = 0 , NRF24L01P_NG_RF_DR_250KBPS = 1 , NRF24L01P_NG_RF_DR_2MBPS = 2 , NRF24L01P_NG_RF_DR_NUM_OF }
 Possible values to configure the data rate. More...
 
typedef enum nrf24l01p_ng_state nrf24l01p_ng_state_t
 NRF24L01+ operation states.
 
typedef enum nrf24l01p_ng_pipe nrf24l01p_ng_pipe_t
 Enumeration of NRF24L01+ data pipes.
 
typedef enum nrf24l01p_ng_aw nrf24l01p_ng_aw_t
 Possible values to configure the layer-2 address width.
 
typedef enum nrf24l01p_ng_ard nrf24l01p_ng_ard_t
 Possible values to configure the retransmission delay in ESB.
 
typedef enum nrf24l01p_ng_crc nrf24l01p_ng_crc_t
 Possible values to configure the CRC length.
 
typedef enum nrf24l01p_ng_tx_power nrf24l01p_ng_tx_power_t
 Possible values to configure the radio power.
 
typedef enum nrf24l01p_ng_rfdr nrf24l01p_ng_rfdr_t
 Possible values to configure the data rate.
 
typedef struct nrf24l01p_ng nrf24l01p_ng_t
 typedef of forward declaration
 
static uint8_t nrf24l01p_ng_etoval_aw (nrf24l01p_ng_aw_t address_width)
 Convert nrf24l01p_ng_aw_t to actual address width.
 
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_ard (nrf24l01p_ng_ard_t retr_delay)
 Convert nrf24l01p_ng_ard_t to actual retransmission delay.
 
static nrf24l01p_ng_ard_t nrf24l01p_ng_valtoe_ard (uint16_t retr_delay)
 Convert retransmission delay in [us] to nrf24l01p_ng_ard_t.
 
static uint8_t nrf24l01p_ng_etoval_crc (nrf24l01p_ng_crc_t crc_len)
 Convert nrf24l01p_ng_crc_t to actual CRC length.
 
static nrf24l01p_ng_crc_t nrf24l01p_ng_valtoe_crc (uint8_t crc_len)
 Convert CRC length in [bytes] to nrf24l01p_ng_crc_t.
 
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_tx_power_t nrf24l01p_ng_valtoe_tx_power (int16_t power)
 Convert RF power in [dbm] to nrf24l01p_ng_tx_power_t.
 
static uint16_t nrf24l01p_ng_etoval_rfdr (nrf24l01p_ng_rfdr_t data_rate)
 Convert nrf24l01p_ng_rfdr_t to actual air data rate.
 
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.
 

Macro Definition Documentation

◆ NRF24L01P_NG_TRANSITION_TO_POWER_DOWN

#define NRF24L01P_NG_TRANSITION_TO_POWER_DOWN   (1 << 3)

Flag that indicates that a state transition to POWER_DOWN can be done.

Definition at line 31 of file nrf24l01p_ng_types.h.

◆ NRF24L01P_NG_TRANSITION_TO_RX_MODE

#define NRF24L01P_NG_TRANSITION_TO_RX_MODE   (1 << 6)

Flag that indicates that a state transition to RX_MODE can be done.

Definition at line 46 of file nrf24l01p_ng_types.h.

◆ NRF24L01P_NG_TRANSITION_TO_STANDBY_1

#define NRF24L01P_NG_TRANSITION_TO_STANDBY_1   (1 << 4)

Flag that indicates that a state transition to STANDBY_1 can be done.

Definition at line 36 of file nrf24l01p_ng_types.h.

◆ NRF24L01P_NG_TRANSITION_TO_STANDBY_2

#define NRF24L01P_NG_TRANSITION_TO_STANDBY_2   (1 << 5)

Flag that indicates that a state transition to STANDBY_2 can be done.

Definition at line 41 of file nrf24l01p_ng_types.h.

◆ NRF24L01P_NG_TRANSITION_TO_TX_MODE

#define NRF24L01P_NG_TRANSITION_TO_TX_MODE   (1 << 7)

Flag that indicates that a state transition to TX_MODE can be done.

Definition at line 51 of file nrf24l01p_ng_types.h.

Typedef Documentation

◆ nrf24l01p_ng_t

typedef struct nrf24l01p_ng nrf24l01p_ng_t

typedef of forward declaration

Definition at line 165 of file nrf24l01p_ng_types.h.

Enumeration Type Documentation

◆ nrf24l01p_ng_ard

Possible values to configure the retransmission delay in ESB.

Enumerator
NRF24L01P_NG_ARD_250US 

250 us

NRF24L01P_NG_ARD_500US 

500 us

NRF24L01P_NG_ARD_750US 

750 us

NRF24L01P_NG_ARD_1000US 

1000 us

NRF24L01P_NG_ARD_1250US 

1250 us

NRF24L01P_NG_ARD_1500US 

1500 us

NRF24L01P_NG_ARD_1750US 

1750 us

NRF24L01P_NG_ARD_2000US 

2000 us

NRF24L01P_NG_ARD_2250US 

2250 us

NRF24L01P_NG_ARD_2500US 

2500 us

NRF24L01P_NG_ARD_2750US 

2750 us

NRF24L01P_NG_ARD_3000US 

3000 us

NRF24L01P_NG_ARD_3250US 

3250 us

NRF24L01P_NG_ARD_3500US 

3500 us

NRF24L01P_NG_ARD_3750US 

3750 us

NRF24L01P_NG_ARD_4000US 

4000 us

NRF24L01P_NG_ARD_NUM_OF 

Number of possible values to configure the retransmission delay.

Definition at line 111 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_aw

Possible values to configure the layer-2 address width.

Enumerator
NRF24L01P_NG_AW_3BYTE 

Use a 3 bytes long layer-2 address.

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_NUM_OF 

Number of possible values to configure the layer-2 address width.

Definition at line 100 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_crc

Possible values to configure the CRC length.

Enumerator
NRF24L01P_NG_CRC_0BYTE 

0 bytes CRC length

NRF24L01P_NG_CRC_1BYTE 

1 byte CRC length

NRF24L01P_NG_CRC_2BYTE 

2 bytes CRC length

Definition at line 135 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_pipe

Enumeration of NRF24L01+ data pipes.

Enumerator
NRF24L01P_NG_P0 

Pipe 0.

NRF24L01P_NG_P1 

Pipe 1.

NRF24L01P_NG_P2 

Pipe 2.

NRF24L01P_NG_P3 

Pipe 3.

NRF24L01P_NG_P4 

Pipe 4.

NRF24L01P_NG_P5 

Pipe 5.

NRF24L01P_NG_PX_NUM_OF 

Number of supported pipes.

Definition at line 87 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_rfdr

Possible values to configure the data rate.

Enumerator
NRF24L01P_NG_RF_DR_1MBPS 

1 Mbit/s

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.

Definition at line 156 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_state

NRF24L01+ operation states.

Enumerator
NRF24L01P_NG_STATE_UNDEFINED 

State right after voltage supply.

NRF24L01P_NG_STATE_POWER_DOWN 

Register values are available and maintained, SPI active.

NRF24L01P_NG_STATE_STANDBY_1 

Idle.

NRF24L01P_NG_STATE_STANDBY_2 

TX FIFO empty, fill up TX FIFO again.

NRF24L01P_NG_STATE_RX_MODE 

Constantly search for a valid packet.

NRF24L01P_NG_STATE_TX_MODE 

Transmit next packet.

Definition at line 56 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_tx_power

Possible values to configure the radio power.

Enumerator
NRF24L01P_NG_TX_POWER_MINUS_18DBM 

-18 dBm

NRF24L01P_NG_TX_POWER_MINUS_12DBM 

-12 dBm

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.

Definition at line 144 of file nrf24l01p_ng_types.h.

Function Documentation

◆ nrf24l01p_ng_etoval_ard()

static uint16_t nrf24l01p_ng_etoval_ard ( nrf24l01p_ng_ard_t  retr_delay)
inlinestatic

Convert nrf24l01p_ng_ard_t to actual retransmission delay.

Parameters
[in]retr_delayRetransmission delay enum
Returns
Retransmission delay in [us]

Definition at line 214 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_etoval_aw()

static uint8_t nrf24l01p_ng_etoval_aw ( nrf24l01p_ng_aw_t  address_width)
inlinestatic

Convert nrf24l01p_ng_aw_t to actual address width.

Parameters
[in]address_widthAddress width enum
Returns
Address width in [bytes]

Definition at line 176 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_etoval_crc()

static uint8_t nrf24l01p_ng_etoval_crc ( nrf24l01p_ng_crc_t  crc_len)
inlinestatic

Convert nrf24l01p_ng_crc_t to actual CRC length.

Parameters
[in]crc_lenCRC length enum
Returns
CRC length in [bytes]

Definition at line 249 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_etoval_rfdr()

static uint16_t nrf24l01p_ng_etoval_rfdr ( nrf24l01p_ng_rfdr_t  data_rate)
inlinestatic

Convert nrf24l01p_ng_rfdr_t to actual air data rate.

Parameters
[in]data_rateAir data rate enum
Returns
Air data rate in [kbit/s]

Definition at line 331 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_etoval_tx_power()

static int8_t nrf24l01p_ng_etoval_tx_power ( nrf24l01p_ng_tx_power_t  power)
inlinestatic

Convert nrf24l01p_ng_tx_power_t to actual Tx power.

Parameters
[in]powerRF power enum
Returns
RF power in [dbm]

Definition at line 287 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_valtoe_ard()

static nrf24l01p_ng_ard_t nrf24l01p_ng_valtoe_ard ( uint16_t  retr_delay)
inlinestatic

Convert retransmission delay in [us] to nrf24l01p_ng_ard_t.

Parameters
[in]retr_delayRetransmission delay in [us]
Returns
Corresponding enum

Definition at line 230 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_valtoe_aw()

static nrf24l01p_ng_aw_t nrf24l01p_ng_valtoe_aw ( uint8_t  address_width)
inlinestatic

Convert address width in [bytes] to nrf24l01p_ng_aw_t.

Parameters
[in]address_widthAddress width in [bytes]
Returns
Corresponding enum

Definition at line 195 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_valtoe_crc()

static nrf24l01p_ng_crc_t nrf24l01p_ng_valtoe_crc ( uint8_t  crc_len)
inlinestatic

Convert CRC length in [bytes] to nrf24l01p_ng_crc_t.

Parameters
[in]crc_lenCRC length in [bytes]
Returns
Corresponding enum

Definition at line 268 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_valtoe_rfdr()

static nrf24l01p_ng_rfdr_t nrf24l01p_ng_valtoe_rfdr ( uint16_t  data_rate)
inlinestatic

Convert Air data rate in [kbit/s] to nrf24l01p_ng_rfdr_t.

Parameters
[in]data_rateAir data rate in [kbit/s]
Returns
Corresponding enum

Definition at line 350 of file nrf24l01p_ng_types.h.

◆ nrf24l01p_ng_valtoe_tx_power()

static nrf24l01p_ng_tx_power_t nrf24l01p_ng_valtoe_tx_power ( int16_t  power)
inlinestatic

Convert RF power in [dbm] to nrf24l01p_ng_tx_power_t.

Parameters
[in]powerRF power in [dbm]
Returns
Corresponding enum

Definition at line 309 of file nrf24l01p_ng_types.h.