roneos
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs Groups
hal_nrf_reg.h
Go to the documentation of this file.
1 /* Copyright (c) 2006 Nordic Semiconductor. All Rights Reserved.
2  *
3  * The information contained herein is confidential property of Nordic Semiconductor. The use,
4  * copying, transfer or disclosure of such information is prohibited except by express written
5  * agreement with Nordic Semiconductor.
6  *
7  * $Rev: 1731 $
8  *
9  */
10 
20 #ifndef HAL_NRF_REG_H__
21 #define HAL_NRF_REG_H__
22 
23 
26 /* nRF24L01 Instruction Definitions */
27 #define NRF_R_REGISTER 0x00
28 #define NRF_W_REGISTER 0x20
29 #define REGISTER_MASK 0x1F
30 #define NRF_R_RX_PAYLOAD 0x61
31 #define NRF_W_TX_PAYLOAD 0xA0
32 #define NRF_FLUSH_TX 0xE1
33 #define NRF_FLUSH_RX 0xE2
34 #define NRF_REUSE_TX_PL 0xE3
35 #define NRF_R_RX_PAYLOAD_WID 0x60
36 #define NRF_W_ACK_PAYLOAD 0xA8
37 #define NRF_W_TX_PAYLOAD_NOACK 0xB0
38 #define NRF_NOP 0xFF
39 #define NRF_LOCK_UNLOCK 0x50
41 
42 
45 /* nRF24L01 * Register Definitions * */
46 #define NRF_CONFIG 0x00
47 #define NRF_EN_AA 0x01
48 #define NRF_EN_RXADDR 0x02
49 #define NRF_SETUP_AW 0x03
50 #define NRF_SETUP_RETR 0x04
51 #define NRF_RF_CH 0x05
52 #define NRF_RF_SETUP 0x06
53 #define NRF_STATUS 0x07
54 #define NRF_OBSERVE_TX 0x08
55 #define NRF_RPD 0x09
56 #define NRF_RX_ADDR_P0 0x0A
57 #define NRF_RX_ADDR_P1 0x0B
58 #define NRF_RX_ADDR_P2 0x0C
59 #define NRF_RX_ADDR_P3 0x0D
60 #define NRF_RX_ADDR_P4 0x0E
61 #define NRF_RX_ADDR_P5 0x0F
62 #define NRF_TX_ADDR 0x10
63 #define NRF_RX_PW_P0 0x11
64 #define NRF_RX_PW_P1 0x12
65 #define NRF_RX_PW_P2 0x13
66 #define NRF_RX_PW_P3 0x14
67 #define NRF_RX_PW_P4 0x15
68 #define NRF_RX_PW_P5 0x16
69 #define NRF_FIFO_STATUS 0x17
70 #define NRF_DYNPD 0x1C
71 #define NRF_FEATURE 0x1D
74 
75 
77 //#define MASK_RX_DR 6
78 //#define MASK_TX_DS 5
79 //#define MASK_MAX_RT 4
80 //#define EN_CRC 3
81 //#define CRCO 2
82 //#define PWR_UP 1
83 //#define PRIM_RX 0
84 //#define ENAA_P5 5
85 //#define ENAA_P4 4
86 //#define ENAA_P3 3
87 //#define ENAA_P2 2
88 //#define ENAA_P1 1
89 //#define ENAA_P0 0
90 //#define ERX_P5 5
91 //#define ERX_P4 4
92 //#define ERX_P3 3
93 //#define ERX_P2 2
94 //#define ERX_P1 1
95 //#define ERX_P0 0
96 //#define AW 0
97 //#define ARD 4
98 //#define ARC 0
99 //#define PLL_LOCK 4
100 //#define RF_DR 3
101 //#define RF_PWR 1
102 //#define LNA_HCURR 0
103 //#define RX_DR 6
104 //#define TX_DS 5
105 //#define MAX_RT 4
106 //#define RX_P_NO 1
107 //#define TX_FULL 0
108 //#define PLOS_CNT 4
109 //#define ARC_CNT 0
110 //#define TX_REUSE 6
111 //#define FIFO_FULL 5
112 //#define TX_EMPTY 4
113 //#define RX_FULL 1
114 //#define RX_EMPTY 0
115 
116 
119 
120 #define NRF_CONFIG_MASK_RX_DR 6
121 #define NRF_CONFIG_MASK_TX_DS 5
122 #define NRF_CONFIG_MASK_MAX_RT 4
123 #define NRF_CONFIG_EN_CRC 3
124 #define NRF_CONFIG_CRCO 2
125 #define NRF_CONFIG_PWR_UP 1
126 #define NRF_CONFIG_PRIM_RX 0
128 
129 
131 #define NRF_SETUP_PLL_LOCK 4
132 #define NRF_SETUP_RF_DR 3
133 #define NRF_SETUP_RF_PWR1 2
134 #define NRF_SETUP_RF_PWR0 1
135 #define NRF_SETUP_LNA_HCURR 0
137 
138 /* STATUS 0x07 */
141 #define NRF_STATUS_RX_DR 6
142 #define NRF_STATUS_TX_DS 5
143 #define NRF_STATUS_MAX_RT 4
144 #define NRF_STATUS_TX_FULL 0
146 
147 /* FIFO_STATUS 0x17 */
150 #define NRF_FIFOSTATUS_TX_REUSE 6
151 #define NRF_FIFOSTATUS_TX_FIFO_FULL 5
152 #define NRF_FIFOSTATUS_TX_EMPTY 4
153 #define NRF_FIFOSTATUS_RX_FULL 1
154 #define NRF_FIFOSTATUS_RX_EMPTY 0
156 
157 #define NRF_ENAA_ENAA_P5 5
158 #define NRF_ENAA_ENAA_P4 4
159 #define NRF_ENAA_ENAA_P3 3
160 #define NRF_ENAA_ENAA_P2 2
161 #define NRF_ENAA_ENAA_P1 1
162 #define NRF_ENAA_ENAA_P0 0
164 #define NRF_DYNPD_DPL_P5 5
165 #define NRF_DYNPD_DPL_P4 4
166 #define NRF_DYNPD_DPL_P3 3
167 #define NRF_DYNPD_DPL_P2 2
168 #define NRF_DYNPD_DPL_P1 1
169 #define NRF_DYNPD_DPL_P0 0
171 #define NRF_FEATURE_EN_DPL 2
172 #define NRF_FEATURE_EN_ACK_PAY 1
173 #define NRF_FEATURE_EN_DYN_ACK 0
176 #endif // HAL_NRF_REG_H__
177