-
Notifications
You must be signed in to change notification settings - Fork 27
/
sequences.h
540 lines (482 loc) · 25.8 KB
/
sequences.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
/*! \addtogroup AFE_Library AFE Library
* Author: Jean Rintoul , Mindseye Biomedical LLC Copyright 2018
*/
#ifndef __SEQUENCES_H__
#define __SEQUENCES_H__
//#include "afe.h"
/* C++ linkage */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/***************************************************************************/
/* Sequences */
/***************************************************************************/
// 2 wire measurement on AFE7 and AFE8
uint32_t seq_fast_2wire_bipolar[] = {
13 << 16 | 0x43,
/* RCAL */
0x86008811, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 8, TMUX_STATE = 8 */
0x00000640, /* Wait 100us */
0x80024EF0, /* AFE_CFG: WAVEGEN_EN = 1 */
0x00000C80, /* Wait 200us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE7-AFE8 */
0x86007788, /* DMUX_STATE = 8, PMUX_STATE = 8, NMUX_STATE = 7, TMUX_STATE = 7 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80020EF0, /* AFE_CFG: WAVEGEN_EN = 0, ADC_CONV_EN = 0, DFT_EN = 0 */
0x82000002, /* AFE_SEQ_CFG: SEQ_EN = 0 */
};
// AFE POWER UP
uint32_t seq_afe_poweritup_bipolar[] = {
19 << 16 | 0x43,
0x84005818, /* AFE_FIFO_CFG: DATA_FIFO_SOURCE_SEL = 10 */
0x8A000034, /* AFE_WG_CFG: TYPE_SEL = 10 */
0x98000000, /* AFE_WG_CFG: SINE_FCW = 0 (placeholder, user programmable) */
0x9E000000, /* AFE_WG_AMPLITUDE: SINE_AMPLITUDE = 0 (placeholder, user programmable) */
0x88000F01, /* AFE_DAC_CFG: DAC_ATTEN_EN = 1 */
0xA0000002, /* AFE_ADC_CFG: MUX_SEL = 00010, GAIN_OFFS_SEL = 00 */
/* RCAL */
0x86008811, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 8, TMUX_STATE = 8 */
0x00000640, /* Wait 100us */
0x80024EF0, /* AFE_CFG: WAVEGEN_EN = 1 */
0x00000C80, /* Wait 200us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE7-AFE8 */
0x86007788, /* DMUX_STATE = 8, PMUX_STATE = 8, NMUX_STATE = 7, TMUX_STATE = 7 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80020EF0, /* AFE_CFG: WAVEGEN_EN = 0, ADC_CONV_EN = 0, DFT_EN = 0 */
0x82000002, /* AFE_SEQ_CFG: SEQ_EN = 0 */
};
/*
* AFE powerup
*/
const uint32_t afe_powerup[] = {
0x000800FC, /* 0 - Safety Word, Command Count = 8, CRC = 0xFC */
0x80080010, /* 1 - AFE_CFG: ALDOILIMIT_EN = 1 ALDO_EN = 1 */
0x00007CFE, /* 2 - Wait: 2 ms */
0x80040030, /* 3 - AFE_CFG: REF_EN = 1 VREFBUFILIMIT_EN = 1 ALDOILIMIT_EN = 0 */
0x0004E1FE, /* 4 - Wait: 20 ms */
0x80020030, /* 5 - AFE_CFG: VREFBUFILIMIT_EN = 0 VBIASBUF_EN = 1 */
0x0001387E, /* 6 - Wait: 5 ms */
0x800200B0, /* 7 - AFE_CFG: ADC_EN = 1 */
0x82000002 /* 8 - AFE_SEQ_CFG: SEQ_EN = 0 */
};
/* Sequence for AC measurement, performs 4 DFTs: */
/* RCAL, AFE3-AFE4, AFE4-AFE5, AFE3-AFE5 */
uint32_t seq_afe_acmeas2wire[] = {
0x001D0043, /* Safety word: bits 31:16 = command count, bits 7:0 = CRC */
0x84005818, /* AFE_FIFO_CFG: DATA_FIFO_SOURCE_SEL = 10 */
0x8A000034, /* AFE_WG_CFG: TYPE_SEL = 10 */
0x98000000, /* AFE_WG_CFG: SINE_FCW = 0 (placeholder, user programmable) */
0x9E000000, /* AFE_WG_AMPLITUDE: SINE_AMPLITUDE = 0 (placeholder, user programmable) */
0x88000F01, /* AFE_DAC_CFG: DAC_ATTEN_EN = 1 */
0xA0000002, /* AFE_ADC_CFG: MUX_SEL = 00010, GAIN_OFFS_SEL = 00 */
/* RCAL */
0x86008811, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 8, TMUX_STATE = 8 */
0x00000640, /* Wait 100us */
0x80024EF0, /* AFE_CFG: WAVEGEN_EN = 1 */
0x00000C80, /* Wait 200us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE3 - AFE4 */
0x86003344, /* DMUX_STATE = 3, PMUX_STATE = 3, NMUX_STATE = 4, TMUX_STATE = 4 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE4 - AFE5 */
0x86004455, /* DMUX_STATE = 4, PMUX_STATE = 4, NMUX_STATE = 5, TMUX_STATE = 5 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE3 - AFE5 */
0x86003355, /* DMUX_STATE = 3, PMUX_STATE = 3, NMUX_STATE = 5, TMUX_STATE = 5 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80020EF0, /* AFE_CFG: WAVEGEN_EN = 0, ADC_CONV_EN = 0, DFT_EN = 0 */
0x82000002, /* AFE_SEQ_CFG: SEQ_EN = 0 */
};
/*
This uses the AFE, all 8 channels to move around doing difference measurements in a circle.
*/
uint32_t test_sequence1[] = {
49 << 16 | 0x43,
// 0x01260043, /* Safety word: bits 31:16 = command count, bits 7:0 = CRC */
// SAFEWORD CALCULATION:
// 14+ 35 = 49
// 14 elements that aren't the main loop(intro, RCAL, end sequence)
// 35 elements per AFE.
0x84005818, /* AFE_FIFO_CFG: DATA_FIFO_SOURCE_SEL = 10 */
0x8A000034, /* AFE_WG_CFG: TYPE_SEL = 10 */
0x98000000, /* AFE_WG_CFG: SINE_FCW = 0 (placeholder, user programmable) */
0x9E000000, /* AFE_WG_AMPLITUDE: SINE_AMPLITUDE = 0 (placeholder, user programmable) */
0x88000F01, /* AFE_DAC_CFG: DAC_ATTEN_EN = 1 */
0xA0000002, /* AFE_ADC_CFG: MUX_SEL = 00010, GAIN_OFFS_SEL = 00 */
/* RCAL */
0x86008811, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 8, TMUX_STATE = 8 */
0x00000640, /* Wait 100us */
0x80024EF0, /* AFE_CFG: WAVEGEN_EN = 1 */
0x00000C80, /* Wait 200us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
// DFT_RESULTS COUNT SHOULD BE 114 [7*2 for RE + IMG parts and then the RCAL added = 14+2 = 16.]
// one output, 7 inputs.
//
/* AFE1 - AFE2 */
0x86001122, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 2, TMUX_STATE = 2 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE1 - AFE3 */
0x86001133, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 3, TMUX_STATE = 3 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE1 - AFE4 */
0x86001144, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 4, TMUX_STATE = 4 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE1 - AFE5 */
0x86001155, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 5, TMUX_STATE = 5 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE1 - AFE6 */
0x86001166, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 6, TMUX_STATE = 6 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE1 - AFE7 */
0x86001177, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 7, TMUX_STATE = 7 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE1 - AFE8 */
0x86001188, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 8, TMUX_STATE = 8 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* sequence end. */
0x82000002, /* AFE_SEQ_CFG: SEQ_EN = 0 */
};
/*
This uses the AFE, all 8 channels to move around doing difference measurements in a circle.
*/
uint32_t seq_afe_mux1[] = {
154 << 16 | 0x43,
// 0x01260043, /* Safety word: bits 31:16 = command count, bits 7:0 = CRC */
// SAFEWORD CALCULATION:
// 14 elements that aren't the main loop(intro, RCAL, end sequence)
// 28 unique combinations of 8 electrodes.
// 28*5 + 14 = 42. Hex of 154
0x84005818, /* AFE_FIFO_CFG: DATA_FIFO_SOURCE_SEL = 10 */
0x8A000034, /* AFE_WG_CFG: TYPE_SEL = 10 */
0x98000000, /* AFE_WG_CFG: SINE_FCW = 0 (placeholder, user programmable) */
0x9E000000, /* AFE_WG_AMPLITUDE: SINE_AMPLITUDE = 0 (placeholder, user programmable) */
0x88000F01, /* AFE_DAC_CFG: DAC_ATTEN_EN = 1 */
0xA0000002, /* AFE_ADC_CFG: MUX_SEL = 00010, GAIN_OFFS_SEL = 00 */
/* RCAL */
0x86008811, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 8, TMUX_STATE = 8 */
0x00000640, /* Wait 100us */
0x80024EF0, /* AFE_CFG: WAVEGEN_EN = 1 */
0x00000C80, /* Wait 200us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
// DFT_RESULTS COUNT SHOULD BE (28+1) * 2(re+img) = 58
/* AFE1 - AFE2 */
0x86001122, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 2, TMUX_STATE = 2 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE1 - AFE3 */
0x86001133, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 3, TMUX_STATE = 3 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE1 - AFE4 */
0x86001144, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 4, TMUX_STATE = 4 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE1 - AFE5 */
0x86001155, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 5, TMUX_STATE = 5 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE1 - AFE6 */
0x86001166, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 6, TMUX_STATE = 6 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE1 - AFE7 */
0x86001177, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 7, TMUX_STATE = 7 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE1 - AFE8 */
0x86001188, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 8, TMUX_STATE = 8 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
//////
/* AFE2 - AFE3 */
0x86002233, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 2, TMUX_STATE = 2 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE2 - AFE4 */
0x86002244, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 3, TMUX_STATE = 3 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE2 - AFE5 */
0x86002255, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 4, TMUX_STATE = 4 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE2 - AFE6 */
0x86002266, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 5, TMUX_STATE = 5 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE2 - AFE7 */
0x86002277, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 6, TMUX_STATE = 6 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE2 - AFE8 */
0x86002288, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 7, TMUX_STATE = 7 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
//////
/* AFE3 - AFE4 */
0x86003344, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 3, TMUX_STATE = 3 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE3 - AFE5 */
0x86003355, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 4, TMUX_STATE = 4 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE3 - AFE6 */
0x86003366, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 5, TMUX_STATE = 5 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE3 - AFE7 */
0x86003377, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 6, TMUX_STATE = 6 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE3 - AFE8 */
0x86003388, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 7, TMUX_STATE = 7 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
//////
/* AFE4 - AFE5 */
0x86004455, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 4, TMUX_STATE = 4 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE4 - AFE6 */
0x86004466, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 5, TMUX_STATE = 5 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE4 - AFE7 */
0x86004477, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 6, TMUX_STATE = 6 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE4 - AFE8 */
0x86003388, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 7, TMUX_STATE = 7 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
//////
/* AFE5 - AFE6 */
0x86005566, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 5, TMUX_STATE = 5 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE5 - AFE7 */
0x86005577, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 6, TMUX_STATE = 6 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE5 - AFE8 */
0x86005588, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 7, TMUX_STATE = 7 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
//////
/* AFE6 - AFE7 */
0x86006677, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 6, TMUX_STATE = 6 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AFE6 - AFE8 */
0x86006688, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 7, TMUX_STATE = 7 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
//////
/* AFE7 - AFE8 */
0x86007788, /* DMUX_STATE = 1, PMUX_STATE = 1, NMUX_STATE = 7, TMUX_STATE = 7 */
0x00000640, /* Wait 100us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80024EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* sequence end. */
0x82000002, /* AFE_SEQ_CFG: SEQ_EN = 0 */
};
// with speed modification for tetrapolar measurement.
uint32_t seq_afe_poweritup[] = {
22 << 16 | 0x43,
0x84005818, /* AFE_FIFO_CFG: DATA_FIFO_SOURCE_SEL = 10 */
0x8A000034, /* AFE_WG_CFG: TYPE_SEL = 10 */
0x98000000, /* AFE_WG_CFG: SINE_FCW = 0 (placeholder, user programmable) */
0x9E000000, /* AFE_WG_AMPLITUDE: SINE_AMPLITUDE = 0 (placeholder, user programmable) */
0x88000F00, /* DAC_CFG: DAC_ATTEN_EN = 0 */
/* TIA */
0x86007788, /* DMUX_STATE = 8, PMUX_STATE = 8, NMUX_STATE = 7, TMUX_STATE = 7 */
0xA0000002, /* AFE_ADC_CFG: TIA, no bypass, offset and gain correction. */
0x0080E800, /* Wait 528ms. */
/* This is the worst case settling time: */
/* Rcm=10M, Ciso=22nF(20%tol) => settling time = 2*RC = 528 ms */
/* This settling time is only required the first time the switches are */
/* closed. */
0x80024EF0, /* AFE_CFG: WAVEGEN_EN = 1 */
0x00000C80, /* Wait 200us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms ( -148us to stop at midscale) */
0x80020EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AN_A */
0xA0000208, /* AFE_ADC_CFG: AN_A, Use GAIN and OFFSET AUX */
0x00000640, /* Wait 100us */
0x80024EF0, /* AFE_CFG: WAVEGEN_EN = 1 */
0x00000C80, /* Wait 200us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80020EF0, /* AFE_CFG: WAVEGEN_EN, ADC_CONV_EN = 0, DFT_EN = 0 */
0x86007788, /* DMUX_STATE = 0, PMUX_STATE = 0, NMUX_STATE = 0, TMUX_STATE = 0 */
0x82000002, /* AFE_SEQ_CFG: SEQ_EN = 0 */
};
uint32_t seq_afe_fast_meas_4wire[] = {
17 << 16 | 0x43,
/* TIA */
0x86007788, /* DMUX_STATE = 8, PMUX_STATE = 8, NMUX_STATE = 7, TMUX_STATE = 7 */
0xA0000002, /* AFE_ADC_CFG: TIA, no bypass, offset and gain correction. */
0x00000640, /* wait 100us */
//0x00027100, /* wait 10ms */
0x80024EF0, /* AFE_CFG: WAVEGEN_EN = 1 */
0x00000C80, /* Wait 200us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms ( -148us to stop at midscale) */
0x80020EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AN_A */
0xA0000208, /* AFE_ADC_CFG: AN_A, Use GAIN and OFFSET AUX */
0x00000640, /* Wait 100us */
0x80024EF0, /* AFE_CFG: WAVEGEN_EN = 1 */
0x00032340, /* Wait 13ms */
// 0x00000C80, /* Wait 200us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80020EF0, /* AFE_CFG: WAVEGEN_EN, ADC_CONV_EN = 0, DFT_EN = 0 */
0x86007788, /* DMUX_STATE = 0, PMUX_STATE = 0, NMUX_STATE = 0, TMUX_STATE = 0 */
0x82000002, /* AFE_SEQ_CFG: SEQ_EN = 0 */
};
/* using this on in BIS */
uint32_t seq_afe_fast_acmeasBioZ_4wire[] = {
0x0016001A, /* Safety word: bits 31:16 = command count, bits 7:0 = CRC */
0x84005818, /* AFE_FIFO_CFG: DATA_FIFO_SOURCE_SEL = 10 */
0x8A000034, /* AFE_WG_CFG: TYPE_SEL = 10 */
0x98000000, /* AFE_WG_CFG: SINE_FCW = 0 (placeholder, user programmable) */
0x9E000000, /* AFE_WG_AMPLITUDE: SINE_AMPLITUDE = 0 (placeholder, user programmable) */
0x88000F00, /* DAC_CFG: DAC_ATTEN_EN = 0 */
/* TIA */
0x86007788, /* DMUX_STATE = 8, PMUX_STATE = 8, NMUX_STATE = 7, TMUX_STATE = 7 */
0xA0000002, /* AFE_ADC_CFG: TIA, no bypass, offset and gain correction. */
// 0x00000640, /* wait 100us */
0x00003E80, /* 20 ms */
//0x0080E800, /* Wait 528ms. */
/* This is the worst case settling time: */
/* Rcm=10M, Ciso=22nF(20%tol) => settling time = 2*RC = 528 ms */
/* This settling time is only required the first time the switches are */
/* closed. */
0x80024EF0, /* AFE_CFG: WAVEGEN_EN = 1 */
0x00000C80, /* Wait 200us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms ( -148us to stop at midscale) */
0x80020EF0, /* AFE_CFG: ADC_CONV_EN = 0, DFT_EN = 0 */
/* AN_A */
0xA0000208, /* AFE_ADC_CFG: AN_A, Use GAIN and OFFSET AUX */
0x00000640, /* Wait 100us */
0x80024EF0, /* AFE_CFG: WAVEGEN_EN = 1 */
0x00000C80, /* Wait 200us */
0x8002CFF0, /* AFE_CFG: ADC_CONV_EN = 1, DFT_EN = 1 */
0x00032340, /* Wait 13ms */
0x80020EF0, /* AFE_CFG: WAVEGEN_EN, ADC_CONV_EN = 0, DFT_EN = 0 */
0x86007788, /* DMUX_STATE = 0, PMUX_STATE = 0, NMUX_STATE = 0, TMUX_STATE = 0 */
0x82000002, /* AFE_SEQ_CFG: SEQ_EN = 0 */
};
/* C++ linkage */
#ifdef __cplusplus
}
#endif
#endif /* include guard */
/*
** EOF
*/
/*@}*/