-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhw_adi.h
1182 lines (1170 loc) · 65.9 KB
/
hw_adi.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
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/******************************************************************************
* Filename: hw_adi.h
* Revised: 2015-01-13 16:59:55 +0100 (Tue, 13 Jan 2015)
* Revision: 42365
*
* Copyright (c) 2015 - 2017, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1) Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2) Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3) Neither the name of the ORGANIZATION nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
#ifndef __HW_ADI_H__
#define __HW_ADI_H__
//*****************************************************************************
//
// This file contains macros for controlling the ADI master and
// accessing ADI slave registers via the ADI Master.
// There are 3 categories of macros in this file:
// - macros that provide an offset to a register
// located within the DDI Master itself.
// - macros that define bits or bitfields
// within the DDI Master Registers.
// - macros that provide an "instruction offset"
// that are used when accessing a ADI Slave.
//
// The macros that that provide ADI Master register offsets and
// define bits and bitfields for those registers are the typical
// macros that appear in most hw_<module>.h header files. In
// the following example ADI_O_SLAVECONF is a macro for a
// register offset and ADI_SLAVECONF_WAITFORACK is a macro for
// a bit in that register. This example code will set the WAITFORACK
// bit in register ADI_O_SLAVECONF of the ADI Master. (Note: this
// access the Master not the Slave).
//
// HWREG(ADI3_BASE + ADI_O_SLAVECONF) |= ADI_SLAVECONF_WAITFORACK;
//
// The "instruction offset" macros are used to pass an instruction to
// the ADI Master when accessing ADI slave registers. These macros are
// only used when accessing ADI Slave Registers. (Remember ADI
// Master Registers are accessed normally).
//
// The instructions supported when accessing an ADI Slave Register follow:
// - Direct Access to an ADI Slave register. I.e. read or
// write the register.
// - Set the specified bits in a ADI Slave register.
// - Clear the specified bits in a ADI Slave register.
// - Mask write of 4 bits to the a ADI Slave register.
// - Mask write of 8 bits to the a ADI Slave register.
// - Mask write of 16 bits to the a ADI Slave register.
//
// Note: only the "Direct Access" offset should be used when reading
// a ADI Slave register. Only 4-bit reads are supported and 8 bits write are
// supported natively. If accessing wider bitfields, the read/write operation
// will be spread out over a number of transactions. This is hidden for the
// user, but can potentially be very timeconsuming. Especially of running
// on a slow clock.
//
// The generic format of using these macros for a read follows:
// // Read low 8-bits in ADI_SLAVE_OFF
// myushortvar = HWREGB(ADI_MASTER_BASE + ADI_SLAVE_OFF + ADI_O_DIR);
//
// // Read high 8-bits in ADI_SLAVE_OFF (data[31:16])
// myushortvar = HWREGB(ADI_MASTER_BASE + ADI_SLAVE_OFF + ADI_O_DIR);
//
// Notes: In the above example:
// - ADI_MASTER_BASE is the base address of the ADI Master defined
// in the hw_memmap.h header file.
// - ADI_SLAVE_OFF is the ADI Slave offset defined in the
// hw_<adi_slave>.h header file (e.g. hw_adi_3_refsys_top.h for the refsys
// module).
// - ADI_O_DIR is the "instruction offset" macro defined in this
// file that specifies the Direct Access instruction.
//
// Writes can use any of the "instruction macros".
// The following examples do a "direct write" to an ADI Slave register
// ADI_SLAVE_OFF using different size operands:
//
// // ---------- DIRECT WRITES ----------
// // Write 32-bits aligned
// HWREG(ADI_MASTER_BASE + ADI_SLAVE_OFF + ADI_O_DIR) = 0x12345678;
//
// // Write 16-bits aligned to high 16-bits then low 16-bits
// // Add 2 to get to high 16-bits.
// HWREGH(ADI_MASTER_BASE + ADI_SLAVE_OFF + ADI_O_DIR + 2) = 0xabcd;
// HWREGH(ADI_MASTER_BASE + ADI_SLAVE_OFF + ADI_O_DIR) = 0xef01;
//
// // Write each byte at ADI_SLAVE_OFF, one at a time.
// // Add 1,2,or 3 to get to bytes 1,2, or 3.
// HWREGB(ADI_MASTER_BASE + ADI_SLAVE_OFF + ADI_O_DIR) = 0x33;
// HWREGB(ADI_MASTER_BASE + ADI_SLAVE_OFF + ADI_O_DIR + 1) = 0x44;
// HWREGB(ADI_MASTER_BASE + ADI_SLAVE_OFF + ADI_O_DIR + 2) = 0x55;
// HWREGB(ADI_MASTER_BASE + ADI_SLAVE_OFF + ADI_O_DIR + 3) = 0x66;
//
// // ---------- SET/CLR ----------
// The set and clear functions behave similarly to eachother. Each
// can be performed on an 8-, 16-, or 32-bit operand.
// Examples follow:
// // Set all odd bits in a 32-bit words
// HWREG(ADI_MASTER_BASE + ADI_SLAVE_OFF + ADI_O_SET) = 0xaaaaaaaa;
//
// // Clear all bits in byte 2 (data[23:16]) using 32-bit operand
// HWREG(DDI_MASTER_BASE + ADI_SLAVE_OFF + ADI_O_CLR) = 0x00ff0000;
//
// // Set even bits in byte 2 (data[23:16]) using 8-bit operand
// HWREGB(ADI_MASTER_BASE + ADI_SLAVE_OFF + 2 + ADI_O_CLR) = 0x55;
//
// // ---------- MASKED WRITES ----------
// The mask writes are a bit different. They operate on nibbles,
// bytes, and 16-bit elements. Two operands are required; a 'mask'
// and 'data'; The operands are concatenated and written to the master.
// e.g. the mask and data are combined as follows for a 16 bit masked
// write:
// (mask << 16) | data;
// Examples follow:
//
// // Do an 4 bit masked write (Nibble) of 7 to data[3:0]).
// // Byte write is needed.
// HWREGB(ADI_MASTER_BASE + ADI_SLAVE_OFF + ADI_O_MASK4B01) = 0xf7;
//
// // Do an 4 bit masked write of 4 to data[7:4]).
// // Add 1 for next nibble
// HWREGB(DDI_MASTER_BASE + DDI_SLAVE_OFF + ADI_O_MASK4B01 + 1) = 0xf4;
//
//*****************************************************************************
//*****************************************************************************
//
// The following are defines for the ADI master instruction offsets.
//
//*****************************************************************************
#define ADI_O_DIR 0x00000000 // Offset for the direct access
// instruction
#define ADI_O_SET 0x00000010 // Offset for 'Set' instruction.
#define ADI_O_CLR 0x00000020 // Offset for 'Clear' instruction.
#define ADI_O_MASK4B 0x00000040 // Offset for 4-bit masked access.
// Data bit[n] is written if mask
// bit[n] is set ('1').
// Bits 7:4 are mask. Bits 3:0 are data.
// Requires 'byte' write.
#define ADI_O_MASK8B 0x00000060 // Offset for 8-bit masked access.
// Data bit[n] is written if mask
// bit[n] is set ('1'). Bits 15:8 are
// mask. Bits 7:0 are data. Requires
// 'short' write.
#define ADI_O_MASK16B 0x00000080 // Offset for 16-bit masked access.
// Data bit[n] is written if mask
// bit[n] is set ('1'). Bits 31:16
// are mask. Bits 15:0 are data.
// Requires 'long' write.
//*****************************************************************************
//
// The following are defines for the ADI register offsets.
//
//*****************************************************************************
#define ADI_O_SLAVESTAT 0x00000030 // ADI Slave status register
#define ADI_O_SLAVECONF 0x00000038 // ADI Master configuration
//*****************************************************************************
//
// The following are defines for the bit fields in the
// ADI_O_SLAVESTAT register.
//
//*****************************************************************************
#define ADI_SLAVESTAT_DI_REQ 0x00000002 // Read current value of DI_REQ
// signal. Writing 0 to this bit
// forces a sync with slave,
// ensuring that req will be 0. It
// is recommended to write 0 to
// this register before power down
// of the master.
#define ADI_SLAVESTAT_DI_REQ_M 0x00000002
#define ADI_SLAVESTAT_DI_REQ_S 1
#define ADI_SLAVESTAT_DI_ACK 0x00000001 // Read current value of DI_ACK
// signal
#define ADI_SLAVESTAT_DI_ACK_M 0x00000001
#define ADI_SLAVESTAT_DI_ACK_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the
// ADI_O_SLAVECONF register.
//
//*****************************************************************************
#define ADI_SLAVECONF_CONFLOCK 0x00000080 // This register is no longer
// accessible when this bit is set.
// (unless sticky_bit_overwrite is
// asserted on top module)
#define ADI_SLAVECONF_CONFLOCK_M \
0x00000080
#define ADI_SLAVECONF_CONFLOCK_S 7
#define ADI_SLAVECONF_WAITFORACK \
0x00000004 // A transaction on the ADI
// interface does not end until ack
// has been received from the slave
// when this bit is set.
#define ADI_SLAVECONF_WAITFORACK_M \
0x00000004
#define ADI_SLAVECONF_WAITFORACK_S 2
#define ADI_SLAVECONF_ADICLKSPEED_M \
0x00000003 // Sets the period of an ADI
// transactions. All transactions
// takes an even number of clock
// cycles,- ADI clock rising edge
// occurs in the middle of the
// period. Data and ctrl to slave
// is set up in beginning of cycle,
// and data from slave is read in
// after the transaction 00: An ADI
// transaction takes 2 master clock
// cyclkes 01: An ADI transaction
// takes 4 master clock cycles 10:
// And ADI Transaction takes 8
// master clock cycles 11: An ADI
// transaction takes 16 master
// clock cycles
#define ADI_SLAVECONF_ADICLKSPEED_S 0
//*****************************************************************************
//
// The following are defines pseudo-magic numbers that should go away.
// New code should not use these registers and old code should be ported
// to not use these.
//
//*****************************************************************************
#define ADI_O_DIR03 0x00000000 // Direct access for adi byte
// offsets 0 to 3
#define ADI_O_DIR47 0x00000004 // Direct access for adi byte
// offsets 4 to 7
#define ADI_O_DIR811 0x00000008 // Direct access for adi byte
// offsets 8 to 11
#define ADI_O_DIR1215 0x0000000C // Direct access for adi byte
// offsets 12 to 15
#define ADI_O_SET03 0x00000010 // Set register for ADI byte
// offsets 0 to 3
#define ADI_O_SET47 0x00000014 // Set register for ADI byte
// offsets 4 to 7
#define ADI_O_SET811 0x00000018 // Set register for ADI byte
// offsets 8 to 11
#define ADI_O_SET1215 0x0000001C // Set register for ADI byte
// offsets 12 to 15
#define ADI_O_CLR03 0x00000020 // Clear register for ADI byte
// offsets 0 to 3
#define ADI_O_CLR47 0x00000024 // Clear register for ADI byte
// offsets 4 to 7
#define ADI_O_CLR811 0x00000028 // Clear register for ADI byte
// offsets 8 to 11
#define ADI_O_CLR1215 0x0000002C // Clear register for ADI byte
// offsets 12 to 15
#define ADI_O_SLAVESTAT 0x00000030 // ADI Slave status register
#define ADI_O_SLAVECONF 0x00000038 // ADI Master configuration
// register
#define ADI_O_MASK4B01 0x00000040 // Masked access (4m/4d) for ADI
// Registers at byte offsets 0 and
// 1
#define ADI_O_MASK4B23 0x00000044 // Masked access (4m/4d) for ADI
// Registers at byte offsets 2 and
// 3
#define ADI_O_MASK4B45 0x00000048 // Masked access (4m/4d) for ADI
// Registers at byte offsets 4 and
// 5
#define ADI_O_MASK4B67 0x0000004C // Masked access (4m/4d) for ADI
// Registers at byte offsets 6 and
// 7
#define ADI_O_MASK4B89 0x00000050 // Masked access (4m/4d) for ADI
// Registers at byte offsets 8 and
// 9
#define ADI_O_MASK4B1011 0x00000054 // Masked access (4m/4d) for ADI
// Registers at byte offsets 10 and
// 11
#define ADI_O_MASK4B1213 0x00000058 // Masked access (4m/4d) for ADI
// Registers at byte offsets 12 and
// 13
#define ADI_O_MASK4B1415 0x0000005C // Masked access (4m/4d) for ADI
// Registers at byte offsets 14 and
// 15
#define ADI_O_MASK8B01 0x00000060 // Masked access (8m/8d) for ADI
// Registers at byte offsets 0 and
// 1
#define ADI_O_MASK8B23 0x00000064 // Masked access (8m/8d) for ADI
// Registers at byte offsets 2 and
// 3
#define ADI_O_MASK8B45 0x00000068 // Masked access (8m/8d) for ADI
// Registers at byte offsets 4 and
// 5
#define ADI_O_MASK8B67 0x0000006C // Masked access (8m/8d) for ADI
// Registers at byte offsets 6 and
// 7
#define ADI_O_MASK8B89 0x00000070 // Masked access (8m/8d) for ADI
// Registers at byte offsets 8 and
// 9
#define ADI_O_MASK8B1011 0x00000074 // Masked access (8m/8d) for ADI
// Registers at byte offsets 10 and
// 11
#define ADI_O_MASK8B1213 0x00000078 // Masked access (8m/8d) for ADI
// Registers at byte offsets 12 and
// 13
#define ADI_O_MASK8B1415 0x0000007C // Masked access (8m/8d) for ADI
// Registers at byte offsets 14 and
// 15
#define ADI_O_MASK16B01 0x00000080 // Masked access (16m/16d) for ADI
// Registers at byte offsets 0 and
// 1
#define ADI_O_MASK16B23 0x00000084 // Masked access (16m/16d) for ADI
// Registers at byte offsets 2 and
// 3
#define ADI_O_MASK16B45 0x00000088 // Masked access (16m/16d) for ADI
// Registers at byte offsets 4 and
// 5
#define ADI_O_MASK16B67 0x0000008C // Masked access (16m/16d) for ADI
// Registers at byte offsets 6 and
// 7
#define ADI_O_MASK16B89 0x00000090 // Masked access (16m/16d) for ADI
// Registers at byte offsets 8 and
// 9
#define ADI_O_MASK16B1011 0x00000094 // Masked access (16m/16d) for ADI
// Registers at byte offsets 10 and
// 11
#define ADI_O_MASK16B1213 0x00000098 // Masked access (16m/16d) for ADI
// Registers at byte offsets 12 and
// 13
#define ADI_O_MASK16B1415 0x0000009C // Masked access (16m/16d) for ADI
// Registers at byte offsets 14 and
// 15
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_DIR03 register.
//
//*****************************************************************************
#define ADI_DIR03_B3_M 0xFF000000 // Direct access to ADI register 3
#define ADI_DIR03_B3_S 24
#define ADI_DIR03_B2_M 0x00FF0000 // Direct access to ADI register 2
#define ADI_DIR03_B2_S 16
#define ADI_DIR03_B1_M 0x0000FF00 // Direct access to ADI register 1
#define ADI_DIR03_B1_S 8
#define ADI_DIR03_B0_M 0x000000FF // Direct access to ADI register 0
#define ADI_DIR03_B0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_DIR47 register.
//
//*****************************************************************************
#define ADI_DIR47_B3_M 0xFF000000 // Direct access to ADI register 7
#define ADI_DIR47_B3_S 24
#define ADI_DIR47_B2_M 0x00FF0000 // Direct access to ADI register 6
#define ADI_DIR47_B2_S 16
#define ADI_DIR47_B1_M 0x0000FF00 // Direct access to ADI register 5
#define ADI_DIR47_B1_S 8
#define ADI_DIR47_B0_M 0x000000FF // Direct access to ADI register 4
#define ADI_DIR47_B0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_DIR811 register.
//
//*****************************************************************************
#define ADI_DIR811_B3_M 0xFF000000 // Direct access to ADI register
// 11
#define ADI_DIR811_B3_S 24
#define ADI_DIR811_B2_M 0x00FF0000 // Direct access to ADI register
// 10
#define ADI_DIR811_B2_S 16
#define ADI_DIR811_B1_M 0x0000FF00 // Direct access to ADI register 9
#define ADI_DIR811_B1_S 8
#define ADI_DIR811_B0_M 0x000000FF // Direct access to ADI register 8
#define ADI_DIR811_B0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_DIR1215 register.
//
//*****************************************************************************
#define ADI_DIR1215_B3_M 0xFF000000 // Direct access to ADI register
// 15
#define ADI_DIR1215_B3_S 24
#define ADI_DIR1215_B2_M 0x00FF0000 // Direct access to ADI register
// 14
#define ADI_DIR1215_B2_S 16
#define ADI_DIR1215_B1_M 0x0000FF00 // Direct access to ADI register
// 13
#define ADI_DIR1215_B1_S 8
#define ADI_DIR1215_B0_M 0x000000FF // Direct access to ADI register
// 12
#define ADI_DIR1215_B0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_SET03 register.
//
//*****************************************************************************
#define ADI_SET03_S3_M 0xFF000000 // A high bit value will set the
// corresponding bit in ADI
// register 3. Read returns 0.
#define ADI_SET03_S3_S 24
#define ADI_SET03_S2_M 0x00FF0000 // A high bit value will set the
// corresponding bit in ADI
// register 2. Read returns 0.
#define ADI_SET03_S2_S 16
#define ADI_SET03_S1_M 0x0000FF00 // A high bit value will set the
// corresponding bit in ADI
// register 1. Read returns 0.
#define ADI_SET03_S1_S 8
#define ADI_SET03_S0_M 0x000000FF // A high bit value will set the
// corresponding bit in ADI
// register 0. Read returns 0.
#define ADI_SET03_S0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_SET47 register.
//
//*****************************************************************************
#define ADI_SET47_S3_M 0xFF000000 // A high bit value will set the
// corresponding bit in ADI
// register 7. Read returns 0.
#define ADI_SET47_S3_S 24
#define ADI_SET47_S2_M 0x00FF0000 // A high bit value will set the
// corresponding bit in ADI
// register 6. Read returns 0.
#define ADI_SET47_S2_S 16
#define ADI_SET47_S1_M 0x0000FF00 // A high bit value will set the
// corresponding bit in ADI
// register 5. Read returns 0.
#define ADI_SET47_S1_S 8
#define ADI_SET47_S0_M 0x000000FF // A high bit value will set the
// corresponding bit in ADI
// register 4. Read returns 0.
#define ADI_SET47_S0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_SET811 register.
//
//*****************************************************************************
#define ADI_SET811_S3_M 0xFF000000 // A high bit value will set the
// corresponding bit in ADI
// register 11. Read returns 0.
#define ADI_SET811_S3_S 24
#define ADI_SET811_S2_M 0x00FF0000 // A high bit value will set the
// corresponding bit in ADI
// register 10. Read returns 0.
#define ADI_SET811_S2_S 16
#define ADI_SET811_S1_M 0x0000FF00 // A high bit value will set the
// corresponding bit in ADI
// register 9. Read returns 0.
#define ADI_SET811_S1_S 8
#define ADI_SET811_S0_M 0x000000FF // A high bit value will set the
// corresponding bit in ADI
// register 8. Read returns 0.
#define ADI_SET811_S0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_SET1215 register.
//
//*****************************************************************************
#define ADI_SET1215_S3_M 0xFF000000 // A high bit value will set the
// corresponding bit in ADI
// register 15. Read returns 0.
#define ADI_SET1215_S3_S 24
#define ADI_SET1215_S2_M 0x00FF0000 // A high bit value will set the
// corresponding bit in ADI
// register 14. Read returns 0.
#define ADI_SET1215_S2_S 16
#define ADI_SET1215_S1_M 0x0000FF00 // A high bit value will set the
// corresponding bit in ADI
// register 13. Read returns 0.
#define ADI_SET1215_S1_S 8
#define ADI_SET1215_S0_M 0x000000FF // A high bit value will set the
// corresponding bit in ADI
// register 12. Read returns 0.
#define ADI_SET1215_S0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_CLR03 register.
//
//*****************************************************************************
#define ADI_CLR03_S3_M 0xFF000000 // A high bit value will clear the
// corresponding bit in ADI
// register 3
#define ADI_CLR03_S3_S 24
#define ADI_CLR03_S2_M 0x00FF0000 // A high bit value will clear the
// corresponding bit in ADI
// register 2
#define ADI_CLR03_S2_S 16
#define ADI_CLR03_S1_M 0x0000FF00 // A high bit value will clear the
// corresponding bit in ADI
// register 1
#define ADI_CLR03_S1_S 8
#define ADI_CLR03_S0_M 0x000000FF // A high bit value will clear the
// corresponding bit in ADI
// register 0
#define ADI_CLR03_S0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_CLR47 register.
//
//*****************************************************************************
#define ADI_CLR47_S3_M 0xFF000000 // A high bit value will clear the
// corresponding bit in ADI
// register 7
#define ADI_CLR47_S3_S 24
#define ADI_CLR47_S2_M 0x00FF0000 // A high bit value will clear the
// corresponding bit in ADI
// register 6
#define ADI_CLR47_S2_S 16
#define ADI_CLR47_S1_M 0x0000FF00 // A high bit value will clear the
// corresponding bit in ADI
// register 5
#define ADI_CLR47_S1_S 8
#define ADI_CLR47_S0_M 0x000000FF // A high bit value will clear the
// corresponding bit in ADI
// register 4
#define ADI_CLR47_S0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_CLR811 register.
//
//*****************************************************************************
#define ADI_CLR811_S3_M 0xFF000000 // A high bit value will clear the
// corresponding bit in ADI
// register 11
#define ADI_CLR811_S3_S 24
#define ADI_CLR811_S2_M 0x00FF0000 // A high bit value will clear the
// corresponding bit in ADI
// register 10
#define ADI_CLR811_S2_S 16
#define ADI_CLR811_S1_M 0x0000FF00 // A high bit value will clear the
// corresponding bit in ADI
// register 9
#define ADI_CLR811_S1_S 8
#define ADI_CLR811_S0_M 0x000000FF // A high bit value will clear the
// corresponding bit in ADI
// register 8
#define ADI_CLR811_S0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_CLR1215 register.
//
//*****************************************************************************
#define ADI_CLR1215_S3_M 0xFF000000 // A high bit value will clear the
// corresponding bit in ADI
// register 15
#define ADI_CLR1215_S3_S 24
#define ADI_CLR1215_S2_M 0x00FF0000 // A high bit value will clear the
// corresponding bit in ADI
// register 14
#define ADI_CLR1215_S2_S 16
#define ADI_CLR1215_S1_M 0x0000FF00 // A high bit value will clear the
// corresponding bit in ADI
// register 13
#define ADI_CLR1215_S1_S 8
#define ADI_CLR1215_S0_M 0x000000FF // A high bit value will clear the
// corresponding bit in ADI
// register 12
#define ADI_CLR1215_S0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the
// ADI_O_SLAVESTAT register.
//
//*****************************************************************************
#define ADI_SLAVESTAT_DI_REQ 0x00000002 // Read current value of DI_REQ
// signal. Writing 0 to this bit
// forces a sync with slave,
// ensuring that req will be 0. It
// is recommended to write 0 to
// this register before power down
// of the master.
#define ADI_SLAVESTAT_DI_REQ_M 0x00000002
#define ADI_SLAVESTAT_DI_REQ_S 1
#define ADI_SLAVESTAT_DI_ACK 0x00000001 // Read current value of DI_ACK
// signal
#define ADI_SLAVESTAT_DI_ACK_M 0x00000001
#define ADI_SLAVESTAT_DI_ACK_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the
// ADI_O_SLAVECONF register.
//
//*****************************************************************************
#define ADI_SLAVECONF_CONFLOCK 0x00000080 // This register is no longer
// accessible when this bit is set.
// (unless sticky_bit_overwrite is
// asserted on top module)
#define ADI_SLAVECONF_CONFLOCK_M \
0x00000080
#define ADI_SLAVECONF_CONFLOCK_S 7
#define ADI_SLAVECONF_WAITFORACK \
0x00000004 // A transaction on the ADI
// interface does not end until ack
// has been received from the slave
// when this bit is set.
#define ADI_SLAVECONF_WAITFORACK_M \
0x00000004
#define ADI_SLAVECONF_WAITFORACK_S 2
#define ADI_SLAVECONF_ADICLKSPEED_M \
0x00000003 // Sets the period of an ADI
// transactions. All transactions
// takes an even number of clock
// cycles,- ADI clock rising edge
// occurs in the middle of the
// period. Data and ctrl to slave
// is set up in beginning of cycle,
// and data from slave is read in
// after the transaction 00: An ADI
// transaction takes 2 master clock
// cyclkes 01: An ADI transaction
// takes 4 master clock cycles 10:
// And ADI Transaction takes 8
// master clock cycles 11: An ADI
// transaction takes 16 master
// clock cycles
#define ADI_SLAVECONF_ADICLKSPEED_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_MASK4B01 register.
//
//*****************************************************************************
#define ADI_MASK4B01_M1H_M 0xF0000000 // Mask for bits [7:4] in ADI
// register 1
#define ADI_MASK4B01_M1H_S 28
#define ADI_MASK4B01_D1H_M 0x0F000000 // Data for bits [7:4] in ADI
// register 1, - only bits selected
// by mask M1H will be affected by
// access
#define ADI_MASK4B01_D1H_S 24
#define ADI_MASK4B01_M1L_M 0x00F00000 // Mask for bits [3:0] in ADI
// register 1
#define ADI_MASK4B01_M1L_S 20
#define ADI_MASK4B01_D1L_M 0x000F0000 // Data for bits [3:0] in ADI
// register 1, - only bits selected
// by mask M1L will be affected by
// access
#define ADI_MASK4B01_D1L_S 16
#define ADI_MASK4B01_M0H_M 0x0000F000 // Mask for bits [7:4] in ADI
// register 0
#define ADI_MASK4B01_M0H_S 12
#define ADI_MASK4B01_D0H_M 0x00000F00 // Data for bits [7:4] in ADI
// register 0, - only bits selected
// by mask M0H will be affected by
// access
#define ADI_MASK4B01_D0H_S 8
#define ADI_MASK4B01_M0L_M 0x000000F0 // Mask for bits [3:0] in ADI
// register 0
#define ADI_MASK4B01_M0L_S 4
#define ADI_MASK4B01_D0L_M 0x0000000F // Data for bits [3:0] in ADI
// register 0, - only bits selected
// by mask M0L will be affected by
// access
#define ADI_MASK4B01_D0L_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_MASK4B23 register.
//
//*****************************************************************************
#define ADI_MASK4B23_M1H_M 0xF0000000 // Mask for bits [7:4] in ADI
// register 3
#define ADI_MASK4B23_M1H_S 28
#define ADI_MASK4B23_D1H_M 0x0F000000 // Data for bits [7:4] in ADI
// register 3, - only bits selected
// by mask M1H will be affected by
// access
#define ADI_MASK4B23_D1H_S 24
#define ADI_MASK4B23_M1L_M 0x00F00000 // Mask for bits [3:0] in ADI
// register 3
#define ADI_MASK4B23_M1L_S 20
#define ADI_MASK4B23_D1L_M 0x000F0000 // Data for bits [3:0] in ADI
// register 3, - only bits selected
// by mask M1L will be affected by
// access
#define ADI_MASK4B23_D1L_S 16
#define ADI_MASK4B23_M0H_M 0x0000F000 // Mask for bits [7:4] in ADI
// register 2
#define ADI_MASK4B23_M0H_S 12
#define ADI_MASK4B23_D0H_M 0x00000F00 // Data for bits [7:4] in ADI
// register 2, - only bits selected
// by mask M0H will be affected by
// access
#define ADI_MASK4B23_D0H_S 8
#define ADI_MASK4B23_M0L_M 0x000000F0 // Mask for bits [3:0] in ADI
// register 2
#define ADI_MASK4B23_M0L_S 4
#define ADI_MASK4B23_D0L_M 0x0000000F // Data for bits [3:0] in ADI
// register 2, - only bits selected
// by mask M0L will be affected by
// access
#define ADI_MASK4B23_D0L_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_MASK4B45 register.
//
//*****************************************************************************
#define ADI_MASK4B45_M1H_M 0xF0000000 // Mask for bits [7:4] in ADI
// register 5
#define ADI_MASK4B45_M1H_S 28
#define ADI_MASK4B45_D1H_M 0x0F000000 // Data for bits [7:4] in ADI
// register 5, - only bits selected
// by mask M1H will be affected by
// access
#define ADI_MASK4B45_D1H_S 24
#define ADI_MASK4B45_M1L_M 0x00F00000 // Mask for bits [3:0] in ADI
// register 5
#define ADI_MASK4B45_M1L_S 20
#define ADI_MASK4B45_D1L_M 0x000F0000 // Data for bits [3:0] in ADI
// register 5, - only bits selected
// by mask M1L will be affected by
// access
#define ADI_MASK4B45_D1L_S 16
#define ADI_MASK4B45_M0H_M 0x0000F000 // Mask for bits [7:4] in ADI
// register 4
#define ADI_MASK4B45_M0H_S 12
#define ADI_MASK4B45_D0H_M 0x00000F00 // Data for bits [7:4] in ADI
// register 4, - only bits selected
// by mask M0H will be affected by
// access
#define ADI_MASK4B45_D0H_S 8
#define ADI_MASK4B45_M0L_M 0x000000F0 // Mask for bits [3:0] in ADI
// register 4
#define ADI_MASK4B45_M0L_S 4
#define ADI_MASK4B45_D0L_M 0x0000000F // Data for bits [3:0] in ADI
// register 4, - only bits selected
// by mask M0L will be affected by
// access
#define ADI_MASK4B45_D0L_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_MASK4B67 register.
//
//*****************************************************************************
#define ADI_MASK4B67_M1H_M 0xF0000000 // Mask for bits [7:4] in ADI
// register 7
#define ADI_MASK4B67_M1H_S 28
#define ADI_MASK4B67_D1H_M 0x0F000000 // Data for bits [7:4] in ADI
// register 7, - only bits selected
// by mask M1H will be affected by
// access
#define ADI_MASK4B67_D1H_S 24
#define ADI_MASK4B67_M1L_M 0x00F00000 // Mask for bits [3:0] in ADI
// register 7
#define ADI_MASK4B67_M1L_S 20
#define ADI_MASK4B67_D1L_M 0x000F0000 // Data for bits [3:0] in ADI
// register 7, - only bits selected
// by mask M1L will be affected by
// access
#define ADI_MASK4B67_D1L_S 16
#define ADI_MASK4B67_M0H_M 0x0000F000 // Mask for bits [7:4] in ADI
// register 6
#define ADI_MASK4B67_M0H_S 12
#define ADI_MASK4B67_D0H_M 0x00000F00 // Data for bits [7:4] in ADI
// register 6, - only bits selected
// by mask M0H will be affected by
// access
#define ADI_MASK4B67_D0H_S 8
#define ADI_MASK4B67_M0L_M 0x000000F0 // Mask for bits [3:0] in ADI
// register 6
#define ADI_MASK4B67_M0L_S 4
#define ADI_MASK4B67_D0L_M 0x0000000F // Data for bits [3:0] in ADI
// register 6, - only bits selected
// by mask M0L will be affected by
// access
#define ADI_MASK4B67_D0L_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_MASK4B89 register.
//
//*****************************************************************************
#define ADI_MASK4B89_M1H_M 0xF0000000 // Mask for bits [7:4] in ADI
// register 9
#define ADI_MASK4B89_M1H_S 28
#define ADI_MASK4B89_D1H_M 0x0F000000 // Data for bits [7:4] in ADI
// register 9, - only bits selected
// by mask M1H will be affected by
// access
#define ADI_MASK4B89_D1H_S 24
#define ADI_MASK4B89_M1L_M 0x00F00000 // Mask for bits [3:0] in ADI
// register 9
#define ADI_MASK4B89_M1L_S 20
#define ADI_MASK4B89_D1L_M 0x000F0000 // Data for bits [3:0] in ADI
// register 9, - only bits selected
// by mask M1L will be affected by
// access
#define ADI_MASK4B89_D1L_S 16
#define ADI_MASK4B89_M0H_M 0x0000F000 // Mask for bits [7:4] in ADI
// register 8
#define ADI_MASK4B89_M0H_S 12
#define ADI_MASK4B89_D0H_M 0x00000F00 // Data for bits [7:4] in ADI
// register 8, - only bits selected
// by mask M0H will be affected by
// access
#define ADI_MASK4B89_D0H_S 8
#define ADI_MASK4B89_M0L_M 0x000000F0 // Mask for bits [3:0] in ADI
// register 8
#define ADI_MASK4B89_M0L_S 4
#define ADI_MASK4B89_D0L_M 0x0000000F // Data for bits [3:0] in ADI
// register 8, - only bits selected
// by mask M0L will be affected by
// access
#define ADI_MASK4B89_D0L_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the
// ADI_O_MASK4B1011 register.
//
//*****************************************************************************
#define ADI_MASK4B1011_M1H_M 0xF0000000 // Mask for bits [7:4] in ADI
// register 11
#define ADI_MASK4B1011_M1H_S 28
#define ADI_MASK4B1011_D1H_M 0x0F000000 // Data for bits [7:4] in ADI
// register 11, - only bits
// selected by mask M1H will be
// affected by access
#define ADI_MASK4B1011_D1H_S 24
#define ADI_MASK4B1011_M1L_M 0x00F00000 // Mask for bits [3:0] in ADI
// register 11
#define ADI_MASK4B1011_M1L_S 20
#define ADI_MASK4B1011_D1L_M 0x000F0000 // Data for bits [3:0] in ADI
// register 11, - only bits
// selected by mask M1L will be
// affected by access
#define ADI_MASK4B1011_D1L_S 16
#define ADI_MASK4B1011_M0H_M 0x0000F000 // Mask for bits [7:4] in ADI
// register 10
#define ADI_MASK4B1011_M0H_S 12
#define ADI_MASK4B1011_D0H_M 0x00000F00 // Data for bits [7:4] in ADI
// register 10, - only bits
// selected by mask M0H will be
// affected by access
#define ADI_MASK4B1011_D0H_S 8
#define ADI_MASK4B1011_M0L_M 0x000000F0 // Mask for bits [3:0] in ADI
// register 10
#define ADI_MASK4B1011_M0L_S 4
#define ADI_MASK4B1011_D0L_M 0x0000000F // Data for bits [3:0] in ADI
// register 10, - only bits
// selected by mask M0L will be
// affected by access
#define ADI_MASK4B1011_D0L_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the
// ADI_O_MASK4B1213 register.
//
//*****************************************************************************
#define ADI_MASK4B1213_M1H_M 0xF0000000 // Mask for bits [7:4] in ADI
// register 13
#define ADI_MASK4B1213_M1H_S 28
#define ADI_MASK4B1213_D1H_M 0x0F000000 // Data for bits [7:4] in ADI
// register 13, - only bits
// selected by mask M1H will be
// affected by access
#define ADI_MASK4B1213_D1H_S 24
#define ADI_MASK4B1213_M1L_M 0x00F00000 // Mask for bits [3:0] in ADI
// register 13
#define ADI_MASK4B1213_M1L_S 20
#define ADI_MASK4B1213_D1L_M 0x000F0000 // Data for bits [3:0] in ADI
// register 13, - only bits
// selected by mask M1L will be
// affected by access
#define ADI_MASK4B1213_D1L_S 16
#define ADI_MASK4B1213_M0H_M 0x0000F000 // Mask for bits [7:4] in ADI
// register 12
#define ADI_MASK4B1213_M0H_S 12
#define ADI_MASK4B1213_D0H_M 0x00000F00 // Data for bits [7:4] in ADI
// register 12, - only bits
// selected by mask M0H will be
// affected by access
#define ADI_MASK4B1213_D0H_S 8
#define ADI_MASK4B1213_M0L_M 0x000000F0 // Mask for bits [3:0] in ADI
// register 12
#define ADI_MASK4B1213_M0L_S 4
#define ADI_MASK4B1213_D0L_M 0x0000000F // Data for bits [3:0] in ADI
// register 12, - only bits
// selected by mask M0L will be
// affected by access
#define ADI_MASK4B1213_D0L_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the
// ADI_O_MASK4B1415 register.
//
//*****************************************************************************
#define ADI_MASK4B1415_M1H_M 0xF0000000 // Mask for bits [7:4] in ADI
// register 15
#define ADI_MASK4B1415_M1H_S 28
#define ADI_MASK4B1415_D1H_M 0x0F000000 // Data for bits [7:4] in ADI
// register 15, - only bits
// selected by mask M1H will be
// affected by access
#define ADI_MASK4B1415_D1H_S 24
#define ADI_MASK4B1415_M1L_M 0x00F00000 // Mask for bits [3:0] in ADI
// register 15
#define ADI_MASK4B1415_M1L_S 20
#define ADI_MASK4B1415_D1L_M 0x000F0000 // Data for bits [3:0] in ADI
// register 15, - only bits
// selected by mask M1L will be
// affected by access
#define ADI_MASK4B1415_D1L_S 16
#define ADI_MASK4B1415_M0H_M 0x0000F000 // Mask for bits [7:4] in ADI
// register 14
#define ADI_MASK4B1415_M0H_S 12
#define ADI_MASK4B1415_D0H_M 0x00000F00 // Data for bits [7:4] in ADI
// register 14, - only bits
// selected by mask M0H will be
// affected by access
#define ADI_MASK4B1415_D0H_S 8
#define ADI_MASK4B1415_M0L_M 0x000000F0 // Mask for bits [3:0] in ADI
// register 14
#define ADI_MASK4B1415_M0L_S 4
#define ADI_MASK4B1415_D0L_M 0x0000000F // Data for bits [3:0] in ADI
// register 14, - only bits
// selected by mask M0L will be
// affected by access
#define ADI_MASK4B1415_D0L_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_MASK8B01 register.
//
//*****************************************************************************
#define ADI_MASK8B01_M1_M 0xFF000000 // Mask for ADI register 1
#define ADI_MASK8B01_M1_S 24
#define ADI_MASK8B01_D1_M 0x00FF0000 // Data for ADI register 1, - only
// bits selected by mask M1 will be
// affected by access
#define ADI_MASK8B01_D1_S 16
#define ADI_MASK8B01_M0_M 0x0000FF00 // Mask for ADI register 0
#define ADI_MASK8B01_M0_S 8
#define ADI_MASK8B01_D0_M 0x000000FF // Data for ADI register 0, - only
// bits selected by mask M0 will be
// affected by access
#define ADI_MASK8B01_D0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_MASK8B23 register.
//
//*****************************************************************************
#define ADI_MASK8B23_M1_M 0xFF000000 // Mask for ADI register 3
#define ADI_MASK8B23_M1_S 24
#define ADI_MASK8B23_D1_M 0x00FF0000 // Data for ADI register 3, - only
// bits selected by mask M1 will be
// affected by access
#define ADI_MASK8B23_D1_S 16
#define ADI_MASK8B23_M0_M 0x0000FF00 // Mask for ADI register 2
#define ADI_MASK8B23_M0_S 8
#define ADI_MASK8B23_D0_M 0x000000FF // Data for ADI register 2, - only
// bits selected by mask M0 will be
// affected by access
#define ADI_MASK8B23_D0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_MASK8B45 register.
//
//*****************************************************************************
#define ADI_MASK8B45_M1_M 0xFF000000 // Mask for ADI register 5
#define ADI_MASK8B45_M1_S 24
#define ADI_MASK8B45_D1_M 0x00FF0000 // Data for ADI register 5, - only
// bits selected by mask M1 will be
// affected by access
#define ADI_MASK8B45_D1_S 16
#define ADI_MASK8B45_M0_M 0x0000FF00 // Mask for ADI register 4
#define ADI_MASK8B45_M0_S 8
#define ADI_MASK8B45_D0_M 0x000000FF // Data for ADI register 4, - only
// bits selected by mask M0 will be
// affected by access
#define ADI_MASK8B45_D0_S 0
//*****************************************************************************
//
// The following are defines for the bit fields in the ADI_O_MASK8B67 register.
//
//*****************************************************************************
#define ADI_MASK8B67_M1_M 0xFF000000 // Mask for ADI register 7
#define ADI_MASK8B67_M1_S 24
#define ADI_MASK8B67_D1_M 0x00FF0000 // Data for ADI register 7, - only
// bits selected by mask M1 will be
// affected by access
#define ADI_MASK8B67_D1_S 16
#define ADI_MASK8B67_M0_M 0x0000FF00 // Mask for ADI register 6