| LibDriver NRF24L01 1.0.0 NRF24L01 full function driver

Macros | Enumerations | Functions
nrf24l01 example driver function
nrf24l01 driver function

nrf24l01 example driver modules More...

## Macros
#define | NRF24L01_BASIC_DEFAULT_CRCO NRF24L01_BOOL_TRUE
| nrf24l01 basic example default definition More...
#define | NRF24L01_BASIC_DEFAULT_ENABLE_CRC NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_PIPE_0_AUTO_ACKNOWLEDGMENT NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_PIPE_1_AUTO_ACKNOWLEDGMENT NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_PIPE_2_AUTO_ACKNOWLEDGMENT NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_PIPE_3_AUTO_ACKNOWLEDGMENT NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_PIPE_4_AUTO_ACKNOWLEDGMENT NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_PIPE_5_AUTO_ACKNOWLEDGMENT NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_RX_PIPE_0 NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_RX_PIPE_1 NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_RX_PIPE_2 NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_RX_PIPE_3 NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_RX_PIPE_4 NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_RX_PIPE_5 NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_ADDRESS_WIDTH NRF24L01_ADDRESS_WIDTH_5_BYTES
#define | NRF24L01_BASIC_DEFAULT_RETRANSMIT_DELAY 750
#define | NRF24L01_BASIC_DEFAULT_RETRANSMIT_COUNT 10
#define | NRF24L01_BASIC_DEFAULT_CHANNEL_FREQUENCY 20
#define | NRF24L01_BASIC_DEFAULT_DATA_RATE NRF24L01_DATA_RATE_2M
#define | NRF24L01_BASIC_DEFAULT_OUTPUT_POWER NRF24L01_OUTPUT_POWER_0_DBM
#define | NRF24L01_BASIC_DEFAULT_PIPE_0_PAYLOAD 32
#define | NRF24L01_BASIC_DEFAULT_PIPE_1_PAYLOAD 32
#define | NRF24L01_BASIC_DEFAULT_PIPE_2_PAYLOAD 32
#define | NRF24L01_BASIC_DEFAULT_PIPE_3_PAYLOAD 32
#define | NRF24L01_BASIC_DEFAULT_PIPE_4_PAYLOAD 32
#define | NRF24L01_BASIC_DEFAULT_PIPE_5_PAYLOAD 32
#define | NRF24L01_BASIC_DEFAULT_PIPE_0_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_PIPE_1_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_PIPE_2_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_PIPE_3_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_PIPE_4_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_PIPE_5_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE
#define | NRF24L01_BASIC_DEFAULT_PAYLOAD_WITH_ACK NRF24L01_BOOL_FALSE
#define | NRF24L01_BASIC_DEFAULT_TX_PAYLOAD_WITH_NO_ACK NRF24L01_BOOL_FALSE
#define | NRF24L01_BASIC_DEFAULT_RX_ADDR_0 {0x1A, 0x01, 0x02, 0x03, 0x00}
#define | NRF24L01_BASIC_DEFAULT_RX_ADDR_1 {0x1B, 0x01, 0x02, 0x03, 0x01}
#define | NRF24L01_BASIC_DEFAULT_RX_ADDR_2 {0x1B, 0x01, 0x02, 0x03, 0x02}
#define | NRF24L01_BASIC_DEFAULT_RX_ADDR_3 {0x1B, 0x01, 0x02, 0x03, 0x03}
#define | NRF24L01_BASIC_DEFAULT_RX_ADDR_4 {0x1B, 0x01, 0x02, 0x03, 0x04}
#define | NRF24L01_BASIC_DEFAULT_RX_ADDR_5 {0x1B, 0x01, 0x02, 0x03, 0x05}

## Enumerations
enum | nrf24l01_type_t { NRF24L01_TYPE_TX = 0x00 , NRF24L01_TYPE_RX = 0x01 }
| nrf24l01 type enumeration definition More...

## Functions
uint8_t | nrf24l01_interrupt_irq_handler (void)
| nrf24l01 irq More...
uint8_t | nrf24l01_basic_init (nrf24l01_type_t type, void(*callback)(uint8_t type, uint8_t num, uint8_t *buf, uint8_t len))
| basic example init More...
uint8_t | nrf24l01_basic_deinit (void)
| basic example deinit More...
uint8_t | nrf24l01_basic_send (uint8_t *addr, uint8_t *buf, uint8_t len)
| basic example send More...

## Detailed Description

nrf24l01 example driver modules

## Macro Definition Documentation

## ◆ NRF24L01_BASIC_DEFAULT_ADDRESS_WIDTH

#define NRF24L01_BASIC_DEFAULT_ADDRESS_WIDTH NRF24L01_ADDRESS_WIDTH_5_BYTES

