Statistics
| Branch: | Tag: | Revision:

mongoose / examples / nRF52 / http / config / nrf_drv_config.h @ eaef5bd1

History | View | Annotate | Download (9.54 KB)

1
/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
2
 *
3
 * The information contained herein is property of Nordic Semiconductor ASA.
4
 * Terms and conditions of usage are described in detail in NORDIC
5
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
6
 *
7
 * Licensees are granted free, non-transferable use of the information. NO
8
 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
9
 * the file.
10
 *
11
 */
12

    
13
#ifndef NRF_DRV_CONFIG_H
14
#define NRF_DRV_CONFIG_H
15

    
16
/* CLOCK */
17
#define CLOCK_CONFIG_XTAL_FREQ          NRF_CLOCK_XTALFREQ_Default
18
#define CLOCK_CONFIG_LF_SRC             NRF_CLOCK_LF_SRC_Xtal
19
#define CLOCK_CONFIG_LF_RC_CAL_INTERVAL RC_2000MS_CALIBRATION_INTERVAL
20
#define CLOCK_CONFIG_IRQ_PRIORITY       APP_IRQ_PRIORITY_LOW
21

    
22
/* GPIOTE */
23
#define GPIOTE_ENABLED 1
24

    
25
#if (GPIOTE_ENABLED == 1)
26
#define GPIOTE_CONFIG_USE_SWI_EGU false
27
#define GPIOTE_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
28
#define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 4
29
#endif
30

    
31
/* TIMER */
32
#define TIMER0_ENABLED 0
33

    
34
#if (TIMER0_ENABLED == 1)
35
#define TIMER0_CONFIG_FREQUENCY    NRF_TIMER_FREQ_16MHz
36
#define TIMER0_CONFIG_MODE         TIMER_MODE_MODE_Timer
37
#define TIMER0_CONFIG_BIT_WIDTH    TIMER_BITMODE_BITMODE_32Bit
38
#define TIMER0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
39

    
40
#define TIMER0_INSTANCE_INDEX      0
41
#endif
42

    
43
#define TIMER1_ENABLED 0
44

    
45
#if (TIMER1_ENABLED == 1)
46
#define TIMER1_CONFIG_FREQUENCY    NRF_TIMER_FREQ_16MHz
47
#define TIMER1_CONFIG_MODE         TIMER_MODE_MODE_Timer
48
#define TIMER1_CONFIG_BIT_WIDTH    TIMER_BITMODE_BITMODE_16Bit
49
#define TIMER1_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
50

    
51
#define TIMER1_INSTANCE_INDEX      (TIMER0_ENABLED)
52
#endif
53
 
