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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
|
/******************************************************************************
TORNADO AMC modules Software Development Kit (SDK). Rev 3B.
(C) MicroLAB Systems, 2014-2017
File: TORNADO AMC SDK functions for DSP environment declarations
-----
Notes:
------
1. This C-header file contains TORNADO AMC modules SDK functions
for DSP environment declarations and is an include file for
TI C6xxx C/C++ Code Generation Tools, which must be invoked to compile
for TORNADO AMC platform.
2. This file is best viewed with the TAB setting set to '4'.
******************************************************************************/
/**
* @file TA66XX_DSP_BC_FUNCTIONS.hxx
*
* @brief Board control (BC) SDK functions declarations
*
* This file contains declarations of TORNADO AMC modules SDK functions for
* board control
*
*/
#ifndef __TA66XX_DSP_BC_FUNCTIONS_HXX__ // check for this file has been already included
#define __TA66XX_DSP_BC_FUNCTIONS_HXX__ 1
#ifdef __cplusplus
extern "C" {
#endif
//=============================================================================
//============ DSP environment functions ======================================
//=============================================================================
/** @addtogroup TA66XX_BC_INIT TORNADO AMC DSP environment init functions
* @{
*/
/** Default DSP interrupt vector for DSP I2C interrupt */
#define TA66XX_BC_I2C_INTERRUPT_NUMBER_USED 4
/*------------ TA66XX_BC_set_i2c_interrupt_number() function -------------*//**
* @brief Function should be called before calling TA66XX_BC_init() function
* and is used to select DSP interrupt vector number for DSP I2C interrupt.
*
* @param[in] dsp_vector_id - DSP interrupt vector number, which will be used
* for DSP I2C interrupt.
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_set_i2c_interrupt_number(uint32_t dsp_vector_id);
/*------------ TA66XX_BC_get_i2c_interrupt_number() function -------------*//**
* @brief Function returns current DSP interrupt vector number for DSP I2C
* interrupt.
*
* @return DSP interrupt vector number, which is used for DSP I2C interrupt.
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_i2c_interrupt_number(void);
/** Default DSP interrupt vector for DSP UART interrupt */
#define TA66XX_BC_UART_INTERRUPT_NUMBER_USED 5
/*------------ TA66XX_BC_set_uart_interrupt_number() function ------------*//**
* @brief Function should be called before calling TA66XX_BC_init() function
* and is used to select DSP interrupt vector number for DSP UART interrupt.
*
* @param[in] dsp_vector_id - DSP interrupt vector number, which will be used
* for DSP UART interrupt.
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_set_uart_interrupt_number(uint32_t dsp_vector_id);
/*------------ TA66XX_BC_get_uart_interrupt_number() function ------------*//**
* @brief Function returns current DSP interrupt vector number for DSP UART
* interrupt.
*
* @return DSP interrupt vector number, which is used for DSP UART interrupt.
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_uart_interrupt_number(void);
/*------------ TA66XX_BC_init() function ---------------------------------*//**
* @brief Function performs initialization of TORNADO AMC modules
* DSP environment in accordance with board type
*
* The function does the following:
* 1. DSP on-chip caches are configured by default: L1P and L1D caches are
* enabled and set to max available size, L2 cache is disabled so L2 memory
* acts as SRAM.
* 2. DSP main PLL, DDR3 PLL and PASS PLL are configured by default: DSP core
* clock is set to TA66XX_BC_DSP_CORE_SPEED_VALUE, DDR3 and PASS controllers
* to default values
* 3. DDR3 memory is configured and ready to use
* 4. All DSP power domains are enabled
* 5. DSP EMIF-16 bus is configured.
* 6. In case external 1GE interface is installed then DSP SGMII port is
* initialized.
* 7. DSP GPIO pins are configured as outputs and cleared.
* 8. DSP LEDs are enabled.
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_init(void);
/*------------ TA66XX_BC_get_ddr_area_base_addr() function ---------------*//**
* @brief Function returns DDR3 area base address
*
* @return DDR3 area base address
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_ddr_area_base_addr(void);
/*------------ TA66XX_BC_get_ddr_area_length() function ------------------*//**
* @brief Function returns DDR3 area length in bytes
*
* @return DDR3 area length in bytes
*
-----------------------------------------------------------------------------*/
uint64_t TA66XX_BC_get_ddr_area_length(void);
//-----------------------------------------------------------------------------
// These functions are used to map either lower 2 GB DDR3 page or high 2 GB
// DDR3 page of 4GB DDR3 memory area to DSP 32-bit logical memory map.
/** The lower 2GB DDR3 memory page */
#define TA66XX_BC_DDR3_MEM_PAGE0 0
/** The high 2GB DDR3 memory page */
#define TA66XX_BC_DDR3_MEM_PAGE1 1
//-----------------------------------------------------------------------------
/*------------ TA66XX_BC_set_ddr_area_page() function --------------------*//**
* @brief Function sets the specified 2 GB DDR3 memory page (0 or 1) to be
* mapped to DSP 32-bit logical memory map.
*
* This function should be used only in case of 4 GB and more DDR3 memory is
* installed otherwise it does nothing.
*
* @param[in] page - 2 GB DDR3 memory page (0 or 1);
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_set_ddr_area_page(uint32_t page);
/*------------ TA66XX_BC_get_ddr_area_page() function --------------------*//**
* @brief Function returns current selected 2 GB DDR3 memory page (0 or 1)
* which is mapped to DSP 32-bit logical memory map.
*
* @return Current selected 2 GB DDR3 memory page (0 or 1)
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_ddr_area_page(void);
/** @}*/
//=============================================================================
//=============================================================================
//============ DSP LED functions ==============================================
//=============================================================================
/** @addtogroup TA66XX_BC_DSP_LED TORNADO AMC DSP LED functions
* @{
*/
/** DSP LED definitions */
enum TA66XX_BC_DSP_LEDS
{
TA66XX_BC_DSP_LED0 = 0, /**< DSP LED-0 */
TA66XX_BC_DSP_LED1, /**< DSP LED-1 */
TA66XX_BC_DSP_LED2, /**< DSP LED-2 */
TA66XX_BC_DSP_LED3, /**< DSP LED-3 */
TA66XX_BC_DSP_LED4, /**< DSP LED-4 */
TA66XX_BC_DSP_LED5, /**< DSP LED-5 */
TA66XX_BC_DSP_LED6, /**< DSP LED-6 */
TA66XX_BC_DSP_LED7 /**< DSP LED-7 */
};
/** DSP LED bitmask definitions */
enum TA66XX_BC_DSP_LED_BITMASKS
{
TA66XX_BC_DSP_LED0_BITMASK = 0x0001, /**< DSP LED-0 bitmask */
TA66XX_BC_DSP_LED1_BITMASK = 0x0002, /**< DSP LED-1 bitmask */
TA66XX_BC_DSP_LED2_BITMASK = 0x0004, /**< DSP LED-2 bitmask */
TA66XX_BC_DSP_LED3_BITMASK = 0x0008, /**< DSP LED-3 bitmask */
TA66XX_BC_DSP_LED4_BITMASK = 0x0010, /**< DSP LED-4 bitmask */
TA66XX_BC_DSP_LED5_BITMASK = 0x0020, /**< DSP LED-5 bitmask */
TA66XX_BC_DSP_LED6_BITMASK = 0x0040, /**< DSP LED-6 bitmask */
TA66XX_BC_DSP_LED7_BITMASK = 0x0080, /**< DSP LED-7 bitmask */
TA66XX_BC_DSP_LEDS_BITMASK = 0x00ff /**< DSP LEDs bitmask */
};
// Definitions for DSP LEDs used for TORNADO-A6678/FMC rev.1A and later boards
/** DSP LED GREEN-0 */
#define TA66XX_BC_DSP_LED_GREEN0 TA66XX_BC_DSP_LED0
#define TA66XX_BC_DSP_LED_GREEN0_BITMASK TA66XX_BC_DSP_LED0_BITMASK
/** DSP LED RED-0 */
#define TA66XX_BC_DSP_LED_RED0 TA66XX_BC_DSP_LED1
#define TA66XX_BC_DSP_LED_RED0_BITMASK TA66XX_BC_DSP_LED1_BITMASK
/** DSP LED GREEN-1 */
#define TA66XX_BC_DSP_LED_GREEN1 TA66XX_BC_DSP_LED2
#define TA66XX_BC_DSP_LED_GREEN1_BITMASK TA66XX_BC_DSP_LED2_BITMASK
/** DSP LED RED-1 */
#define TA66XX_BC_DSP_LED_RED1 TA66XX_BC_DSP_LED3
#define TA66XX_BC_DSP_LED_RED1_BITMASK TA66XX_BC_DSP_LED3_BITMASK
/** DSP LED GREEN-2 */
#define TA66XX_BC_DSP_LED_GREEN2 TA66XX_BC_DSP_LED4
#define TA66XX_BC_DSP_LED_GREEN2_BITMASK TA66XX_BC_DSP_LED4_BITMASK
/** DSP LED YELLOW-0 */
#define TA66XX_BC_DSP_LED_YELLOW0 TA66XX_BC_DSP_LED5
#define TA66XX_BC_DSP_LED_YELLOW0_BITMASK TA66XX_BC_DSP_LED5_BITMASK
/** DSP LED YELLOW-1 */
#define TA66XX_BC_DSP_LED_YELLOW1 TA66XX_BC_DSP_LED6
#define TA66XX_BC_DSP_LED_YELLOW1_BITMASK TA66XX_BC_DSP_LED6_BITMASK
/** DSP LED RED-2 */
#define TA66XX_BC_DSP_LED_RED2 TA66XX_BC_DSP_LED7
#define TA66XX_BC_DSP_LED_RED2_BITMASK TA66XX_BC_DSP_LED7_BITMASK
/** DSP LED aliases for compatibility with TORNADO-A6678 rev.1B-1 board definitions */
#define TA66XX_BC_DSP_LED_RED TA66XX_BC_DSP_LED_RED0
#define TA66XX_BC_DSP_LED_AMBER TA66XX_BC_DSP_LED_YELLOW0
#define TA66XX_BC_DSP_LED_BLUE TA66XX_BC_DSP_LED_GREEN2
#define TA66XX_BC_DSP_LED_WHITE TA66XX_BC_DSP_LED_RED2
// Aliases for DSP LEDs used for TORNADO-A6678 rev.1B-1 board
/** DSP LED GREEN-0 */
#define TA6678_REV1B_BC_DSP_LED_GREEN0 TA66XX_BC_DSP_LED0
#define TA6678_REV1B_BC_DSP_LED_GREEN0_BITMASK TA66XX_BC_DSP_LED0_BITMASK
/** DSP LED GREEN-1 */
#define TA6678_REV1B_BC_DSP_LED_GREEN1 TA66XX_BC_DSP_LED1
#define TA6678_REV1B_BC_DSP_LED_GREEN1_BITMASK TA66XX_BC_DSP_LED1_BITMASK
/** DSP LED YELLOW-0 */
#define TA6678_REV1B_BC_DSP_LED_YELLOW0 TA66XX_BC_DSP_LED2
#define TA6678_REV1B_BC_DSP_LED_YELLOW0_BITMASK TA66XX_BC_DSP_LED2_BITMASK
/** DSP LED YELLOW-1 */
#define TA6678_REV1B_BC_DSP_LED_YELLOW1 TA66XX_BC_DSP_LED3
#define TA6678_REV1B_BC_DSP_LED_YELLOW1_BITMASK TA66XX_BC_DSP_LED3_BITMASK
/** DSP LED AMBER */
#define TA6678_REV1B_BC_DSP_LED_AMBER TA66XX_BC_DSP_LED4
#define TA6678_REV1B_BC_DSP_LED_AMBER_BITMASK TA66XX_BC_DSP_LED4_BITMASK
/** DSP LED RED */
#define TA6678_REV1B_BC_DSP_LED_RED TA66XX_BC_DSP_LED5
#define TA6678_REV1B_BC_DSP_LED_RED_BITMASK TA66XX_BC_DSP_LED5_BITMASK
/** DSP LED BLUE */
#define TA6678_REV1B_BC_DSP_LED_BLUE TA66XX_BC_DSP_LED6
#define TA6678_REV1B_BC_DSP_LED_BLUE_BITMASK TA66XX_BC_DSP_LED6_BITMASK
/** DSP LED WHITE */
#define TA6678_REV1B_BC_DSP_LED_WHITE TA66XX_BC_DSP_LED7
#define TA6678_REV1B_BC_DSP_LED_WHITE_BITMASK TA66XX_BC_DSP_LED7_BITMASK
/*------------ TA66XX_BC_set_dsp_leds_enable() function ------------------*//**
* @brief Function enables or disables on-board DSP LEDs
*
* @param[in] state - DSP LEDs enable state: TA66XX_ON or TA66XX_OFF;
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_set_dsp_leds_enable(uint32_t enable);
/*------------ TA66XX_BC_get_dsp_leds_enable_status() function -----------*//**
* @brief Function returns enable status of on-board DSP LEDs
*
* @return DSP LEDs enable state: TA66XX_ON or TA66XX_OFF
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_dsp_leds_enable_status(void);
/*------------ TA66XX_BC_set_dsp_led_state() function --------------------*//**
* @brief Function sets selected DSP LED to the desired state: ON or OFF
*
* @param[in] led_number - DSP LED number definition;
* @param[in] state - DSP LED state: TA66XX_ON or TA66XX_OFF;
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_set_dsp_led_state(uint32_t led_number, uint32_t state);
/*------------ TA66XX_BC_get_dsp_led_state() function --------------------*//**
* @brief Function returns selected DSP LED state: ON or OFF
*
* @param[in] led_number - DSP LED number definition;
*
* @return DSP LED state: TA66XX_ON or TA66XX_OFF
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_dsp_led_state(uint32_t led_number);
/*------------ TA66XX_BC_set_dsp_leds() function -------------------------*//**
* @brief Function sets selected DSP LEDs to the desired state: ON or OFF
*
* @param[in] led_bitmask - DSP LEDs (ORed) bitmask;
* @param[in] state - DSP LEDs state: TA66XX_ON or TA66XX_OFF;
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_set_dsp_leds(uint32_t led_bitmask, uint32_t state);
/*------------ TA66XX_BC_get_dsp_leds() function -------------------------*//**
* @brief Function returns selected DSP LEDs state: ON or OFF
*
* @param[in] led_bitmask - DSP LEDs (ORed) bitmask;
*
* @return DSP LEDs state
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_dsp_leds(uint32_t led_bitmask);
/** @}*/
//=============================================================================
//=============================================================================
//============ DSP-to-FPGA GPIO functions =====================================
//=============================================================================
/** @addtogroup TA66XX_BC_DSP_FPGA_GPIO TORNADO AMC DSP-to-FPGA GPIO functions
* @{
*/
/** DSP-to-FPGA GPIO pins definitions */
enum TA66XX_BC_DSP_FPGA_GPIO
{
TA66XX_BC_DSP_FPGA_GPIO0 = 0, /**< DSP-to-FPGA GPIO pin 0 */
TA66XX_BC_DSP_FPGA_GPIO1, /**< DSP-to-FPGA GPIO pin 1 */
TA66XX_BC_DSP_FPGA_GPIO2, /**< DSP-to-FPGA GPIO pin 2 */
TA66XX_BC_DSP_FPGA_GPIO3, /**< DSP-to-FPGA GPIO pin 3 */
TA66XX_BC_DSP_FPGA_GPIO4, /**< DSP-to-FPGA GPIO pin 4 */
TA66XX_BC_DSP_FPGA_GPIO5, /**< DSP-to-FPGA GPIO pin 5 */
TA66XX_BC_DSP_FPGA_GPIO6, /**< DSP-to-FPGA GPIO pin 6 */
TA66XX_BC_DSP_FPGA_GPIO7 /**< DSP-to-FPGA GPIO pin 7 */
};
/** DSP-to-FPGA GPIO pins bitmask definitions */
enum TA66XX_BC_DSP_FPGA_GPIO_BITMASKS
{
TA66XX_BC_DSP_FPGA_GPIO0_BITMASK = 0x0001, /**< DSP-to-FPGA GPIO pin 0 bitmask */
TA66XX_BC_DSP_FPGA_GPIO1_BITMASK = 0x0002, /**< DSP-to-FPGA GPIO pin 1 bitmask */
TA66XX_BC_DSP_FPGA_GPIO2_BITMASK = 0x0004, /**< DSP-to-FPGA GPIO pin 2 bitmask */
TA66XX_BC_DSP_FPGA_GPIO3_BITMASK = 0x0008, /**< DSP-to-FPGA GPIO pin 3 bitmask */
TA66XX_BC_DSP_FPGA_GPIO4_BITMASK = 0x0010, /**< DSP-to-FPGA GPIO pin 4 bitmask */
TA66XX_BC_DSP_FPGA_GPIO5_BITMASK = 0x0020, /**< DSP-to-FPGA GPIO pin 5 bitmask */
TA66XX_BC_DSP_FPGA_GPIO6_BITMASK = 0x0040, /**< DSP-to-FPGA GPIO pin 6 bitmask */
TA66XX_BC_DSP_FPGA_GPIO7_BITMASK = 0x0080, /**< DSP-to-FPGA GPIO pin 7 bitmask */
TA66XX_BC_DSP_FPGA_GPIO_BITMASK = 0x00ff /**< DSP-to-FPGA GPIO pins bitmask */
};
/** DSP-to-FPGA GPIO pins direction definitions */
#define TA66XX_BC_DSP_FPGA_GPIO_DIR_OUT C66XX_GPIO_DIR_OUT
#define TA66XX_BC_DSP_FPGA_GPIO_DIR_IN C66XX_GPIO_DIR_IN
/*------------ TA66XX_BC_set_dsp_to_fpga_gpio_enable() function ----------*//**
* @brief Function enables or disables on-board DSP-to-FPGA GPIO pins
*
* @param[in] state - DSP-to-FPGA GPIO pins enable state: TA66XX_ON or
* TA66XX_OFF;
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_set_dsp_to_fpga_gpio_enable(uint32_t enable);
/*------------ TA66XX_BC_get_dsp_to_fpga_gpio_enable_status() function ---*//**
* @brief Function returns enable status of on-board DSP-to-FPGA GPIO pins
*
* @return DSP-to-FPGA GPIO pins enable state: TA66XX_ON or TA66XX_OFF;
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_dsp_to_fpga_gpio_enable_status(void);
/*------------ TA66XX_BC_set_dsp_to_fpga_gpio_pin_dir() function ---------*//**
* @brief Function sets selected DSP-to-FPGA GPIO pin direction: IN or OUT
*
* @param[in] pin - DSP-to-FPGA GPIO pin number;
* @param[in] dir - DSP-to-FPGA GPIO pin direction: IN or OUT
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_set_dsp_to_fpga_gpio_pin_dir(uint32_t pin, uint32_t dir);
/*------------ TA66XX_BC_get_dsp_to_fpga_gpio_pin_dir() function ---------*//**
* @brief Function returns selected DSP-to-FPGA GPIO pin direction: IN or OUT
*
* @param[in] pin - DSP-to-FPGA GPIO pin number;
*
* @return DSP-to-FPGA GPIO pin direction: IN or OUT
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_dsp_to_fpga_gpio_pin_dir(uint32_t pin);
/*------------ TA66XX_BC_set_dsp_to_fpga_gpio_pin_data() function --------*//**
* @brief Function sets selected DSP-to-FPGA GPIO pin to the desired state: ON
* or OFF
*
* @param[in] pin - DSP-to-FPGA GPIO pin number;
* @param[in] data - DSP-to-FPGA GPIO pin state: TA66XX_ON or TA66XX_OFF;
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_set_dsp_to_fpga_gpio_pin_data(uint32_t pin, uint32_t data);
/*------------ TA66XX_BC_get_dsp_to_fpga_gpio_pin_data() function --------*//**
* @brief Function returns selected DSP-to-FPGA GPIO pin state: ON or OFF
*
* @param[in] pin - DSP-to-FPGA GPIO pin number;
*
* @return DSP-to-FPGA GPIO pin state: TA66XX_ON or TA66XX_OFF
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_dsp_to_fpga_gpio_pin_data(uint32_t pin);
/*------------ TA66XX_BC_set_dsp_to_fpga_gpio_dir() function -------------*//**
* @brief Function sets selected DSP-to-FPGA GPIO pins direction: IN or OUT
*
* @param[in] pin_bitmask - DSP-to-FPGA GPIO pins (ORed) bitmask;
* @param[in] dir - DSP-to-FPGA GPIO pin direction: IN or OUT
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_set_dsp_to_fpga_gpio_dir(uint32_t pin_bitmask, uint32_t dir);
/*------------ TA66XX_BC_get_dsp_to_fpga_gpio_dir() function -------------*//**
* @brief Function returns selected DSP-to-FPGA GPIO pins direction: IN or OUT
*
* @param[in] pin - DSP-to-FPGA GPIO pins (ORed) bitmask;
*
* @return DSP-to-FPGA GPIO pins direction: IN or OUT
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_dsp_to_fpga_gpio_dir(uint32_t pin_bitmask);
/*------------ TA66XX_BC_set_dsp_to_fpga_gpio_data() function ------------*//**
* @brief Function sets selected DSP-to-FPGA GPIO pins to the desired state: ON
* or OFF
*
* @param[in] pin_bitmask - DSP-to-FPGA GPIO pins (ORed) bitmask;
* @param[in] data - DSP-to-FPGA GPIO pins state: TA66XX_ON or TA66XX_OFF;
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_set_dsp_to_fpga_gpio_data(uint32_t pin_bitmask, uint32_t data);
/*------------ TA66XX_BC_get_dsp_to_fpga_gpio_data() function ------------*//**
* @brief Function returns selected DSP-to-FPGA GPIO pins state: ON or OFF
*
* @param[in] pin - DSP-to-FPGA GPIO pins (ORed) bitmask;
*
* @return DSP-to-FPGA GPIO pins state
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_dsp_to_fpga_gpio_data(uint32_t pin_bitmask);
/** @}*/
//=============================================================================
//=============================================================================
//============ DSP GPIO IRQ functions =========================================
//=============================================================================
/** @addtogroup TA66XX_BC_DSP_GPIO_IRQ TORNADO AMC DSP GPIO IRQ mapping functions
* @{
*/
/** DSP GPIO pins IRQ source definitions */
enum TA66XX_BC_DSP_GPIO_IRQ_SEL_SOURCE
{
TA66XX_BC_DSP_GPIO_IRQ_SEL_OFF = 0, /**< DSP IRQ is disabled */
TA66XX_BC_DSP_GPIO_IRQ_SEL_MMC_TO_DSP_PD_ALERT, /**< MMC-to-DSP power-down alert is used to generate DSP IRQ */
TA66XX_BC_DSP_GPIO_IRQ_SEL_MMC_TO_DSP_COMM_RQ, /**< MMC-to-DSP communication request is used to generate DSP IRQ */
TA66XX_BC_DSP_GPIO_IRQ_SEL_1GE_PHY_IRQ /**< 1GE PHY IRQ is used to generate DSP IRQ */
};
/** DSP GPIO-6 and GPIO-7 pins definitions for TA6678 rev.1B and TA6678/FMC rev.1A boards */
#define TA66XX_BC_DSP_GPIO6_PIN 6
#define TA66XX_BC_DSP_GPIO7_PIN 7
/** DSP GPIO-8 and GPIO-9 pins definitions for TA6678/FMC rev.1B and later boards */
#define TA66XX_BC_DSP_GPIO8_PIN 8
#define TA66XX_BC_DSP_GPIO9_PIN 9
/*------------ TA66XX_BC_map_dsp_gpio_interrupt() function ---------------*//**
* @brief Function maps IRQ source to selected DSP GPIO pin
*
* @param[in] gpio_pin - DSP GPIO pin;
* @param[in] irq_src - IRQ source;
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_map_dsp_gpio_interrupt(uint32_t gpio_pin, uint32_t irq_src);
/*------------ TA66XX_BC_unmap_dsp_gpio_interrupt() function -------------*//**
* @brief Function unmaps IRQ source from selected DSP GPIO pin
*
* @param[in] gpio_pin - DSP GPIO pin;
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_unmap_dsp_gpio_interrupt(uint32_t gpio_pin);
/** @}*/
//=============================================================================
//=============================================================================
//============ UART functions =================================================
//=============================================================================
/** @addtogroup TA66XX_BC_UART TORNADO AMC UART functions
* @{
*/
/** DSP UART printf-like string max length */
#define TA66XX_BC_UART_PRINTF_LEN_MAX 1023
/*------------ TA66XX_BC_init_uart() function ---------------------------*//**
* @brief Function inits the DSP UART peripheral
*
* @param[in] baud_rate - desired baud rate;
* @param[in] data_bits - number of data bits;
* @param[in] parity - parity bit;
* @param[in] stop_bits - number of stop bits;
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_init_uart(uint32_t baud_rate, uint32_t data_bits, uint32_t parity, uint32_t stop_bits);
/*------------ TA66XX_BC_uart_receiver_is_ready() function ---------------*//**
* @brief Function checks if a character is received over DSP UART
*
* @return 1 - a character is received over DSP UART,
* 0 - otherwise
*
-----------------------------------------------------------------------------*/
#define TA66XX_BC_uart_receiver_is_ready() C66XX_UART_receiver_is_ready()
/*------------ TA66XX_BC_uart_receive_char() function --------------------*//**
* @brief Function receives a character over DSP UART
*
* @return Received character
*
-----------------------------------------------------------------------------*/
#define TA66XX_BC_uart_receive_char() C66XX_UART_receive_char()
/*------------ TA66XX_BC_uart_transmit_char() function -------------------*//**
* @brief Function transmits a character over DSP UART
*
* @param[in] c - A character to transmit
*
* @return None
*
-----------------------------------------------------------------------------*/
#define TA66XX_BC_uart_transmit_char(c) C66XX_UART_transmit_char(c)
/*------------ TA66XX_BC_uart_transmit_string() function -----------------*//**
* @brief Function transmits a string until '0' charachter
*
* @param[in] s - A pointer to the string to transmit
*
* @return None
*
-----------------------------------------------------------------------------*/
#define TA66XX_BC_uart_transmit_string(s) C66XX_UART_transmit_string(s)
/*------------ TA66XX_BC_uart_receive_line_string() function -------------*//**
* @brief Function receives a line ended with CR character, and stores
* received characters into string with '\0' symbol.
*
* @param[in] s - Pointer to a string to store received characters
*
* @return Number of received characters without '\0' symbol.
*
-----------------------------------------------------------------------------*/
#define TA66XX_BC_uart_receive_line_string(s) C66XX_UART_receive_line_string(s)
/*------------ TA66XX_BC_uart_printf() function --------------------------*//**
* @brief Function prints messages to UART
*
* @param[in] format - format string;
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_uart_printf(const char *format, ...);
/** @}*/
//=============================================================================
//=============================================================================
//============ EEPROM functions ===============================================
//=============================================================================
/** @addtogroup TA66XX_BC_EEPROM TORNADO AMC EEPROM memory functions
* @{
*/
/*------------ TA66XX_BC_get_eeprom_length() function --------------------*//**
* @brief Function returns on-board EEPROM memory length in bytes
*
* @return On-board EEPROM memory length in bytes
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_eeprom_length(void);
/*------------ TA66XX_BC_write_eeprom() function -------------------------*//**
* @brief Function writes data[len] to EEPROM memory starting at memory
* address addr
*
* @param[in] addr - memory address within the chip;
* @param[in] data - pointer to data;
* @param[in] len - data len in bytes;
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_write_eeprom(uint32_t addr, uint8_t *data, uint32_t len);
/*------------ TA66XX_BC_read_eeprom() function --------------------------*//**
* @brief Function reads data[len] from EEPROM memory starting at memory
* address addr
*
* @param[in] addr - memory address within the chip;
* @param[out] buf - pointer to data buffer to store data;
* @param[in] len - data len in bytes;
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_read_eeprom(uint32_t addr, uint8_t *buf, uint32_t len);
/*------------ TA66XX_BC_erase_eeprom() function -------------------------*//**
* @brief Function erases len bytes from EEPROM memory starting at memory
* address addr
*
* @param[in] addr - memory address within the chip;
* @param[in] len - number of bytes to erase;
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_erase_eeprom(uint32_t addr, uint32_t len);
/** @}*/
//=============================================================================
//=============================================================================
//============ Board info functions ===========================================
//=============================================================================
/** @addtogroup TA66XX_BC_BOARD_INFO TORNADO AMC board info functions
* @{
*/
/** Board info data descriptor IDs */
#define TA66XX_BC_BOARD_INFO_ID_TA6678_REV1B 1
#define TA66XX_BC_BOARD_INFO_ID_TA6678FMC_REV1A 2
#define TA66XX_BC_BOARD_INFO_ID_TA6678FMC_REV1B 3
/** Board temperature data descriptor */
typedef struct
{
float temp_pcb, /**< PCB current temperature */
temp_dsp, /**< DSP current temperature */
temp_fpga; /**< FPGA current temperature */
// TEMP zone classification status
// This var is set according to TA6678_MC_TEMP_ZONE_ID_xxxx defs.
uint32_t temp_zone_id; /**< Temperature zone ID */
// 8-bit integer thresholds for MMC TEMP zones
// These thresholds are used to classify summary temparature, which MMC derives
// from PCB, DSP and FPGA temperatures.
char overheated_low_zone_threshold, /**< OVERHEATED low threshold (P/S will be switched OFF at this threshold and upper) */
hot_low_zone_threshold, /**< HOT low threshold (P/S will be not switched ON at this threshold and upper) */
warm3_low_zone_threshold, /**< WARM3 low threshold */
warm2_low_zone_threshold, /**< WARM2 low threshold */
warm1_low_zone_threshold, /**< WARM1 low threshold */
normal_low_zone_threshold, /**< NORMAL low threshold */
cold1_low_zone_threshold, /**< COLD1 low threshold */
cold2_low_zone_threshold, /**< COLD2 low threshold */
cold3_low_zone_threshold, /**< COLD3 low threshold (P/S will be not switched ON below this threshold) */
frosty_low_zone_threshold; /**< FROSTY low threshold (P/S will be switched OFF below this threshold) */
// 8-bit integer thresholds for AMC TEMP zones for every on-board temp sensor
char amc_pcb_temp_noncritical_threshold, /**< PCB temperature AMC UPPER NON-CRITICAL ASSERTING EVENT threshold */
amc_pcb_temp_critical_threshold, /**< PCB temperature AMC UPPER CRITICAL ASSERTING EVENT threshold */
amc_pcb_temp_nonrecoverable_threshold, /**< PCB temperature AMC UPPER NON-RECOVERABLE ASSERTING EVENT threshold */
amc_pcb_temp_hysteresis, /**< PCB temperature AMC positive going hysteresis */
amc_dsp_temp_noncritical_threshold, /**< DSP temperature AMC UPPER NON-CRITICAL ASSERTING EVENT threshold */
amc_dsp_temp_critical_threshold, /**< DSP temperature AMC UPPER CRITICAL ASSERTING EVENT threshold */
amc_dsp_temp_nonrecoverable_threshold, /**< DSP temperature AMC UPPER NON-RECOVERABLE ASSERTING EVENT threshold */
amc_dsp_temp_hysteresis, /**< DSP temperature AMC positive going hysteresis */
amc_fpga_temp_noncritical_threshold, /**< FPGA temperature AMC UPPER NON-CRITICAL ASSERTING EVENT threshold */
amc_fpga_temp_critical_threshold, /**< FPGA temperature AMC UPPER CRITICAL ASSERTING EVENT threshold */
amc_fpga_temp_nonrecoverable_threshold, /**< FPGA temperature AMC UPPER NON-RECOVERABLE ASSERTING EVENT threshold */
amc_fpga_temp_hysteresis; /**< FPGA temperature AMC positive going hysteresis */
} TA66XX_BC_TEMP_DATA_DD;
// Board temperature data descriptor length
#define TA66XX_BC_TEMP_DATA_DD_LEN sizeof(TA66XX_BC_TEMP_DATA_DD)
/** Board current power data descriptor for TA6678 rev.1B-1 board */
typedef struct
{
float v_12v, /**< Input +12V power supply voltage value */
i_12v, /**< Input +12V power supply current value */
v_3v3_aux, /**< On-board auxiliary +3.3V power supply voltage value */
i_3v3_aux, /**< On-board auxiliary +3.3V power supply current value */
v_mc, /**< Module management power supply voltage value */
i_mc, /**< Module management power supply current value */
v_3v3, /**< On-board +3.3V power supply voltage value */
i_3v3, /**< On-board +3.3V power supply current value */
v_2v5, /**< On-board +2.5V power supply voltage value */
i_2v5, /**< On-board +2.5V power supply current value */
v_1v8, /**< On-board +1.8V power supply voltage value */
i_1v8, /**< On-board +1.8V power supply current value */
v_1v5, /**< On-board +1.5V power supply voltage value */
i_1v5, /**< On-board +1.5V power supply current value */
v_1v0, /**< On-board +1.0V power supply voltage value */
i_1v0, /**< On-board +1.0V power supply current value */
v_ddr_vtt, /**< On-board DDR3 VTT power supply voltage value */
v_dsp_vcore, /**< On-board DSP core power supply voltage value */
i_dsp_vcore, /**< On-board DSP core power supply current value */
v_fpga_vcore, /**< On-board FPGA core power supply voltage value */
i_fpga_vcore, /**< On-board FPGA core power supply current value */
v_fpga_mgtavcc, /**< On-board FPGA MGTAVCC power supply voltage value */
v_fpga_mgtavtt; /**< On-board FPGA MGTAVTT power supply voltage value */
} TA6678_REV1B_BC_POWER_DATA_DD;
// Board current power data descriptor for TA6678 rev.1B-1 board length
#define TA6678_REV1B_BC_POWER_DATA_DD_LEN sizeof(TA6678_REV1B_BC_POWER_DATA_DD)
/** Board current power data descriptor for TA6678/FMC rev.1A and later boards */
typedef struct
{
float power_12v, /**< Input +12V power supply value */
power_fpga_core, /**< On-board FPGA core power supply value */
power_dsp_core, /**< On-board DSP core power supply value */
v_12v, /**< Input +12V power supply voltage value */
i_12v, /**< Input +12V power supply current value */
i_fpga_core, /**< On-board FPGA core power supply current value */
i_dsp_core; /**< On-board DSP core power supply current value */
} TA66XX_BC_PRIMARY_POWER_DATA_DD;
// Board current power data descriptor length
#define TA66XX_BC_PRIMARY_POWER_DATA_DD_LEN sizeof(TA66XX_BC_PRIMARY_POWER_DATA_DD)
/** Board current power data union */
typedef union
{
TA6678_REV1B_BC_POWER_DATA_DD ta6678_rev1b_dd;
TA66XX_BC_PRIMARY_POWER_DATA_DD primary_power_dd;
} POWER_DATA_DD;
/** Board current power data descriptor */
typedef struct
{
unsigned id; // ID to decode the UNION structure type
POWER_DATA_DD power_data_dd;
} TA66XX_BC_POWER_DATA_DD;
// Board current power data descriptor length
#define TA66XX_BC_POWER_DATA_DD_LEN sizeof(TA66XX_BC_POWER_DATA_DD)
/** FMC interface power data descriptor for TA6678/FMC rev.1A and later boards */
typedef struct
{
float power_fmc_12v, /**< FMC I/F +12V power supply value */
power_fmc_3v3, /**< FMC I/F +3.3V power supply value */
power_fmc_vadj, /**< FMC I/F Vadj power supply value */
v_fmc_12v, /**< FMC I/F +12V power supply voltage value */
i_fmc_12v, /**< FMC I/F +12V power supply current value */
v_fmc_3v3, /**< FMC I/F +3.3V power supply voltage value */
i_fmc_3v3, /**< FMC I/F +3.3V power supply current value */
v_fmc_vadj, /**< FMC I/F Vadj power supply voltage value */
i_fmc_vadj, /**< FMC I/F Vadj power supply current value */
v_fmc_vio_b_m2c, /**< FMC I/F VIO_B_M2C power supply voltage value */
v_fmc_vref_a_m2c, /**< FMC I/F VREF_A_M2C power supply voltage value */
v_fmc_vref_b_m2c; /**< FMC I/F VREF_B_M2C power supply voltage value */
} TA66XX_BC_FMC_POWER_DATA_DD;
// FMC interface power data descriptor length
#define TA66XX_BC_FMC_POWER_DATA_DD_LEN sizeof(TA66XX_BC_FMC_POWER_DATA_DD)
/** Max string length in device info structure */
#define TA66XX_BC_DEVICE_INFO_STRING_LEN_MAX 32
#define TA66XX_BC_DEVICE_PN_STRING_LEN_MAX 64
#define TA66XX_BC_DEVICE_HW_REVISION_STRING_LEN_MAX 16
/** Board info data descriptor for TA6678 rev.1B-1 board */
typedef struct
{
uint32_t op_mode; /**< Operation mode: '0' - stand-alone mode, '1' - AMC host mode */
uint32_t amc_slot_id; /**< AMC slot ID (in case AMC host mode is used) */
uint8_t manufacturing_date_day_of_month; /**< Manufacturing day: 1..31 */
uint8_t manufacturing_date_month; /**< Manufacturing month: 1..12 ('1' - January) */
uint16_t manufacturing_date_year; /**< Manufacturing year: 2015.. */
char device_sn[TA66XX_BC_DEVICE_INFO_STRING_LEN_MAX]; /**< Device serial number */
char mmc_fw_rev[TA66XX_BC_DEVICE_INFO_STRING_LEN_MAX]; /**< MMC firmware revision string */
char tammc_fw_rev[TA66XX_BC_DEVICE_INFO_STRING_LEN_MAX]; /**< TAMMC firmware revision string */
char mmc_core_fw_rev[TA66XX_BC_DEVICE_INFO_STRING_LEN_MAX]; /**< MMC core firmware revision string */
} TA6678_REV1B_BC_DEVICE_INFO_DATA_DD;
// Board info data descriptor for TA6678 rev.1B-1 board length
#define TA6678_REV1B_BC_DEVICE_INFO_DATA_DD_LEN sizeof(TA6678_REV1B_BC_DEVICE_INFO_DATA_DD)
/** Board info data descriptor for TA6678/FMC rev.1A and later boards */
typedef struct
{
uint32_t op_mode; /**< Operation mode: '0' - stand-alone mode, '1' - AMC host mode */
uint32_t amc_slot_id; /**< AMC slot ID (in case AMC host mode is used) */
uint8_t manufacturing_date_day_of_month; /**< Manufacturing day: 1..31 */
uint8_t manufacturing_date_month; /**< Manufacturing month: 1..12 ('1' - January) */
uint16_t manufacturing_date_year; /**< Manufacturing year: 2015.. */
char manufacturer_name[TA66XX_BC_DEVICE_INFO_STRING_LEN_MAX]; /**< Manufacturer name */
char device_name[TA66XX_BC_DEVICE_INFO_STRING_LEN_MAX]; /**< Device name */
char device_pn[TA66XX_BC_DEVICE_PN_STRING_LEN_MAX]; /**< Device part number */
char device_sn[TA66XX_BC_DEVICE_INFO_STRING_LEN_MAX]; /**< Device serial number */
char device_hw_revision[TA66XX_BC_DEVICE_HW_REVISION_STRING_LEN_MAX]; /**< Device H/W revision */
char mmc_fw_rev[TA66XX_BC_DEVICE_INFO_STRING_LEN_MAX]; /**< MMC firmware revision string */
char tammc_fw_rev[TA66XX_BC_DEVICE_INFO_STRING_LEN_MAX]; /**< TAMMC firmware revision string */
char mmc_core_fw_rev[TA66XX_BC_DEVICE_INFO_STRING_LEN_MAX]; /**< MMC core firmware revision string */
} TA66XX_BC_FULL_DEVICE_INFO_DATA_DD;
// Board info data descriptor length
#define TA66XX_BC_FULL_DEVICE_INFO_DATA_DD_LEN sizeof(TA66XX_BC_FULL_DEVICE_INFO_DATA_DD)
/** Board current power data union */
typedef union
{
TA6678_REV1B_BC_DEVICE_INFO_DATA_DD ta6678_rev1b_dd;
TA66XX_BC_FULL_DEVICE_INFO_DATA_DD ta66xx_full_device_info_dd;
} DEVICE_INFO_DATA_DD;
/** Board current power data descriptor */
typedef struct
{
uint32_t id; // ID to decode the UNION structure type
DEVICE_INFO_DATA_DD device_info_data_dd;
} TA66XX_BC_DEVICE_INFO_DATA_DD;
// Board current power data descriptor length
#define TA66XX_BC_DEVICE_INFO_DATA_DD_LEN sizeof(TA66XX_BC_DEVICE_INFO_DATA_DD)
/** Hardware configuration info data descriptor for TA6678/FMC rev.1A and later boards */
typedef struct
{
uint32_t fpga_ddr0_len; /**< FPGA DDR memory bank #0 length in MB: 0 - not installed */
uint32_t fpga_ddr1_len; /**< FPGA DDR memory bank #1 length in MB: 0 - not installed */
uint32_t cpu_ddr_len; /**< CPU DDR memory length in MB: 0 - not installed */
uint32_t flash_len; /**< FLASH memory length in MB: 0 - not installed */
uint32_t mram_len; /**< MRAM memory length in KB: 0 - not installed */
uint32_t i2c_eeprom_len; /**< I2C EEPROM memory length in KB: 0 - not installed */
uint32_t cpu_clk_freq_id; /**< CPU input clock frequency in MHz: 0 - not available */
uint32_t x1ge0_phy_installed_id; /**< External 1GE PHY #0 installed ID: 0 - not installed */
uint32_t x1ge1_phy_installed_id; /**< External 1GE PHY #1 installed ID: 0 - not installed */
uint32_t sfp0_if_installed_id; /**< SFP interface #0 installed ID: 0 - not installed */
uint32_t sfp1_if_installed_id; /**< SFP interface #1 installed ID: 0 - not installed */
uint32_t qsfp_if_installed_id; /**< QSFP interface installed ID: 0 - not installed */
uint32_t fmc_if_installed_id; /**< FMC interface installed ID: 0 - not installed */
uint32_t sd_slot_installed_id; /**< uSD slot installed ID: 0 - not installed */
} TA66XX_BC_HW_CFG_INFO_DATA_DD;
// Hardware configuration info data descriptor length
#define TA66XX_BC_HW_CFG_INFO_DATA_DD_LEN sizeof(TA66XX_BC_HW_CFG_INFO_DATA_DD)
/** Max string length in FMC info structure */
#define TA66XX_BC_FMC_STATUS_STRING_LEN_MAX 48
#define TA66XX_BC_FMC_INFO_STRING_LEN_MAX 64
#define TA66XX_BC_MANUFACTURING_TIME_STRING_LEN_MAX 32
/** FMC info data descriptor for TA6678/FMC rev.1A and later boards */
typedef struct
{
char fmc_status_text[TA66XX_BC_FMC_STATUS_STRING_LEN_MAX]; /**< FMC status */
char manufacturer_name[TA66XX_BC_FMC_INFO_STRING_LEN_MAX]; /**< Manufacturer name */
char device_name[TA66XX_BC_FMC_INFO_STRING_LEN_MAX]; /**< Device name */
char device_pn[TA66XX_BC_FMC_INFO_STRING_LEN_MAX]; /**< Device part number */
char device_sn[TA66XX_BC_FMC_INFO_STRING_LEN_MAX]; /**< Device serial number */
char device_version[TA66XX_BC_FMC_INFO_STRING_LEN_MAX]; /**< Device version */
char manufacturing_time[TA66XX_BC_MANUFACTURING_TIME_STRING_LEN_MAX]; /**< Manufacturing time */
} TA66XX_BC_FMC_INFO_DATA_DD;
// FMC info data descriptor length
#define TA66XX_BC_FMC_INFO_DATA_DD_LEN sizeof(TA66XX_BC_FMC_INFO_DATA_DD)
/*------------ TA66XX_BC_get_device_info() function ----------------------*//**
* @brief Function returns AMC module device info: operation mode, serial
* number, manufacturing date, firmware revisions
*
* @param[out] info_dd - pointer to a buffer that receives device info data
* descriptor in case function is completed without errors.
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_get_device_info(TA66XX_BC_DEVICE_INFO_DATA_DD *info_dd);
/*------------ TA66XX_BC_get_hw_cfg_info() function ----------------------*//**
* @brief Function returns AMC module hardware configuration info: installed
* memories, interfaces, etc.
*
* @param[out] info_dd - pointer to a buffer that receives hardware
* configuration data descriptor in case function is completed
* without errors.
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_get_hw_cfg_info(TA66XX_BC_HW_CFG_INFO_DATA_DD *info_dd);
/*------------ TA66XX_BC_get_fmc_info() function -------------------------*//**
* @brief Function returns FMC module device info: installed status, device
* name, serial number, manufacturing date, firmware revisions, etc.
*
* @param[out] info_dd - pointer to a buffer that receives FMC info data
* descriptor in case function is completed without errors.
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_get_fmc_info(TA66XX_BC_FMC_INFO_DATA_DD *info_dd);
/*------------ TA66XX_BC_get_temp_state() function -----------------------*//**
* @brief Function returns AMC module temperature monitor current info
*
* @param[out] temp_data_dd - pointer to a buffer that receives board
* temperature data descriptor in case function is completed
* without errors.
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_get_temp_state(TA66XX_BC_TEMP_DATA_DD *temp_data_dd);
/*------------ TA66XX_BC_get_power_state() function ----------------------*//**
* @brief Function returns AMC module power monitor current info
*
* @param[out] power_data_dd - pointer to a buffer that receives board power
* data descriptor in case function is completed without errors.
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_get_power_state(TA66XX_BC_POWER_DATA_DD *power_data_dd);
/*------------ TA66XX_BC_get_fmc_power_state() function ------------------*//**
* @brief Function returns FMC module power monitor current info
*
* @param[out] fmc_power_data_dd - pointer to a buffer that receives FMC
* module power data descriptor in case function is completed
* without errors.
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_get_fmc_power_state(TA66XX_BC_FMC_POWER_DATA_DD *fmc_power_data_dd);
/*------------ TA66XX_BC_set_mmc_to_dsp_rq() function --------------------*//**
* @brief Function sets MMC-to-DSP request from DSP (for test purposes)
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_set_mmc_to_dsp_rq(void);
/*------------ TA66XX_BC_set_mmc_power_down_notification() function ------*//**
* @brief Function sets MMC-to-DSP power down notification from DSP
* (for test purposes)
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_set_mmc_power_down_notification(void);
/*------------ TA66XX_BC_get_sfp_info() function -------------------------*//**
* @brief Function returns identification info about installed SFP
* transceiver: 256-byte array read from address 0x50 (identification info
* according to SFF-8472) and 256-byte array read from address 0x51 (digital
* diagnostic monitoring interface (DDMI) data)
*
* @param[out] id_data - pointer to a buffer that receives 256-byte array read
* from address 0x50 (identification info according to SFF-8472).
* In case pointer is NULL, then no data are filled in;
* @param[out] ddmi_data - pointer to a buffer that receives 256-byte array
* read from address 0x51 (DDMI data). In case pointer is NULL,
* then no data are filled in;
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_get_sfp_info(uint8_t *id_data, uint8_t *ddmi_data);
/** @}*/
//=============================================================================
//=============================================================================
//============ FPGA functions =================================================
//=============================================================================
/** @addtogroup TA66XX_BC_FPGA TORNADO AMC FPGA functions
* @{
*/
/** FPGA host interface (HIF) configuration data descriptor */
typedef struct
{
uint32_t w_setup; /**< Write strobe setup EMIF-16 cycles */
uint32_t w_strobe; /**< Write strobe duration EMIF-16 cycles */
uint32_t w_hold; /**< Write strobe hold EMIF-16 cycles */
uint32_t r_setup; /**< Read strobe setup EMIF-16 cycles */
uint32_t r_strobe; /**< Read strobe duration EMIF-16 cycles */
uint32_t r_hold; /**< Read strobe hold EMIF-16 cycles */
uint32_t turn_around; /**< Turn around EMIF-16 cycles */
} TA66XX_BC_FPGA_HIF_CNF_DD;
// FPGA HIF configuration data descriptor length in bytes
#define TA66XX_BC_FPGA_HIF_CNF_DD_LEN sizeof(TA66XX_BC_FPGA_HIF_CNF_DD)
/*------------ TA66XX_BC_set_fpga_hif_cnf() function ---------------------*//**
* @brief Function sets new configuration to FPGA host interface according to
* supplied parameters
*
* @param[in] cfg_dd - pointer to new FPGA HIF configuration data descriptor;
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_set_fpga_hif_cnf(TA66XX_BC_FPGA_HIF_CNF_DD *cfg_dd);
/*------------ TA66XX_BC_get_fpga_hif_cnf() function ---------------------*//**
* @brief Function returns current configuration of FPGA host interface
*
* @param[in] cfg_dd - pointer to buffer to receive current FPGA HIF
* configuration data descriptor;
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_get_fpga_hif_cnf(TA66XX_BC_FPGA_HIF_CNF_DD *cfg_dd);
/*------------ TA66XX_BC_get_fpga_hif_base_addr() function ---------------*//**
* @brief Function returns FPGA host interface base address
*
* @return FPGA host interface base address
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_fpga_hif_base_addr(void);
/*------------ TA66XX_BC_get_fpga_hif_length() function ------------------*//**
* @brief Function returns FPGA host interface length in bytes
*
* @return FPGA host interface length in bytes
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_fpga_hif_length(void);
/*------------ TA66XX_BC_set_fpga_hif_reset() function -------------------*//**
* @brief Function sets or releases FPGA host interface reset
*
* @param[in] state - FPGA host interface reset state: ON or OFF
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_set_fpga_hif_reset(uint32_t state);
/*------------ TA66XX_BC_get_fpga_hif_reset_state() function -------------*//**
* @brief Function returns FPGA host interface reset state
*
* @return FPGA host interface reset state: ON or OFF
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_fpga_hif_reset_state(void);
/*------------ TA66XX_BC_read_fpga_hif_byte() function -------------------*//**
* @brief Function reads a byte from FPGA host interface at address addr.
*
* @param[in] addr - FPGA address to read from
*
* @return A byte read from FPGA host interface
*
-----------------------------------------------------------------------------*/
uint8_t TA66XX_BC_read_fpga_hif_byte(uint32_t addr);
/*------------ TA66XX_BC_write_fpga_hif_byte() function ------------------*//**
* @brief Function writes a byte to FPGA host interface at address addr.
*
* @param[in] addr - FPGA address to write to
* @param[in] v - A byte to write
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_write_fpga_hif_byte(uint32_t addr, uint8_t v);
/*------------ TA66XX_BC_read_fpga_hif_w16() function --------------------*//**
* @brief Function reads a 16-bit word from FPGA host interface at address
* addr.
*
* @param[in] addr - FPGA address to read from
*
* @return A 16-bit word read from FPGA host interface
*
-----------------------------------------------------------------------------*/
uint16_t TA66XX_BC_read_fpga_hif_w16(uint32_t addr);
/*------------ TA66XX_BC_write_fpga_hif_w16() function -------------------*//**
* @brief Function writes a 16-bit word to FPGA host interface at address
* addr.
*
* @param[in] addr - FPGA address to write to
* @param[in] v - A 16-bit word to write
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_write_fpga_hif_w16(uint32_t addr, uint16_t v);
/*------------ TA66XX_BC_read_fpga_hif_w32() function --------------------*//**
* @brief Function reads a 32-bit word from FPGA host interface at address
* addr.
*
* @param[in] addr - FPGA address to read from
*
* @return A 32-bit word read from FPGA host interface
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_read_fpga_hif_w32(uint32_t addr);
/*------------ TA66XX_BC_write_fpga_hif_w32() function -------------------*//**
* @brief Function writes a 32-bit word to FPGA host interface at address
* addr.
*
* @param[in] addr - FPGA address to write to
* @param[in] v - A 32-bit word to write
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_write_fpga_hif_w32(uint32_t addr, uint32_t v);
/*------------ TA66XX_BC_read_fpga_hif_w64() function --------------------*//**
* @brief Function reads a 64-bit word from FPGA host interface at address
* addr.
*
* @param[in] addr - FPGA address to read from
*
* @return A 64-bit word read from FPGA host interface
*
-----------------------------------------------------------------------------*/
uint64_t TA66XX_BC_read_fpga_hif_w64(uint32_t addr);
/*------------ TA66XX_BC_write_fpga_hif_w64() function -------------------*//**
* @brief Function writes a 64-bit word to FPGA host interface at address
* addr.
*
* @param[in] addr - FPGA address to write to
* @param[in] v - A 64-bit word to write
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_write_fpga_hif_w64(uint32_t addr, uint64_t v);
/*------------ TA66XX_BC_clear_fpga_cnf() function -----------------------*//**
* @brief Function clears FPGA configuration memory
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_clear_fpga_cnf(void);
/*------------ TA66XX_BC_load_fpga_cnf() function ------------------------*//**
* @brief Function loads FPGA firmware file using the supported configuration
* interfaces (serial or parallel)
*
* @param[in] addr - address where FPGA firmware file data were saved;
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_load_fpga_cnf(uint32_t addr);
/*------------ TA66XX_BC_get_fpga_cnf_status() function ------------------*//**
* @brief Function returns FPGA configuration memory status: either
* loaded by FPGA firmware file or not
*
* @return TA66XX_OK - FPGA configuration memory is loaded,
* TA66XX_FPGA_CNF_LOAD_ERR - FPGA configuration memory is cleared.
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_get_fpga_cnf_status(void);
/** @}*/
//=============================================================================
//=============================================================================
//============ FLASH functions ================================================
//=============================================================================
/** @addtogroup TA66XX_BC_FLASH TORNADO AMC FLASH API functions
* @{
*/
/** FLASH memory sector is protected for write/erase operations */
#define TA66XX_BC_FLASH_SECTOR_PROTECTED 1
/** FLASH memory sector is unprotected for write/erase operations */
#define TA66XX_BC_FLASH_SECTOR_UNPROTECTED 0
/*------------ TA66XX_BC_get_flash_area_base_addr() function -------------*//**
* @brief Function returns FLASH area base address
*
* @return FLASH area base address
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_flash_area_base_addr(void);
/*------------ TA66XX_BC_get_flash_length() function ---------------------*//**
* @brief Function returns on-board FLASH memory length in bytes
*
* @return On-board FLASH memory length in bytes
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_flash_length(void);
/*------------ TA66XX_BC_get_flash_hw_wp_enable_status() function --------*//**
* @brief Function returns enable status of on-board FLASH memory hardware
* (via on-board switch) write-protection
*
* @return On-board FLASH memory hardware write-protection enable state:
* TA66XX_ON or TA66XX_OFF
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_flash_hw_wp_enable_status(void);
/*------------ TA66XX_BC_get_flash_sw_wp_enable_status() function --------*//**
* @brief Function returns enable status of on-board FLASH memory software
* write-protection
*
* @return On-board FLASH memory software write-protection enable state:
* TA66XX_ON or TA66XX_OFF
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_flash_sw_wp_enable_status(void);
/*------------ TA66XX_BC_set_flash_sw_wp_enable() function ---------------*//**
* @brief Function enables or disables on-board FLASH memory software
* write-protection
*
* @param[in] enable - on-board FLASH memory software write-protection enable
* state: TA66XX_ON or TA66XX_OFF;
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_set_flash_sw_wp_enable(uint32_t enable);
/*------------ TA66XX_BC_erase_flash() function --------------------------*//**
* @brief Function erases FLASH block, which starts from address a
* and of size len (in bytes)
*
* @param[in] addr - Block start address (in bytes)
* @param[in] len - block length (in bytes)
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_erase_flash(uint32_t addr, uint32_t len);
/** Flag to disable FLASH memory erasing before write operation */
#define TA66XX_BC_FLASH_ERASE_IS_DISABLED 0
/** Flag to enable FLASH memory erasing before write operation */
#define TA66XX_BC_FLASH_ERASE_IS_ENABLED 1
/*------------ TA66XX_BC_write_flash() function --------------------------*//**
* @brief Function writes data block of size len to FLASH address a
* The function erases FLASH before writing data to FLASH if erase input
* parameter is set.
*
* @param[in] a - FLASH address (in bytes)
* @param[in] ptr - data block to write
* @param[in] len - data block length (in bytes)
* @param[in] erase - flag to enable FLASH erasing before write operation
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_write_flash(uint32_t a, void *ptr, uint32_t len, uint32_t erase);
/*------------ TA66XX_BC_write_flash_byte() function ---------------------*//**
* @brief Function writes data byte d to FLASH address a
*
* @param[in] a - FLASH address (in bytes)
* @param[in] d - data byte to write
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_write_flash_byte(uint32_t addr, uint8_t d);
/*------------ TA66XX_BC_write_flash_w16() function ----------------------*//**
* @brief Function writes 16-bit data word d to FLASH address a
*
* @param[in] addr - FLASH address (in bytes)
* @param[in] d - 16-bit data word to write
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_write_flash_w16(uint32_t addr, uint16_t d);
/*------------ TA66XX_BC_write_flash_w32() function ----------------------*//**
* @brief Function writes 32-bit data word d to FLASH address a
*
* @param[in] addr - FLASH address (in bytes)
* @param[in] d - 32-bit data word to write
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_write_flash_w32(uint32_t addr, uint32_t d);
/*------------ TA66XX_BC_read_flash() function ---------------------------*//**
* @brief Function reads data block of size len from FLASH address a
*
* @param[in] addr - FLASH address (in bytes)
* @param[in] ptr - pointer to data buffer to store data block
* @param[in] len - data block length (in bytes)
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_read_flash(uint32_t addr, void *ptr, uint32_t len);
/** @}*/
//=============================================================================
//=============================================================================
//============ MRAM functions =================================================
//=============================================================================
/** @addtogroup TA66XX_BC_MRAM TORNADO AMC MRAM API functions
* @{
*/
/*------------ TA66XX_BC_get_mram_area_base_addr() function --------------*//**
* @brief Function returns MRAM area base address
*
* @return MRAM area base address
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_mram_area_base_addr(void);
/*------------ TA66XX_BC_get_mram_length() function ----------------------*//**
* @brief Function returns on-board MRAM memory length in bytes
*
* @return On-board MRAM memory length in bytes
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_mram_length(void);
/*------------ TA66XX_BC_get_mram_sw_wp_enable_status() function ---------*//**
* @brief Function returns enable status of on-board MRAM memory software
* write-protection
*
* @return On-board MRAM memory software write-protection enable state:
* TA66XX_ON or TA66XX_OFF
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_get_mram_sw_wp_enable_status(void);
/*------------ TA66XX_BC_set_mram_sw_wp_enable() function ----------------*//**
* @brief Function enables or disables on-board MRAM memory software
* write-protection
*
* @param[in] enable - on-board MRAM memory software write-protection enable
* state: TA66XX_ON or TA66XX_OFF;
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_set_mram_sw_wp_enable(uint32_t enable);
/*------------ TA66XX_BC_read_mram_byte() function -----------------------*//**
* @brief Function reads a byte from MRAM memory at address addr.
*
* @param[in] addr - MRAM memory address to read from
*
* @return A byte read from MRAM memory
*
-----------------------------------------------------------------------------*/
uint8_t TA66XX_BC_read_mram_byte(uint32_t addr);
/*------------ TA66XX_BC_write_mram_byte() function ----------------------*//**
* @brief Function writes a byte to MRAM memory at address addr.
*
* @param[in] addr - MRAM memory address to write to
* @param[in] v - A byte to write
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_write_mram_byte(uint32_t addr, uint8_t v);
/*------------ TA66XX_BC_read_mram_w16() function ------------------------*//**
* @brief Function reads a 16-bit word from MRAM memory at address addr.
*
* @param[in] addr - MRAM memory address to read from
*
* @return A 16-bit word read from MRAM memory
*
-----------------------------------------------------------------------------*/
uint16_t TA66XX_BC_read_mram_w16(uint32_t addr);
/*------------ TA66XX_BC_write_mram_w16() function -----------------------*//**
* @brief Function writes a 16-bit word to MRAM memory at address addr.
*
* @param[in] addr - MRAM memory address to write to
* @param[in] v - A 16-bit word to write
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_write_mram_w16(uint32_t addr, uint16_t v);
/*------------ TA66XX_BC_read_mram_w32() function ------------------------*//**
* @brief Function reads a 32-bit word from MRAM memory at address addr.
*
* @param[in] addr - MRAM memory address to read from
*
* @return A 32-bit word read from MRAM memory
*
-----------------------------------------------------------------------------*/
uint32_t TA66XX_BC_read_mram_w32(uint32_t addr);
/*------------ TA66XX_BC_write_mram_w32() function -----------------------*//**
* @brief Function writes a 32-bit word to MRAM memory at address addr.
*
* @param[in] addr - MRAM memory address to write to
* @param[in] v - A 32-bit word to write
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_write_mram_w32(uint32_t addr, uint32_t v);
/*------------ TA66XX_BC_read_mram_w64() function ------------------------*//**
* @brief Function reads a 64-bit word from MRAM memory at address addr.
*
* @param[in] addr - MRAM memory address to read from
*
* @return A 64-bit word read from MRAM memory
*
-----------------------------------------------------------------------------*/
uint64_t TA66XX_BC_read_mram_w64(uint32_t addr);
/*------------ TA66XX_BC_write_mram_w64() function -----------------------*//**
* @brief Function writes a 64-bit word to MRAM memory at address addr.
*
* @param[in] addr - MRAM memory address to write to
* @param[in] v - A 64-bit word to write
*
* @return None
*
-----------------------------------------------------------------------------*/
void TA66XX_BC_write_mram_w64(uint32_t addr, uint64_t v);
/** @}*/
//=============================================================================
//=============================================================================
//============ Gigabit Ethernet (GbE) Switch functions ========================
//=============================================================================
/** @addtogroup TA66XX_BC_GBE TORNADO AMC Gigabit Ethernet Switch functions
* @{
*/
/** Gigabit Ethernet ports count available at the board */
#define TA66XX_BC_GBE_PORT_COUNT 2
/** DSP SGMII port number which is routed to AMC connector */
#define TA66XX_BC_GBE_PORT_AMC_PORT_NUMBER 0
/** Alias for DSP SGMII port-0 number */
#define TA66XX_BC_GBE_PORT_AMC0_PORT_NUMBER TA66XX_BC_GBE_PORT_AMC_PORT_NUMBER
/** DSP SGMII port number which is routed to external PHY */
#define TA66XX_BC_GBE_PORT_X1GE_PORT_NUMBER 1
/** Alias for DSP SGMII port-1 number */
#define TA66XX_BC_GBE_PORT_AMC1_PORT_NUMBER TA66XX_BC_GBE_PORT_X1GE_PORT_NUMBER
/** Gigabit Ethernet port type */
typedef enum
{
TA66XX_BC_GBE_PORT_TYPE_NONE = 0, /**< Gigabit Ethernet port is not used */
TA66XX_BC_GBE_PORT_TYPE_PHY, /**< Gigabit Ethernet port is connected to on-board PHY */
TA66XX_BC_GBE_PORT_TYPE_AMC, /**< Gigabit Ethernet port is connected to the backplane AMC chassis */
TA66XX_BC_GBE_PORT_TYPE_MAX /**< End of port type */
} TA66XX_BC_GBE_PORT_TYPE;
/** Gigabit Ethernet port link status */
typedef enum
{
TA66XX_BC_GBE_PORT_LINK_STATUS_DOWN = 0, /**< Gigabit Ethernet port link is down */
TA66XX_BC_GBE_PORT_LINK_STATUS_UP, /**< Gigabit Ethernet port link is up */
TA66XX_BC_GBE_PORT_LINK_STATUS_MAX /**< End of link status */
} TA66XX_BC_GBE_PORT_LINK_STATUS;
/** T-AMC Gigabit Ethernet port data descriptor */
typedef struct
{
uint32_t number; /**< Port number */
TA66XX_BC_GBE_PORT_TYPE type; /**< Gigabit Ethernet port type */
TA66XX_BC_GBE_PORT_LINK_STATUS link_status; /**< Gigabit Ethernet port link status */
uint8_t mac_address[6]; /**< MAC (physical) address of the port */
} TA66XX_BC_GBE_PORT_DD;
// T-AMC Gigabit Ethernet port data descriptor length in bytes
#define TA66XX_BC_GBE_PORT_DD_LEN sizeof(TA66XX_BC_GBE_PORT_DD)
/** IP address string max size in bytes*/
#define TA66XX_BC_IP_ADDRESS_LEN_MAX 16
/** Host name max size in bytes*/
#define TA66XX_BC_HOSTNAME_LEN_MAX 256
/** Static IP configuration */
#define TA66XX_BC_IP_CFG_TYPE_STATIC 0
/** Dynamic (DHCP) IP configuration */
#define TA66XX_BC_IP_CFG_TYPE_DYNAMIC 1
/*------------ TA66XX_BC_init_gbe_port() function ------------------------*//**
* @brief Function initializes selected DSP Gigabit Ethernet port
*
* @param[in] port - DSP Gigabit Ethernet port number
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_init_gbe_port(uint32_t port);
/*------------ TA66XX_BC_get_gbe_port_info() function --------------------*//**
* @brief Function returns Gigabit Ethernet port info: port mode, MAC address,
* link status
*
* @param[in] port - Gigabit Ethernet port number for which port info should
* be returned
* @param[out] port_dd - pointer to a buffer to which Gigabit Ethernet port
* data descriptor should be returned
*
* @return Error code
*
-----------------------------------------------------------------------------*/
int32_t TA66XX_BC_get_gbe_port_info(uint32_t port, TA66XX_BC_GBE_PORT_DD *port_dd);
/** @}*/
//=============================================================================
#ifdef __cplusplus
}
#endif
//=============================================================================
#endif /* __TA66XX_BC_DSP_BC_FUNCTIONS_HXX__ */
|