set 5 bytes width

Definition at line 70 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_CHANNEL_FREQUENCY

#define NRF24L01_BASIC_DEFAULT_CHANNEL_FREQUENCY 20

20 MHz

Definition at line 73 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_CRCO

#define NRF24L01_BASIC_DEFAULT_CRCO NRF24L01_BOOL_TRUE

nrf24l01 basic example default definition

enable 2 bytes crc

Definition at line 56 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_DATA_RATE

#define NRF24L01_BASIC_DEFAULT_DATA_RATE NRF24L01_DATA_RATE_2M

2M

Definition at line 74 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_DYNAMIC_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE

enable dynamic payload

Definition at line 88 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_ENABLE_CRC

#define NRF24L01_BASIC_DEFAULT_ENABLE_CRC NRF24L01_BOOL_TRUE

enable crc

Definition at line 57 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_OUTPUT_POWER

#define NRF24L01_BASIC_DEFAULT_OUTPUT_POWER NRF24L01_OUTPUT_POWER_0_DBM

0dBm

Definition at line 75 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PAYLOAD_WITH_ACK

#define NRF24L01_BASIC_DEFAULT_PAYLOAD_WITH_ACK NRF24L01_BOOL_FALSE

disable payload with ack

Definition at line 89 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_0_AUTO_ACKNOWLEDGMENT

#define NRF24L01_BASIC_DEFAULT_PIPE_0_AUTO_ACKNOWLEDGMENT NRF24L01_BOOL_TRUE

enable pipe 0 auto acknowledgment

Definition at line 58 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_0_DYNAMIC_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_PIPE_0_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE

enable pipe 0 dynamic payload

Definition at line 82 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_0_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_PIPE_0_PAYLOAD 32

32 bytes

Definition at line 76 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_1_AUTO_ACKNOWLEDGMENT

#define NRF24L01_BASIC_DEFAULT_PIPE_1_AUTO_ACKNOWLEDGMENT NRF24L01_BOOL_TRUE

enable pipe 1 auto acknowledgment

Definition at line 59 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_1_DYNAMIC_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_PIPE_1_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE

enable pipe 1 dynamic payload

Definition at line 83 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_1_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_PIPE_1_PAYLOAD 32

32 bytes

Definition at line 77 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_2_AUTO_ACKNOWLEDGMENT

#define NRF24L01_BASIC_DEFAULT_PIPE_2_AUTO_ACKNOWLEDGMENT NRF24L01_BOOL_TRUE

enable pipe 2 auto acknowledgment

Definition at line 60 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_2_DYNAMIC_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_PIPE_2_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE

enable pipe 2 dynamic payload

Definition at line 84 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_2_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_PIPE_2_PAYLOAD 32

32 bytes

Definition at line 78 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_3_AUTO_ACKNOWLEDGMENT

#define NRF24L01_BASIC_DEFAULT_PIPE_3_AUTO_ACKNOWLEDGMENT NRF24L01_BOOL_TRUE

enable pipe 3 auto acknowledgment

Definition at line 61 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_3_DYNAMIC_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_PIPE_3_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE

enable pipe 3 dynamic payload

Definition at line 85 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_3_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_PIPE_3_PAYLOAD 32

32 bytes

Definition at line 79 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_4_AUTO_ACKNOWLEDGMENT

#define NRF24L01_BASIC_DEFAULT_PIPE_4_AUTO_ACKNOWLEDGMENT NRF24L01_BOOL_TRUE

enable pipe 4 auto acknowledgment

Definition at line 62 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_4_DYNAMIC_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_PIPE_4_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE

enable pipe 4 dynamic payload

Definition at line 86 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_4_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_PIPE_4_PAYLOAD 32

32 bytes

Definition at line 80 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_5_AUTO_ACKNOWLEDGMENT

#define NRF24L01_BASIC_DEFAULT_PIPE_5_AUTO_ACKNOWLEDGMENT NRF24L01_BOOL_TRUE

enable pipe 5 auto acknowledgment

Definition at line 63 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_5_DYNAMIC_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_PIPE_5_DYNAMIC_PAYLOAD NRF24L01_BOOL_TRUE

enable pipe 5 dynamic payload

Definition at line 87 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_PIPE_5_PAYLOAD

#define NRF24L01_BASIC_DEFAULT_PIPE_5_PAYLOAD 32

32 bytes

Definition at line 81 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RETRANSMIT_COUNT

#define NRF24L01_BASIC_DEFAULT_RETRANSMIT_COUNT 10

10 times

Definition at line 72 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RETRANSMIT_DELAY

#define NRF24L01_BASIC_DEFAULT_RETRANSMIT_DELAY 750

750 us

Definition at line 71 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RX_ADDR_0