54
#define TIMER2_ENABLED 0
55

    
56
#if (TIMER2_ENABLED == 1)
57
#define TIMER2_CONFIG_FREQUENCY    NRF_TIMER_FREQ_16MHz
58
#define TIMER2_CONFIG_MODE         TIMER_MODE_MODE_Timer
59
#define TIMER2_CONFIG_BIT_WIDTH    TIMER_BITMODE_BITMODE_16Bit
60
#define TIMER2_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
61

    
62
#define TIMER2_INSTANCE_INDEX      (TIMER1_ENABLED+TIMER0_ENABLED)
63
#endif
64

    
65
#define TIMER3_ENABLED 0
66

    
67
#if (TIMER3_ENABLED == 1)
68
#define TIMER3_CONFIG_FREQUENCY    NRF_TIMER_FREQ_16MHz
69
#define TIMER3_CONFIG_MODE         TIMER_MODE_MODE_Timer
70
#define TIMER3_CONFIG_BIT_WIDTH    TIMER_BITMODE_BITMODE_16Bit
71
#define TIMER3_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
72

    
73
#define TIMER3_INSTANCE_INDEX      (TIMER2_ENABLED+TIMER1_ENABLED+TIMER0_ENABLED)
74
#endif
75

    
76
#define TIMER4_ENABLED 0
77

    
78
#if (TIMER4_ENABLED == 1)
79
#define TIMER4_CONFIG_FREQUENCY    NRF_TIMER_FREQ_16MHz
80
#define TIMER4_CONFIG_MODE         TIMER_MODE_MODE_Timer
81
#define TIMER4_CONFIG_BIT_WIDTH    TIMER_BITMODE_BITMODE_16Bit
82
#define TIMER4_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
83

    
84
#define TIMER4_INSTANCE_INDEX      (TIMER3_ENABLED+TIMER2_ENABLED+TIMER1_ENABLED+TIMER0_ENABLED)
85
#endif
86

    
87

    
88
#define TIMER_COUNT (TIMER0_ENABLED + TIMER1_ENABLED + TIMER2_ENABLED + TIMER3_ENABLED + TIMER4_ENABLED)
89

    
90
/* RTC */
91
#define RTC0_ENABLED 0
92

    
93
#if (RTC0_ENABLED == 1)
94
#define RTC0_CONFIG_FREQUENCY    32678
95
#define RTC0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
96
#define RTC0_CONFIG_RELIABLE     false
97

    
98
#define RTC0_INSTANCE_INDEX      0
99
#endif
100

    
101
#define RTC1_ENABLED 0
102

    
103
#if (RTC1_ENABLED == 1)
104
#define RTC1_CONFIG_FREQUENCY    32768
105
#define RTC1_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
106
#define RTC1_CONFIG_RELIABLE     false
107

    
108
#define RTC1_INSTANCE_INDEX      (RTC0_ENABLED)
109
#endif
110

    
111
#define RTC_COUNT                (RTC0_ENABLED+RTC1_ENABLED)
112

    
113
#define NRF_MAXIMUM_LATENCY_US 2000
114

    
115
/* RNG */
116
#define RNG_ENABLED 0
117

    
118
#if (RNG_ENABLED == 1)
119
#define RNG_CONFIG_ERROR_CORRECTION true
120
#define RNG_CONFIG_POOL_SIZE        8
121
#define RNG_CONFIG_IRQ_PRIORITY     APP_IRQ_PRIORITY_LOW
122
#endif
123

    
124
/* SPI */
125
#define SPI0_ENABLED 0
126

    
127
#if (SPI0_ENABLED == 1)
128
#define SPI0_USE_EASY_DMA 0
129

    
130
#define SPI0_CONFIG_SCK_PIN         2
131
#define SPI0_CONFIG_MOSI_PIN        3
132
#define SPI0_CONFIG_MISO_PIN        4
133
#define SPI0_CONFIG_IRQ_PRIORITY    APP_IRQ_PRIORITY_LOW
134

    
135
#define SPI0_INSTANCE_INDEX 0
136
#endif
137

    
138
#define SPI1_ENABLED 0
139

    
140
#if (SPI1_ENABLED == 1)
141
#define SPI1_USE_EASY_DMA 0
142

    
143
#define SPI1_CONFIG_SCK_PIN         2
144
#define SPI1_CONFIG_MOSI_PIN        3
145
#define SPI1_CONFIG_MISO_PIN        4
146
#define SPI1_CONFIG_IRQ_PRIORITY    APP_IRQ_PRIORITY_LOW
147

    
148
#define SPI1_INSTANCE_INDEX (SPI0_ENABLED)
149
#endif
150

    
151
#define SPI2_ENABLED 0
152

    
153
#if (SPI2_ENABLED == 1)
154
#define SPI2_USE_EASY_DMA 0
155

    
156
#define SPI2_CONFIG_SCK_PIN         2
157
#define SPI2_CONFIG_MOSI_PIN        3
158
#define SPI2_CONFIG_MISO_PIN        4
159
#define SPI2_CONFIG_IRQ_PRIORITY    APP_IRQ_PRIORITY_LOW
160

    
161
#define SPI2_INSTANCE_INDEX (SPI0_ENABLED + SPI1_ENABLED)
162
#endif
163

    
164
#define SPI_COUNT   (SPI0_ENABLED + SPI1_ENABLED + SPI2_ENABLED)
165

    
166
/* SPIS */
167
#define SPIS0_ENABLED 0
168

    
169
#if (SPIS0_ENABLED == 1)
170
#define SPIS0_CONFIG_SCK_PIN         2
171
#define SPIS0_CONFIG_MOSI_PIN        3
172
#define SPIS0_CONFIG_MISO_PIN        4
173
#define SPIS0_CONFIG_IRQ_PRIORITY    APP_IRQ_PRIORITY_LOW
174

    
175
#define SPIS0_INSTANCE_INDEX 0
176
#endif
177

    
178
#define SPIS1_ENABLED 0
179

    
180
#if (SPIS1_ENABLED == 1)
181
#define SPIS1_CONFIG_SCK_PIN         2
182
#define SPIS1_CONFIG_MOSI_PIN        3
183
#define SPIS1_CONFIG_MISO_PIN        4
184
#define SPIS1_CONFIG_IRQ_PRIORITY    APP_IRQ_PRIORITY_LOW
185

    
186
#define SPIS1_INSTANCE_INDEX SPIS0_ENABLED
187
#endif
188

    
189
#define SPIS2_ENABLED 0
190

    
191
#if (SPIS2_ENABLED == 1)
192
#define SPIS2_CONFIG_SCK_PIN         2
193
#define SPIS2_CONFIG_MOSI_PIN        3
194
#define SPIS2_CONFIG_MISO_PIN        4
195
#define SPIS2_CONFIG_IRQ_PRIORITY    APP_IRQ_PRIORITY_LOW
196

    
197
#define SPIS2_INSTANCE_INDEX (SPIS0_ENABLED + SPIS1_ENABLED)
198
#endif
199

    
200
#define SPIS_COUNT   (SPIS0_ENABLED + SPIS1_ENABLED + SPIS2_ENABLED)
201

    
202
/* UART */
203
#define UART0_ENABLED 1
204

    
205
#if (UART0_ENABLED == 1)
206
#define UART0_CONFIG_HWFC         NRF_UART_HWFC_DISABLED
207
#define UART0_CONFIG_PARITY       NRF_UART_PARITY_EXCLUDED
208
#define UART0_CONFIG_BAUDRATE     NRF_UART_BAUDRATE_38400
209
#define UART0_CONFIG_PSEL_TXD 6
210
#define UART0_CONFIG_PSEL_RXD 8
211
#define UART0_CONFIG_PSEL_CTS 7
212
#define UART0_CONFIG_PSEL_RTS 5
213
#define UART0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
214
#ifdef NRF52
215
#define UART0_CONFIG_USE_EASY_DMA false
216
//Compile time flag
217
#define UART_EASY_DMA_SUPPORT     1
218
#define UART_LEGACY_SUPPORT       1
219
#endif //NRF52
220
#endif
221

    
222
#define TWI0_ENABLED 0
223

    
224
#if (TWI0_ENABLED == 1)
225
#define TWI0_CONFIG_FREQUENCY    NRF_TWI_FREQ_100K
226
#define TWI0_CONFIG_SCL          0
227
#define TWI0_CONFIG_SDA          1
228
#define TWI0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
229

    
230
#define TWI0_INSTANCE_INDEX      0
231
#endif
232

    
233
#define TWI1_ENABLED 0
234

    
235
#if (TWI1_ENABLED == 1)
236
#define TWI1_CONFIG_FREQUENCY    NRF_TWI_FREQ_100K
237
#define TWI1_CONFIG_SCL          0
238
#define TWI1_CONFIG_SDA          1
239
#define TWI1_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
240

    
241
#define TWI1_INSTANCE_INDEX      (TWI0_ENABLED)
242
#endif
243

    
244
#define TWI_COUNT                (TWI0_ENABLED+TWI1_ENABLED)
245

    
246
/* TWIS */
247
#define TWIS0_ENABLED 0
248

    
249
#if (TWIS0_ENABLED == 1)
250
    #define TWIS0_CONFIG_ADDR0        0
