uwb_dw1000_config.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Inria
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef UWB_DW1000_CONFIG_H
21 #define UWB_DW1000_CONFIG_H
22 
23 #include "dw1000/dw1000_regs.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
38 #ifndef DW1000_ROLE_DEFAULT
39 #define DW1000_ROLE_DEFAULT 0x0
40 #endif
41 
45 #ifndef DW1000_NSFD_DEFAULT
46 #define DW1000_NSFD_DEFAULT 8
47 #endif
48 
52 #ifndef DW1000_NSYNC_DEFAULT
53 #define DW1000_NSYNC_DEFAULT 128
54 #endif
55 
59 #ifndef DW1000_NPHR_DEFAULT
60 #define DW1000_NPHR_DEFAULT 21
61 #endif
62 
63 
67 #ifndef DW1000_CHANNEL_DEFAULT
68 #define DW1000_CHANNEL_DEFAULT 5
69 #if DW1000_CHANNEL_DEFAULT > 7 || DW1000_CHANNEL_DEFAULT < 1
70 #error "DW1000_CHANNEL_DEFAULT must be 1..7"
71 #endif
72 #endif
73 
77 #ifndef DW1000_TX_PGDELAY_DEFAULT
78 #if DW1000_CHANNEL_DEFAULT == 1
79 #define DW1000_TX_PGDELAY_DEFAULT TC_PGDELAY_CH1
80 #elif DW1000_CHANNEL_DEFAULT == 2
81 #define DW1000_TX_PGDELAY_DEFAULT TC_PGDELAY_CH2
82 #elif DW1000_CHANNEL_DEFAULT == 3
83 #define DW1000_TX_PGDELAY_DEFAULT TC_PGDELAY_CH3
84 #elif DW1000_CHANNEL_DEFAULT == 4
85 #define DW1000_TX_PGDELAY_DEFAULT TC_PGDELAY_CH4
86 #elif DW1000_CHANNEL_DEFAULT == 5
87 #define DW1000_TX_PGDELAY_DEFAULT TC_PGDELAY_CH5
88 #elif DW1000_CHANNEL_DEFAULT == 6
89 #define DW1000_TX_PGDELAY_DEFAULT TC_PGDELAY_CH7
90 #elif DW1000_CHANNEL_DEFAULT == 7
91 #define DW1000_TX_PGDELAY_DEFAULT TC_PGDELAY_CH7
92 #endif
93 #endif
94 
101 #ifndef DW1000_PRF_DEFAULT
102 #define DW1000_PRF_DEFAULT DWT_PRF_64M
103 #endif
104 
112 #ifndef DW1000_DATARATE_DEFAULT
113 #define DW1000_DATARATE_DEFAULT DWT_BR_6M8
114 #endif
115 
124 #ifndef DW1000_PACLEN_DEFAULT
125 #define DW1000_PACLEN_DEFAULT DWT_PAC8
126 #endif
127 
131 #ifndef DW1000_RX_PREAM_CIDX_DEFAULT
132 #define DW1000_RX_PREAM_CIDX_DEFAULT 9
133 #endif
134 
141 #ifndef DW1000_RX_SFD_TYPE_DEFAULT
142 #define DW1000_RX_SFD_TYPE_DEFAULT true
143 #endif
144 
149 #ifndef DW1000_RX_SFD_TO_DEFAULT
150 #define DW1000_RX_SFD_TO_DEFAULT (128 + 1 + 8 - 8) /* (preamble length + 1 + SFD length - PAC size) */
151 #endif
152 
159 #ifndef DW1000_RX_PHR_MODE_DEFAULT
160 #define DW1000_RX_PHR_MODE_DEFAULT DWT_PHRMODE_EXT
161 #endif
162 
166 #ifndef DW1000_RX_DIAGNOSTIC
167 #define DW1000_RX_DIAGNOSTIC 0
168 #endif
169 
170 
174 #ifndef DW1000_TX_PREAM_CIDX_DEAULT
175 #define DW1000_TX_PREAM_CIDX_DEAULT 9
176 #endif
177 
192 #ifndef DW1000_TX_PREAM_LEN_DEFAULT
193 #define DW1000_TX_PREAM_LEN_DEFAULT DWT_PLEN_128
194 #endif
195 
199 #ifndef DW1000_RX_ANTSEP_DEFAULT
200 #define DW1000_RX_ANTSEP_DEFAULT 0.0205
201 #endif
202 
206 #ifndef DW1000_FRAME_FILTER_DEFAULT
207 #define DW1000_FRAME_FILTER_DEFAULT 0x0000
208 #endif
209 
213 #ifndef DW1000_XTAL_TRIM_DEFAULT
214 #define DW1000_XTAL_TRIM_DEFAULT 0x10
215 #endif
216 
220 #ifndef DW1000_RX_STABLE_TIME_US
221 #define DW1000_RX_STABLE_TIME_US 6
222 #endif
223 
227 #define DW1000_TRXOFF_ENABLE 1
228 
232 #define DW1000_DOUBLE_BUFFER_ENABLE false
233 
237 #define DW1000_LDE_ENABLE true
238 
242 #define DW1000_LDO_ENABLE false
243 
247 #define DW1000_SLEEP_ENABLE true
248 
252 #define DW1000_WAKEUP_RX_ENABLE true
253 
257 #define DW1000_RX_AUTO_ENABLE true
258 
259 #ifdef __cplusplus
260 }
261 #endif
262 
263 #endif /* UWB_DW1000_CONFIG_H */