#define NRF24L01_BASIC_DEFAULT_RX_ADDR_0 {0x1A, 0x01, 0x02, 0x03, 0x00}

rx address 0

Definition at line 91 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RX_ADDR_1

#define NRF24L01_BASIC_DEFAULT_RX_ADDR_1 {0x1B, 0x01, 0x02, 0x03, 0x01}

rx address 1

Definition at line 92 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RX_ADDR_2

#define NRF24L01_BASIC_DEFAULT_RX_ADDR_2 {0x1B, 0x01, 0x02, 0x03, 0x02}

rx address 2

Definition at line 93 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RX_ADDR_3

#define NRF24L01_BASIC_DEFAULT_RX_ADDR_3 {0x1B, 0x01, 0x02, 0x03, 0x03}

rx address 3

Definition at line 94 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RX_ADDR_4

#define NRF24L01_BASIC_DEFAULT_RX_ADDR_4 {0x1B, 0x01, 0x02, 0x03, 0x04}

rx address 4

Definition at line 95 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RX_ADDR_5

#define NRF24L01_BASIC_DEFAULT_RX_ADDR_5 {0x1B, 0x01, 0x02, 0x03, 0x05}

rx address 5

Definition at line 96 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RX_PIPE_0

#define NRF24L01_BASIC_DEFAULT_RX_PIPE_0 NRF24L01_BOOL_TRUE

enable rx pipe 0

Definition at line 64 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RX_PIPE_1

#define NRF24L01_BASIC_DEFAULT_RX_PIPE_1 NRF24L01_BOOL_TRUE

enable rx pipe 1

Definition at line 65 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RX_PIPE_2

#define NRF24L01_BASIC_DEFAULT_RX_PIPE_2 NRF24L01_BOOL_TRUE

enable rx pipe 2

Definition at line 66 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RX_PIPE_3

#define NRF24L01_BASIC_DEFAULT_RX_PIPE_3 NRF24L01_BOOL_TRUE

enable rx pipe 3

Definition at line 67 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RX_PIPE_4

#define NRF24L01_BASIC_DEFAULT_RX_PIPE_4 NRF24L01_BOOL_TRUE

enable rx pipe 4

Definition at line 68 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_RX_PIPE_5

#define NRF24L01_BASIC_DEFAULT_RX_PIPE_5 NRF24L01_BOOL_TRUE

enable rx pipe 5

Definition at line 69 of file driver_nrf24l01_basic.h.

## ◆ NRF24L01_BASIC_DEFAULT_TX_PAYLOAD_WITH_NO_ACK

#define NRF24L01_BASIC_DEFAULT_TX_PAYLOAD_WITH_NO_ACK NRF24L01_BOOL_FALSE

disable tx payload with no ack

Definition at line 90 of file driver_nrf24l01_basic.h.

## Enumeration Type Documentation

## ◆ nrf24l01_type_t

enum nrf24l01_type_t

nrf24l01 type enumeration definition

Enumerator
NRF24L01_TYPE_TX | tx mode
NRF24L01_TYPE_RX | rx mode

Definition at line 101 of file driver_nrf24l01_basic.h.

## Function Documentation

## ◆ nrf24l01_basic_deinit()

uint8_t nrf24l01_basic_deinit | ( | void |  | ) |

basic example deinit

Returns
  status code
  - 0 success
  - 1 deinit failed

Note
  none

Definition at line 697 of file driver_nrf24l01_basic.c.

## ◆ nrf24l01_basic_init()

uint8_t nrf24l01_basic_init | ( | nrf24l01_type_t | type,
|  | void(*)(uint8_t type, uint8_t num, uint8_t *buf, uint8_t len) | callback
| ) |  |

basic example init

Parameters

  [in] | type | is the chip working mode
  [in] | *callback | points to a callback function

Returns
  status code
  - 0 success
  - 1 init failed

Note
  none

Definition at line 69 of file driver_nrf24l01_basic.c.

## ◆ nrf24l01_basic_send()

uint8_t nrf24l01_basic_send | ( | uint8_t * | addr,
|  | uint8_t * | buf,
|  | uint8_t | len
| ) |  |

basic example send

Parameters

  [in] | *addr | points to a address buffer
  [in] | *buf | points to a data buffer
  [in] | len | is the buffer length

Returns
  status code
  - 0 success
  - 1 send failed

Note
  none

Definition at line 719 of file driver_nrf24l01_basic.c.

## ◆ nrf24l01_interrupt_irq_handler()

uint8_t nrf24l01_interrupt_irq_handler | ( | void |  | ) |

nrf24l01 irq

Returns
  status code
  - 0 success
  - 1 run failed

Note
  none

Definition at line 48 of file driver_nrf24l01_basic.c.