251
    #define TWIS0_CONFIG_ADDR1        0 /* 0: Disabled */
252
    #define TWIS0_CONFIG_SCL          0
253
    #define TWIS0_CONFIG_SDA          1
254
    #define TWIS0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
255

    
256
    #define TWIS0_INSTANCE_INDEX      0
257
#endif
258

    
259
#define TWIS1_ENABLED 0
260

    
261
#if (TWIS1_ENABLED ==  1)
262
    #define TWIS1_CONFIG_ADDR0        0
263
    #define TWIS1_CONFIG_ADDR1        0 /* 0: Disabled */
264
    #define TWIS1_CONFIG_SCL          0
265
    #define TWIS1_CONFIG_SDA          1
266
    #define TWIS1_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
267

    
268
    #define TWIS1_INSTANCE_INDEX      (TWIS0_ENABLED)
269
#endif
270

    
271
#define TWIS_COUNT (TWIS0_ENABLED + TWIS1_ENABLED)
272
/* For more documentation see nrf_drv_twis.h file */
273
#define TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0
274
/* For more documentation see nrf_drv_twis.h file */
275
#define TWIS_NO_SYNC_MODE 0
276
/**
277
 * @brief Definition for patching PAN problems
278
 *
279
 * Set this definition to nonzero value to patch anomalies
280
 * from MPW3 - first lunch microcontroller.
281
 *
282
 * Concerns:
283
 * - PAN-29: TWIS: incorrect bits in ERRORSRC
284
 * - PAN-30: TWIS: STOP task does not work as expected
285
 */
