FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
nrf24l01p_internals.h
1// Important copyright notice:
2// Large parts of this file were copied from Mikael Patel's Cosa library, which copyright appears below
3// Content has been adapted to use FastArduino original parts, under Copyright (c) 2016, Jean-Francois Poilpret
4
5/*
6 * Copyright (C) 2013-2015, Mikael Patel
7 * Copyright (C) 2016-2022, Jean-Francois Poilpret
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * This file was originally part of the Arduino Che Cosa project,
20 * it has been adapted and refactored to FastArduino library.
21 */
22
24#ifndef NRF24L01_INTERNALS_HH
25#define NRF24L01_INTERNALS_HH
26
27#include <stddef.h>
28
29namespace devices::rf::nrf24l01p_internals
30{
34 const uint8_t MASK_RX_DR = 6;
35 const uint8_t MASK_TX_DS = 5;
36 const uint8_t MASK_MAX_RT = 4;
37 const uint8_t EN_CRC = 3;
38 const uint8_t CRCO = 2;
39 const uint8_t PWR_UP = 1;
40 const uint8_t PRIM_RX = 0;
41
45 const uint8_t ENAA_P5 = 5;
46 const uint8_t ENAA_P4 = 4;
47 const uint8_t ENAA_P3 = 3;
48 const uint8_t ENAA_P2 = 2;
49 const uint8_t ENAA_P1 = 1;
50 const uint8_t ENAA_P0 = 0;
51 const uint8_t ENAA_PA = 0x3f;
52
56 const uint8_t ERX_P5 = 5;
57 const uint8_t ERX_P4 = 4;
58 const uint8_t ERX_P3 = 3;
59 const uint8_t ERX_P2 = 2;
60 const uint8_t ERX_P1 = 1;
61 const uint8_t ERX_P0 = 0;
62 const uint8_t ERX_PA = 0x3f;
63
67 const uint8_t AW = 0;
68 const uint8_t AW_3BYTES = 1;
69 const uint8_t AW_4BYTES = 2;
70 const uint8_t AW_5BYTES = 3;
71
75 const uint8_t ARD = 4;
77 const uint8_t ARC = 0;
79
80 const uint8_t DEFAULT_ARC = 15;
81 const uint8_t DEFAULT_ARD = 1;
82
86 const uint8_t CONT_WAVE = 7;
87 const uint8_t RF_DR_LOW = 5;
88 const uint8_t PLL_LOCK_SIGNAL = 4;
89 const uint8_t RF_DR_HIGH = 3;
90 const uint8_t RF_PWR = 1;
91
95 const uint8_t RF_DR_1MBPS = 0;
96 const uint8_t RF_DR_2MBPS = bits::BV8(RF_DR_HIGH);
97 const uint8_t RF_DR_250KBPS = bits::BV8(RF_DR_LOW);
98
102 const uint8_t RF_PWR_18DBM = 0;
103 const uint8_t RF_PWR_12DBM = 2;
104 const uint8_t RF_PWR_6DBM = 4;
105 const uint8_t RF_PWR_0DBM = 6;
106
110 const uint8_t RX_DR = 6;
111 const uint8_t TX_DS = 5;
112 const uint8_t MAX_RT = 4;
113 const uint8_t RX_P_NO = 1;
114 const uint8_t RX_P_NO_MASK = 0x0e;
115 const uint8_t RX_P_NO_NONE = 0x07;
116 const uint8_t TX_FIFO_FULL = 0;
117
121 const uint8_t PLOS_CNT = 4;
122 const uint8_t ARC_CNT = 0;
123
127 const uint8_t TX_REUSE = 6;
128 const uint8_t TX_FULL = 5;
129 const uint8_t TX_EMPTY = 4;
130 const uint8_t RX_FULL = 1;
131 const uint8_t RX_EMPTY = 0;
132
136 const uint8_t DPL_P5 = 5;
137 const uint8_t DPL_P4 = 4;
138 const uint8_t DPL_P3 = 3;
139 const uint8_t DPL_P2 = 2;
140 const uint8_t DPL_P1 = 1;
141 const uint8_t DPL_P0 = 0;
142 const uint8_t DPL_PA = 0x3f;
143
147 const uint8_t EN_DPL = 2;
148 const uint8_t EN_ACK_PAY = 1;
149 const uint8_t EN_DYN_ACK = 0;
150
154 const uint16_t Tpd2stby_ms = 3;
155 const uint16_t Tstby2a_us = 130;
156 const uint16_t Thce_us = 10;
157
161 const uint8_t AW_MAX = 5;
162 const uint8_t PIPE_MAX = 6;
163}
164#endif /* NRF24L01_INTERNALS_HH */
static constexpr uint8_t BV8(uint8_t bit)
Create a uint8_t bitmask for the given bit number.
Definition: bits.h:41