286
#define NRF_TWIS_PATCH_FOR_MPW3 1
287

    
288

    
289
/* QDEC */
290
#define QDEC_ENABLED 0
291

    
292
#if (QDEC_ENABLED == 1)
293
#define QDEC_CONFIG_REPORTPER    NRF_QDEC_REPORTPER_10
294
#define QDEC_CONFIG_SAMPLEPER    NRF_QDEC_SAMPLEPER_16384us
295
#define QDEC_CONFIG_PIO_A        1
296
#define QDEC_CONFIG_PIO_B        2
297
#define QDEC_CONFIG_PIO_LED      3
298
#define QDEC_CONFIG_LEDPRE       511
299
#define QDEC_CONFIG_LEDPOL       NRF_QDEC_LEPOL_ACTIVE_HIGH
300
#define QDEC_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
301
#define QDEC_CONFIG_DBFEN        false
302
#define QDEC_CONFIG_SAMPLE_INTEN false
303
#endif
304

    
305
/* SAADC */
306
#define SAADC_ENABLED 0
307

    
308
#if (SAADC_ENABLED == 1)
309
#define SAADC_CONFIG_RESOLUTION      NRF_SAADC_RESOLUTION_10BIT
310
#define SAADC_CONFIG_OVERSAMPLE      NRF_SAADC_OVERSAMPLE_DISABLED
311
#define SAADC_CONFIG_IRQ_PRIORITY    APP_IRQ_PRIORITY_LOW
312
#endif
313

    
314
/* LPCOMP */
315
#define LPCOMP_ENABLED 0
316

    
317
#if (LPCOMP_ENABLED == 1)
318
#define LPCOMP_CONFIG_REFERENCE    NRF_LPCOMP_REF_SUPPLY_4_8
319
#define LPCOMP_CONFIG_DETECTION    NRF_LPCOMP_DETECT_DOWN
320
#define LPCOMP_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
321
#define LPCOMP_CONFIG_INPUT        NRF_LPCOMP_INPUT_0
322
#endif
323

    
324
/* WDT */
325
#define WDT_ENABLED 0
326

    
327
#if (WDT_ENABLED == 1)
328
#define WDT_CONFIG_BEHAVIOUR     NRF_WDT_BEHAVIOUR_RUN_SLEEP
329
#define WDT_CONFIG_RELOAD_VALUE  2000
330
#define WDT_CONFIG_IRQ_PRIORITY  APP_IRQ_PRIORITY_HIGH
331
#endif
332

    
333
/* SWI EGU */
334
#ifdef NRF52
335
    #define EGU_ENABLED 0
336
#endif
337

    
338

    
339
#include "nrf_drv_config_validation.h"
340

    
341
#endif // NRF_DRV_CONFIG_H