summaryrefslogtreecommitdiff
path: root/docs/Driver/html/group__mci__interface__gr.html
blob: c5d8a1482428544df874178b8590d98177b0e02b (plain)
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
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>MCI Interface</title>
<title>CMSIS-Driver: MCI Interface</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="printComponentTabs.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 46px;">
  <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">CMSIS-Driver
   &#160;<span id="projectnumber">Version 2.7.1</span>
   </div>
   <div id="projectbrief">Peripheral Interface for Middleware and Application Code</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
    <ul class="tablist">
      <script type="text/javascript">
		<!--
		writeComponentTabs.call(this);
		//-->
      </script>
	  </ul>
</div>
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
      <li><a href="modules.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__mci__interface__gr.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">Content</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">MCI Interface</div>  </div>
</div><!--header-->
<div class="contents">

<p>Driver API for Memory Card Interface using SD/MMC interface (Driver_MCI.h)  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Content</h2></td></tr>
<tr class="memitem:group__mci__event__gr"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__event__gr.html">MCI Events</a></td></tr>
<tr class="memdesc:group__mci__event__gr"><td class="mdescLeft">&#160;</td><td class="mdescRight">The MCI driver generates call back events that are notified via the function <a class="el" href="group__mci__interface__gr.html#gaac2dbd1c1a98436938c5d0d6248cb700">ARM_MCI_SignalEvent</a>. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__mci__control__gr"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__control__gr.html">MCI Control Codes</a></td></tr>
<tr class="memdesc:group__mci__control__gr"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure and control the MCI using the <a class="el" href="group__mci__interface__gr.html#gaec0506a2aa4ae75cf6bc02528f36fe30">ARM_MCI_Control</a>. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__mci__send__command__flags__ctrls"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__send__command__flags__ctrls.html">MCI Send Command Flags</a></td></tr>
<tr class="memdesc:group__mci__send__command__flags__ctrls"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specify various options for sending commands to the card and the expected response. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__mci__transfer__ctrls"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__transfer__ctrls.html">MCI Transfer Controls</a></td></tr>
<tr class="memdesc:group__mci__transfer__ctrls"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specify data transfer mode. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__mci__card__power__ctrls"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__card__power__ctrls.html">MCI Card Power Controls</a></td></tr>
<tr class="memdesc:group__mci__card__power__ctrls"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specify Memory Card Power supply voltage. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structARM__DRIVER__MCI"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a></td></tr>
<tr class="memdesc:structARM__DRIVER__MCI"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access structure of the MCI Driver.  <a href="group__mci__interface__gr.html#structARM__DRIVER__MCI">More...</a><br/></td></tr>
<tr class="separator:structARM__DRIVER__MCI"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structARM__MCI__CAPABILITIES"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#structARM__MCI__CAPABILITIES">ARM_MCI_CAPABILITIES</a></td></tr>
<tr class="memdesc:structARM__MCI__CAPABILITIES"><td class="mdescLeft">&#160;</td><td class="mdescRight">MCI Driver Capabilities.  <a href="group__mci__interface__gr.html#structARM__MCI__CAPABILITIES">More...</a><br/></td></tr>
<tr class="separator:structARM__MCI__CAPABILITIES"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structARM__MCI__STATUS"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#structARM__MCI__STATUS">ARM_MCI_STATUS</a></td></tr>
<tr class="memdesc:structARM__MCI__STATUS"><td class="mdescLeft">&#160;</td><td class="mdescRight">MCI Status.  <a href="group__mci__interface__gr.html#structARM__MCI__STATUS">More...</a><br/></td></tr>
<tr class="separator:structARM__MCI__STATUS"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga0d14651f6788c1ffd81544602565faf1"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#ga0d14651f6788c1ffd81544602565faf1">ARM_MCI_SignalEvent_t</a> )(uint32_t event)</td></tr>
<tr class="memdesc:ga0d14651f6788c1ffd81544602565faf1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#gaac2dbd1c1a98436938c5d0d6248cb700">ARM_MCI_SignalEvent</a> : Signal MCI Card Event.  <a href="#ga0d14651f6788c1ffd81544602565faf1">More...</a><br/></td></tr>
<tr class="separator:ga0d14651f6788c1ffd81544602565faf1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga3418183015dbf3025b94eebaedb00ab1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#ga3418183015dbf3025b94eebaedb00ab1">ARM_MCI_GetVersion</a> (void)</td></tr>
<tr class="memdesc:ga3418183015dbf3025b94eebaedb00ab1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get driver version.  <a href="#ga3418183015dbf3025b94eebaedb00ab1">More...</a><br/></td></tr>
<tr class="separator:ga3418183015dbf3025b94eebaedb00ab1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7e5a78b6e6409189833a0b72a0a3c48a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__mci__interface__gr.html#structARM__MCI__CAPABILITIES">ARM_MCI_CAPABILITIES</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#ga7e5a78b6e6409189833a0b72a0a3c48a">ARM_MCI_GetCapabilities</a> (void)</td></tr>
<tr class="memdesc:ga7e5a78b6e6409189833a0b72a0a3c48a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get driver capabilities.  <a href="#ga7e5a78b6e6409189833a0b72a0a3c48a">More...</a><br/></td></tr>
<tr class="separator:ga7e5a78b6e6409189833a0b72a0a3c48a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6f34d4ab362e596ddaf23aac093268cf"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#ga6f34d4ab362e596ddaf23aac093268cf">ARM_MCI_Initialize</a> (<a class="el" href="group__mci__interface__gr.html#ga0d14651f6788c1ffd81544602565faf1">ARM_MCI_SignalEvent_t</a> cb_event)</td></tr>
<tr class="memdesc:ga6f34d4ab362e596ddaf23aac093268cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the Memory Card Interface.  <a href="#ga6f34d4ab362e596ddaf23aac093268cf">More...</a><br/></td></tr>
<tr class="separator:ga6f34d4ab362e596ddaf23aac093268cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaef8183e77797e74997551d03646d42c2"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#gaef8183e77797e74997551d03646d42c2">ARM_MCI_Uninitialize</a> (void)</td></tr>
<tr class="memdesc:gaef8183e77797e74997551d03646d42c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">De-initialize Memory Card Interface.  <a href="#gaef8183e77797e74997551d03646d42c2">More...</a><br/></td></tr>
<tr class="separator:gaef8183e77797e74997551d03646d42c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga19752749d04ed22dc91c4294645e0244"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#ga19752749d04ed22dc91c4294645e0244">ARM_MCI_PowerControl</a> (<a class="el" href="group__common__drv__gr.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5">ARM_POWER_STATE</a> state)</td></tr>
<tr class="memdesc:ga19752749d04ed22dc91c4294645e0244"><td class="mdescLeft">&#160;</td><td class="mdescRight">Control Memory Card Interface Power.  <a href="#ga19752749d04ed22dc91c4294645e0244">More...</a><br/></td></tr>
<tr class="separator:ga19752749d04ed22dc91c4294645e0244"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab161f80e0eda2815f3e0ebbba1314ff0"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#gab161f80e0eda2815f3e0ebbba1314ff0">ARM_MCI_CardPower</a> (uint32_t voltage)</td></tr>
<tr class="memdesc:gab161f80e0eda2815f3e0ebbba1314ff0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set Memory Card Power supply voltage.  <a href="#gab161f80e0eda2815f3e0ebbba1314ff0">More...</a><br/></td></tr>
<tr class="separator:gab161f80e0eda2815f3e0ebbba1314ff0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga012fca8f1ce5366fce14b708c771c635"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#ga012fca8f1ce5366fce14b708c771c635">ARM_MCI_ReadCD</a> (void)</td></tr>
<tr class="memdesc:ga012fca8f1ce5366fce14b708c771c635"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read Card Detect (CD) state.  <a href="#ga012fca8f1ce5366fce14b708c771c635">More...</a><br/></td></tr>
<tr class="separator:ga012fca8f1ce5366fce14b708c771c635"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d70286918405ac81fa795c7d09dc6fd"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#ga3d70286918405ac81fa795c7d09dc6fd">ARM_MCI_ReadWP</a> (void)</td></tr>
<tr class="memdesc:ga3d70286918405ac81fa795c7d09dc6fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read Write Protect (WP) state.  <a href="#ga3d70286918405ac81fa795c7d09dc6fd">More...</a><br/></td></tr>
<tr class="separator:ga3d70286918405ac81fa795c7d09dc6fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5a431da89feabc2b4bc0c27943dff6f2"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#ga5a431da89feabc2b4bc0c27943dff6f2">ARM_MCI_SendCommand</a> (uint32_t cmd, uint32_t arg, uint32_t flags, uint32_t *response)</td></tr>
<tr class="memdesc:ga5a431da89feabc2b4bc0c27943dff6f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send Command to card and get the response.  <a href="#ga5a431da89feabc2b4bc0c27943dff6f2">More...</a><br/></td></tr>
<tr class="separator:ga5a431da89feabc2b4bc0c27943dff6f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaec681bcd8e6811c5743e33ee0f35ed1"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#gaaec681bcd8e6811c5743e33ee0f35ed1">ARM_MCI_SetupTransfer</a> (uint8_t *data, uint32_t block_count, uint32_t block_size, uint32_t mode)</td></tr>
<tr class="memdesc:gaaec681bcd8e6811c5743e33ee0f35ed1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Setup read or write transfer operation.  <a href="#gaaec681bcd8e6811c5743e33ee0f35ed1">More...</a><br/></td></tr>
<tr class="separator:gaaec681bcd8e6811c5743e33ee0f35ed1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3dfcf7b7186b711f9b63a096be816fe5"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#ga3dfcf7b7186b711f9b63a096be816fe5">ARM_MCI_AbortTransfer</a> (void)</td></tr>
<tr class="memdesc:ga3dfcf7b7186b711f9b63a096be816fe5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Abort current read/write data transfer.  <a href="#ga3dfcf7b7186b711f9b63a096be816fe5">More...</a><br/></td></tr>
<tr class="separator:ga3dfcf7b7186b711f9b63a096be816fe5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaec0506a2aa4ae75cf6bc02528f36fe30"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#gaec0506a2aa4ae75cf6bc02528f36fe30">ARM_MCI_Control</a> (uint32_t control, uint32_t arg)</td></tr>
<tr class="memdesc:gaec0506a2aa4ae75cf6bc02528f36fe30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Control MCI Interface.  <a href="#gaec0506a2aa4ae75cf6bc02528f36fe30">More...</a><br/></td></tr>
<tr class="separator:gaec0506a2aa4ae75cf6bc02528f36fe30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8d61aa42ce78d1864fa928c1f273cbd9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__mci__interface__gr.html#structARM__MCI__STATUS">ARM_MCI_STATUS</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#ga8d61aa42ce78d1864fa928c1f273cbd9">ARM_MCI_GetStatus</a> (void)</td></tr>
<tr class="memdesc:ga8d61aa42ce78d1864fa928c1f273cbd9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get MCI status.  <a href="#ga8d61aa42ce78d1864fa928c1f273cbd9">More...</a><br/></td></tr>
<tr class="separator:ga8d61aa42ce78d1864fa928c1f273cbd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaac2dbd1c1a98436938c5d0d6248cb700"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#gaac2dbd1c1a98436938c5d0d6248cb700">ARM_MCI_SignalEvent</a> (uint32_t event)</td></tr>
<tr class="memdesc:gaac2dbd1c1a98436938c5d0d6248cb700"><td class="mdescLeft">&#160;</td><td class="mdescRight">Callback function that signals a MCI Card Event.  <a href="#gaac2dbd1c1a98436938c5d0d6248cb700">More...</a><br/></td></tr>
<tr class="separator:gaac2dbd1c1a98436938c5d0d6248cb700"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
<p>Driver API for Memory Card Interface using SD/MMC interface (Driver_MCI.h) </p>
<p>The <b>Memory Card Interface</b> (MCI) implements the hardware abstraction layer for Secure Digital (SD) and Multi Media Card (MMC) memory that is typically used as file storage. For embedded systems, SD/MMC devices are available as memory cards in several forms (SD, miniSD, microSD, MMC, MMCmicro) or as non-removable devic es that are directly soldered to the PCB (eMMC).</p>
<p><b>References:</b> </p>
<ul>
<li>Wikipedia offers more information about the <a href="http://en.wikipedia.org/wiki/SD_card" target="_blank"><b>Secure Digital</b> memory</a>.</li>
<li>Wikipedia offers more information about the <a href="http://en.wikipedia.org/wiki/MultiMediaCard" target="_blank"><b>MultiMediaCard</b></a>.</li>
<li>The SD Association provides detailed documentation under <a href="http://www.sdcard.org">www.sdcard.org</a>.</li>
<li>The MultiMediaCard Association (merged with JEDEC) provides detailed documentation under <a href="http://www.jedec.org">www.jedec.org</a>.</li>
</ul>
<p><b>Block Diagram</b></p>
<p>The MCI driver allows you to exchange data of the SD/MMC memory via SD/MMC interface.</p>
<p>The following modes are supported by SD/MMC memory cards:</p>
<ul>
<li>SPI bus mode: Serial Peripheral Interface Bus supported by most microcontrollers.</li>
<li>1-bit SD/MMC Bus mode: proprietary data transfer protocol supported by SD/MMC interfaces.</li>
<li>4-bit SD/MMC Bus mode: high-speed version of the SD/MMC interface using 4 data I/O pins.</li>
<li>8-bit SD/MMC Bus mode: high-speed version of the SD/MMC interface using 8 data I/O pins.</li>
</ul>
<div class="image">
<img src="SPI_BusMode.png" alt="SPI_BusMode.png"/>
<div class="caption">
SD memory connected via SPI interface</div></div>
<p>&#160;</p>
<div class="image">
<img src="SD_1BitBusMode.png" alt="SD_1BitBusMode.png"/>
<div class="caption">
SD memory connected via 1-bit SD Bus Mode</div></div>
<p>&#160;</p>
<div class="image">
<img src="SD_4BitBusMode.png" alt="SD_4BitBusMode.png"/>
<div class="caption">
SD memory connected via 4-bit SD Bus Mode</div></div>
<p><b>MCI API</b></p>
<p>The following header files define the Application Programming Interface (API) for the MCI interface:</p>
<ul>
<li><b>Driver_MCI.h</b> : Driver API for Memory Card Interface using SD/MMC interface</li>
</ul>
<p>The driver implementation is a typical part of the Device Family Pack (DFP) that supports the peripherals of the microcontroller family.</p>
<dl class="section note"><dt>Note</dt><dd>For parameters, the value marked with (default) is the setting after the driver initialization.</dd></dl>
<p><b>Driver Functions</b></p>
<p>The driver functions are published in the access struct as explained in <a class="el" href="theoryOperation.html#DriverFunctions">Common Driver Functions</a></p>
<ul>
<li><a class="el" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> : access struct for MCI driver functions</li>
</ul>
<p><b>Example Code</b></p>
<p>The following example code shows the usage of the MCI interface.</p>
<div class="fragment"><div class="line"></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="Driver__MCI_8h.html">Driver_MCI.h</a>&quot;</span></div>
<div class="line"></div>
<div class="line"></div>
<div class="line"><span class="comment">/* Usage example: ARM_MCI_Initialize ----------------------------------------*/</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// ARM_MCI_SignalEvent callback function prototype</span></div>
<div class="line"><span class="keywordtype">void</span> MCI_SignalEvent_Callback (uint32_t event);</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> init_driver (<a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> *drv) {</div>
<div class="line">  int32_t status;</div>
<div class="line">  </div>
<div class="line">  status = drv-&gt;<a class="code" href="group__mci__interface__gr.html#ae51ec82c310aff0edda6220f9ebfd822">Initialize</a> (&amp;MCI_SignalEvent_Callback);</div>
<div class="line">  </div>
<div class="line">  <span class="keywordflow">if</span> (status != <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) {</div>
<div class="line">    <span class="comment">// Initialization and event callback registration failed</span></div>
<div class="line">  }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Usage example: ARM_MCI_Uninitialize --------------------------------------*/</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> uninit_driver (<a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> *drv) {</div>
<div class="line">  int32_t status;</div>
<div class="line">  </div>
<div class="line">  status = drv-&gt;<a class="code" href="group__mci__interface__gr.html#adcf20681a1402869ecb5c6447fada17b">Uninitialize</a> ();</div>
<div class="line">  </div>
<div class="line">  <span class="keywordflow">if</span> (status == <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) {</div>
<div class="line">    <span class="comment">// Driver successfully uninitialized</span></div>
<div class="line">  }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Usage example: ARM_MCI_PowerControl --------------------------------------*/</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> control_driver_power (<a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> *drv, <span class="keywordtype">bool</span> enable) {</div>
<div class="line">  int32_t status;</div>
<div class="line">  </div>
<div class="line">  <span class="keywordflow">if</span> (enable == <span class="keyword">true</span>) {</div>
<div class="line">    status = drv-&gt;<a class="code" href="group__mci__interface__gr.html#aba8f1c8019af95ffe19c32403e3240ef">PowerControl</a> (<a class="code" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5abed52b77a9ce4775570e44a842b1295e">ARM_POWER_FULL</a>);</div>
<div class="line">  }</div>
<div class="line">  <span class="keywordflow">else</span> {</div>
<div class="line">    status = drv-&gt;<a class="code" href="group__mci__interface__gr.html#aba8f1c8019af95ffe19c32403e3240ef">PowerControl</a> (<a class="code" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5ab6f5becc85ebd51c3dd2524a95d2ca35">ARM_POWER_OFF</a>);</div>
<div class="line">  }</div>
<div class="line">  </div>
<div class="line">  <span class="keywordflow">if</span> (status == <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) {</div>
<div class="line">    <span class="comment">// Driver power enabled/disabled</span></div>
<div class="line">  }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Usage example: ARM_MCI_CardPower -----------------------------------------*/</span></div>
<div class="line"></div>
<div class="line"><a class="code" href="group__mci__interface__gr.html#structARM__MCI__CAPABILITIES">ARM_MCI_CAPABILITIES</a> drv_capabilities;</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> set_card_vdd_3v3 (<a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> *drv) {</div>
<div class="line">  int32_t status;</div>
<div class="line">  </div>
<div class="line">  <span class="keywordflow">if</span> (drv_capabilities.<a class="code" href="group__mci__interface__gr.html#a414baec222a72be862e262f02b821dce">vdd</a> == 1U) {</div>
<div class="line">    <span class="comment">// Power switching to 3.3V supported</span></div>
<div class="line">    status = drv-&gt;<a class="code" href="group__mci__interface__gr.html#a73334c737658b227ef3097343d5c78bb">CardPower</a> (<a class="code" href="group__mci__card__power__ctrls.html#ga565ecd36c8d0379fb4172da577cc540d">ARM_MCI_POWER_VDD_3V3</a>);</div>
<div class="line">    </div>
<div class="line">    <span class="keywordflow">if</span> (status == <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) {</div>
<div class="line">      <span class="comment">// Card power set to 3.3V</span></div>
<div class="line">    }</div>
<div class="line">  }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Usage example: ARM_MCI_ReadCD --------------------------------------------*/</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> read_card_detect_state (<a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> *drv) {</div>
<div class="line">  int32_t status;</div>
<div class="line">  </div>
<div class="line">  status = drv-&gt;<a class="code" href="group__mci__interface__gr.html#aa4285dd6b0f9b8ca41b6710a478ad641">ReadCD</a>();</div>
<div class="line">  </div>
<div class="line">  <span class="keywordflow">if</span> (status == 1) {</div>
<div class="line">    <span class="comment">// Memory card is detected</span></div>
<div class="line">  }</div>
<div class="line">  <span class="keywordflow">else</span> {</div>
<div class="line">    <span class="keywordflow">if</span> (status == 0) {</div>
<div class="line">      <span class="comment">// Memory card is not detected</span></div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">else</span> {</div>
<div class="line">      <span class="comment">// Error reading card detect pin state</span></div>
<div class="line">    }</div>
<div class="line">  }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Usage example: ARM_MCI_ReadWP --------------------------------------------*/</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> read_write_protect_state (<a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> *drv) {</div>
<div class="line">  int32_t status;</div>
<div class="line">  </div>
<div class="line">  status = drv-&gt;<a class="code" href="group__mci__interface__gr.html#aee6f8b38f83a51ac05cc4841524b708d">ReadWP</a>();</div>
<div class="line">  </div>
<div class="line">  <span class="keywordflow">if</span> (status == 1) {</div>
<div class="line">    <span class="comment">// Memory card write protection is enabled</span></div>
<div class="line">  }</div>
<div class="line">  <span class="keywordflow">else</span> {</div>
<div class="line">    <span class="keywordflow">if</span> (status == 0) {</div>
<div class="line">      <span class="comment">// Memory card write protection is disabled</span></div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">else</span> {</div>
<div class="line">      <span class="comment">// Error reading write protect pin state</span></div>
<div class="line">    }</div>
<div class="line">  }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Usage example: ARM_MCI_SendCommand ---------------------------------------*/</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">volatile</span> uint32_t MCI_Events;</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> MCI_SignalEvent_Callback (uint32_t event) {</div>
<div class="line">  <span class="comment">// Save current event</span></div>
<div class="line">  MCI_Events |= event;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> send_CMD0 (<a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> *drv) {</div>
<div class="line">  int32_t  status;</div>
<div class="line">  uint32_t cmd;</div>
<div class="line"></div>
<div class="line">  MCI_Events = 0U; <span class="comment">//Clear MCI driver event flags</span></div>
<div class="line">  cmd = 0U;        <span class="comment">// Set GO_IDLE_STATE command code</span></div>
<div class="line"></div>
<div class="line">  status = drv-&gt;<a class="code" href="group__mci__interface__gr.html#affefb5c1d352082933c2fb0620b37212">SendCommand</a> (cmd, 0U, <a class="code" href="group__mci__send__command__flags__ctrls.html#ga81606bd94ce782e2c3764b913f929f60">ARM_MCI_CARD_INITIALIZE</a> | <a class="code" href="group__mci__send__command__flags__ctrls.html#ga70934cef80884e8c75fb4eebf8452118">ARM_MCI_RESPONSE_NONE</a>, NULL);</div>
<div class="line"></div>
<div class="line">  <span class="keywordflow">if</span> (status == <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) {</div>
<div class="line">    <span class="comment">/* Wait for event */</span></div>
<div class="line">    <span class="keywordflow">while</span> ((MCI_Events &amp; <a class="code" href="group__mci__event__gr.html#gae69356c75d55103d93ef91ac1bc02b49">ARM_MCI_EVENT_COMMAND_COMPLETE</a>) == 0U);</div>
<div class="line">    <span class="comment">// Command was successfully sent to memory card</span></div>
<div class="line">    <span class="comment">// ..</span></div>
<div class="line">  }</div>
<div class="line">  <span class="keywordflow">else</span> {</div>
<div class="line">    <span class="comment">// Error</span></div>
<div class="line">  }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Usage example: ARM_MCI_SetupTransfer -------------------------------------*/</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">volatile</span> uint32_t MCI_Events;</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> MCI_SignalEvent_Callback (uint32_t event) {</div>
<div class="line">  MCI_Events |= event;  <span class="comment">// Save current event</span></div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> read_sector (<a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> *drv, uint8_t *buf, uint32_t sz) {</div>
<div class="line">  int32_t status;</div>
<div class="line">  uint32_t cmd, arg;</div>
<div class="line">  uint32_t resp;</div>
<div class="line"></div>
<div class="line">  <span class="keywordflow">if</span> (sz &lt; 512U) {</div>
<div class="line">    <span class="comment">// Invalid buffer size, sector consists of 512 bytes</span></div>
<div class="line">    <span class="comment">//...</span></div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  status = drv-&gt;<a class="code" href="group__mci__interface__gr.html#adc63bab660e8304d78faa1ac429e792b">SetupTransfer</a> (buf, 1U, 512U, <a class="code" href="group__mci__transfer__ctrls.html#gaa6f3be235a9dce5c66be8fe64f399846">ARM_MCI_TRANSFER_READ</a> | <a class="code" href="group__mci__transfer__ctrls.html#ga4ced782e7c0c70d5f0edbddd1e48323b">ARM_MCI_TRANSFER_BLOCK</a>);</div>
<div class="line"></div>
<div class="line">  <span class="keywordflow">if</span> (status == <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) {</div>
<div class="line">    MCI_Events = 0U; <span class="comment">//Clear MCI driver event flags</span></div>
<div class="line"></div>
<div class="line">    cmd = 17U;       <span class="comment">// Set READ_SINGLE_BLOCK command</span></div>
<div class="line">    arg = 0U;        <span class="comment">// Set sector number</span></div>
<div class="line"></div>
<div class="line">    status  = drv-&gt;<a class="code" href="group__mci__interface__gr.html#affefb5c1d352082933c2fb0620b37212">SendCommand</a> (cmd, arg, <a class="code" href="group__mci__send__command__flags__ctrls.html#gaa5ddf1cf772b234e3c247039effd0e7b">ARM_MCI_RESPONSE_SHORT</a> | <a class="code" href="group__mci__send__command__flags__ctrls.html#ga6ab3f4c1a2bf0fdb81fbcf7a5698f2de">ARM_MCI_RESPONSE_CRC</a> | <a class="code" href="group__mci__send__command__flags__ctrls.html#ga8aa566f69aa74ed416213df6ca3267bd">ARM_MCI_TRANSFER_DATA</a>, &amp;resp);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (status == <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) {</div>
<div class="line">      <span class="comment">/* Wait for event */</span></div>
<div class="line">      <span class="keywordflow">while</span> ((MCI_Events &amp; <a class="code" href="group__mci__event__gr.html#gae69356c75d55103d93ef91ac1bc02b49">ARM_MCI_EVENT_COMMAND_COMPLETE</a>) == 0U);</div>
<div class="line">      <span class="comment">// Command was successfully sent to memory card</span></div>
<div class="line">      <span class="keywordflow">if</span> ((resp &amp; 0x03U) == 0U) {</div>
<div class="line">        <span class="comment">// Sector number is valid, wait until data transfer completes</span></div>
<div class="line">        <span class="keywordflow">while</span> ((MCI_Events &amp; <a class="code" href="group__mci__event__gr.html#gabc3c468dedaed890683360f2c5c65bea">ARM_MCI_EVENT_TRANSFER_COMPLETE</a>) == 0U);</div>
<div class="line">        <span class="comment">// Data was successfully read from memory card</span></div>
<div class="line">        <span class="comment">// ...</span></div>
<div class="line">      }</div>
<div class="line">    }</div>
<div class="line">  }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Usage example: ARM_MCI_AbortTransfer -------------------------------------*/</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> abort_data_transfer (<a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> *drv) {</div>
<div class="line">  <a class="code" href="group__mci__interface__gr.html#structARM__MCI__STATUS">ARM_MCI_STATUS</a> drv_status;</div>
<div class="line"></div>
<div class="line">  drv_status = drv-&gt;<a class="code" href="group__mci__interface__gr.html#a2dc63353d6869c0ea2d3d29155c88b49">GetStatus</a>();</div>
<div class="line">  </div>
<div class="line">  <span class="keywordflow">if</span> (drv_status.<a class="code" href="group__mci__interface__gr.html#a2655d3422b720097b091a28e8bbcea8f">transfer_active</a> == 1U) {</div>
<div class="line">    <span class="comment">// Data transfer is active, abort the transfer</span></div>
<div class="line">    <span class="keywordflow">if</span> (drv-&gt;<a class="code" href="group__mci__interface__gr.html#afa8103cc20ba96420b7471455bbb87e4">AbortTransfer</a>() == <a class="code" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) {</div>
<div class="line">      <span class="comment">// Transfer aborted</span></div>
<div class="line">      <span class="comment">// ...</span></div>
<div class="line">    }</div>
<div class="line">  }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Usage example: ARM_MCI_GetStatus -----------------------------------------*/</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> check_transfer_status (<a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> *drv) {</div>
<div class="line">  <a class="code" href="group__mci__interface__gr.html#structARM__MCI__STATUS">ARM_MCI_STATUS</a> drv_status;</div>
<div class="line"></div>
<div class="line">  drv_status = drv-&gt;<a class="code" href="group__mci__interface__gr.html#a2dc63353d6869c0ea2d3d29155c88b49">GetStatus</a>();</div>
<div class="line"></div>
<div class="line">  <span class="keywordflow">if</span> (drv_status.<a class="code" href="group__mci__interface__gr.html#a2655d3422b720097b091a28e8bbcea8f">transfer_active</a> == 1U) {</div>
<div class="line">    <span class="comment">// Data transfer is active</span></div>
<div class="line">  }</div>
<div class="line">  </div>
<div class="line">  <span class="keywordflow">if</span> (drv_status.<a class="code" href="group__mci__interface__gr.html#a598ae4a196316d6dcb97d07fd337ecdd">transfer_timeout</a> == 1U) {</div>
<div class="line">    <span class="comment">// Data not received, timeout expired</span></div>
<div class="line">  }</div>
<div class="line">  </div>
<div class="line">  <span class="keywordflow">if</span> (drv_status.<a class="code" href="group__mci__interface__gr.html#a21d4bc1a03e161bd33693619039a6afa">transfer_error</a> == 1U) {</div>
<div class="line">    <span class="comment">// Data transfer ended with error</span></div>
<div class="line">  }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* Usage example: ARM_MCI_SignalEvent ---------------------------------------*/</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> MCI_SignalEvent_Callback (uint32_t event) {</div>
<div class="line">  <span class="keywordflow">if</span> ((event &amp; <a class="code" href="group__mci__event__gr.html#gae2cf8ef238c092e94e96a01602f3a23c">ARM_MCI_EVENT_CARD_INSERTED</a>) != 0U) {</div>
<div class="line">    <span class="comment">// Memory card was inserted into socket</span></div>
<div class="line">  }</div>
<div class="line">  <span class="keywordflow">if</span> ((event &amp; <a class="code" href="group__mci__event__gr.html#ga92ba748f9324ec13898f10456f17c8cc">ARM_MCI_EVENT_CARD_REMOVED</a>) != 0U) {</div>
<div class="line">    <span class="comment">// Memory card was removed from socket</span></div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="keywordflow">if</span> ((event &amp; ARM_MCI_EVENT_COMMAND_COMPLETE) != 0U) {</div>
<div class="line">    <span class="comment">// Command was successfully sent to memory card</span></div>
<div class="line">  }</div>
<div class="line">  <span class="keywordflow">if</span> ((event &amp; <a class="code" href="group__mci__event__gr.html#gab79b3ab4dcd03c38df1e173fa903d822">ARM_MCI_EVENT_COMMAND_TIMEOUT</a>) != 0U) {</div>
<div class="line">    <span class="comment">// Command response was not received in time</span></div>
<div class="line">  }</div>
<div class="line">  <span class="keywordflow">if</span> ((event &amp; <a class="code" href="group__mci__event__gr.html#ga373aeb3eca0e4c6d159312488a130442">ARM_MCI_EVENT_COMMAND_ERROR</a>) != 0U) {</div>
<div class="line">    <span class="comment">// Command response was invalid</span></div>
<div class="line">  }</div>
<div class="line"></div>
<div class="line">  <span class="keywordflow">if</span> ((event &amp; <a class="code" href="group__mci__event__gr.html#gabc3c468dedaed890683360f2c5c65bea">ARM_MCI_EVENT_TRANSFER_COMPLETE</a>) != 0U) {</div>
<div class="line">    <span class="comment">// Data successfully transferred from/to memory card</span></div>
<div class="line">  }</div>
<div class="line">  <span class="keywordflow">if</span> ((event &amp; <a class="code" href="group__mci__event__gr.html#ga614e7c7226adbaa8ec4165bf8b87ef27">ARM_MCI_EVENT_TRANSFER_TIMEOUT</a>) != 0U) {</div>
<div class="line">    <span class="comment">// Data not transferred from/to memory card, timeout expired</span></div>
<div class="line">  }</div>
<div class="line">  <span class="keywordflow">if</span> ((event &amp; <a class="code" href="group__mci__event__gr.html#ga5d2cee5ba6d0e40ad505983155706c29">ARM_MCI_EVENT_TRANSFER_ERROR</a>) != 0U) {</div>
<div class="line">    <span class="comment">// Data transfer ended with errors</span></div>
<div class="line">  }</div>
<div class="line">  </div>
<div class="line">  <span class="keywordflow">if</span> ((event &amp; <a class="code" href="group__mci__event__gr.html#ga75a050fdfe04e6816e96c938d6a6c197">ARM_MCI_EVENT_SDIO_INTERRUPT</a>) != 0U) {</div>
<div class="line">    <span class="comment">// SD I/O card sent interrupt request</span></div>
<div class="line">  }</div>
<div class="line">  </div>
<div class="line">  <span class="keywordflow">if</span> ((event &amp; <a class="code" href="group__mci__event__gr.html#ga8161f3960ddf2a3cdc3c4c83148c6099">ARM_MCI_EVENT_CCS</a>) != 0U) {</div>
<div class="line">    <span class="comment">// CE-ATA command completion signal received</span></div>
<div class="line">  }</div>
<div class="line">  <span class="keywordflow">if</span> ((event &amp; <a class="code" href="group__mci__event__gr.html#gafa8cbcd597a05c64901eeb777cc0b74f">ARM_MCI_EVENT_CCS_TIMEOUT</a>) != 0U) {</div>
<div class="line">    <span class="comment">// CE-ATA command completion signal wait timeout expired</span></div>
<div class="line">  }</div>
<div class="line">}</div>
</div><!-- fragment --> <hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structARM__DRIVER__MCI" id="structARM__DRIVER__MCI"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct ARM_DRIVER_MCI</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>Access structure of the MCI Driver. </p>
<p>The functions of the MCI are accessed by function pointers exposed by this structure. Refer to <a class="el" href="theoryOperation.html#DriverFunctions">Common Driver Functions</a> for overview information.</p>
<p>Each instance of an MCI provides such an access structure. The instance is identified by a postfix number in the symbol name of the access structure, for example:</p>
<ul>
<li><b>Driver_MCI0</b> is the name of the access struct of the first instance (no. 0).</li>
<li><b>Driver_MCI1</b> is the name of the access struct of the second instance (no. 1).</li>
</ul>
<p>A configuration setting in the middleware allows connecting the middleware to a specific driver instance <b>Driver_MCI<em>n</em></b>. The default is <span class="XML-Token">0</span>, which connects a middleware to the first instance of a driver. </p>
</div><table class="memberdecls">
<tr><td colspan="2"><h3>Data Fields</h3></td></tr>
<tr class="memitem:a8834b281da48583845c044a81566c1b3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#a8834b281da48583845c044a81566c1b3">GetVersion</a> )(void)</td></tr>
<tr class="memdesc:a8834b281da48583845c044a81566c1b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#ga3418183015dbf3025b94eebaedb00ab1">ARM_MCI_GetVersion</a> : Get driver version.  <a href="#a8834b281da48583845c044a81566c1b3">More...</a><br/></td></tr>
<tr class="separator:a8834b281da48583845c044a81566c1b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5648b4224e0346ba5e20fefc7e83aee8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__mci__interface__gr.html#structARM__MCI__CAPABILITIES">ARM_MCI_CAPABILITIES</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#a5648b4224e0346ba5e20fefc7e83aee8">GetCapabilities</a> )(void)</td></tr>
<tr class="memdesc:a5648b4224e0346ba5e20fefc7e83aee8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#ga7e5a78b6e6409189833a0b72a0a3c48a">ARM_MCI_GetCapabilities</a> : Get driver capabilities.  <a href="#a5648b4224e0346ba5e20fefc7e83aee8">More...</a><br/></td></tr>
<tr class="separator:a5648b4224e0346ba5e20fefc7e83aee8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae51ec82c310aff0edda6220f9ebfd822"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#ae51ec82c310aff0edda6220f9ebfd822">Initialize</a> )(<a class="el" href="group__mci__interface__gr.html#ga0d14651f6788c1ffd81544602565faf1">ARM_MCI_SignalEvent_t</a> cb_event)</td></tr>
<tr class="memdesc:ae51ec82c310aff0edda6220f9ebfd822"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#ga6f34d4ab362e596ddaf23aac093268cf">ARM_MCI_Initialize</a> : Initialize MCI Interface.  <a href="#ae51ec82c310aff0edda6220f9ebfd822">More...</a><br/></td></tr>
<tr class="separator:ae51ec82c310aff0edda6220f9ebfd822"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adcf20681a1402869ecb5c6447fada17b"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#adcf20681a1402869ecb5c6447fada17b">Uninitialize</a> )(void)</td></tr>
<tr class="memdesc:adcf20681a1402869ecb5c6447fada17b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#gaef8183e77797e74997551d03646d42c2">ARM_MCI_Uninitialize</a> : De-initialize MCI Interface.  <a href="#adcf20681a1402869ecb5c6447fada17b">More...</a><br/></td></tr>
<tr class="separator:adcf20681a1402869ecb5c6447fada17b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba8f1c8019af95ffe19c32403e3240ef"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#aba8f1c8019af95ffe19c32403e3240ef">PowerControl</a> )(<a class="el" href="group__common__drv__gr.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5">ARM_POWER_STATE</a> state)</td></tr>
<tr class="memdesc:aba8f1c8019af95ffe19c32403e3240ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#ga19752749d04ed22dc91c4294645e0244">ARM_MCI_PowerControl</a> : Control MCI Interface Power.  <a href="#aba8f1c8019af95ffe19c32403e3240ef">More...</a><br/></td></tr>
<tr class="separator:aba8f1c8019af95ffe19c32403e3240ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73334c737658b227ef3097343d5c78bb"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#a73334c737658b227ef3097343d5c78bb">CardPower</a> )(uint32_t voltage)</td></tr>
<tr class="memdesc:a73334c737658b227ef3097343d5c78bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#gab161f80e0eda2815f3e0ebbba1314ff0">ARM_MCI_CardPower</a> : Set card power supply voltage.  <a href="#a73334c737658b227ef3097343d5c78bb">More...</a><br/></td></tr>
<tr class="separator:a73334c737658b227ef3097343d5c78bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4285dd6b0f9b8ca41b6710a478ad641"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#aa4285dd6b0f9b8ca41b6710a478ad641">ReadCD</a> )(void)</td></tr>
<tr class="memdesc:aa4285dd6b0f9b8ca41b6710a478ad641"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#ga012fca8f1ce5366fce14b708c771c635">ARM_MCI_ReadCD</a> : Read Card Detect (CD) state.  <a href="#aa4285dd6b0f9b8ca41b6710a478ad641">More...</a><br/></td></tr>
<tr class="separator:aa4285dd6b0f9b8ca41b6710a478ad641"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee6f8b38f83a51ac05cc4841524b708d"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#aee6f8b38f83a51ac05cc4841524b708d">ReadWP</a> )(void)</td></tr>
<tr class="memdesc:aee6f8b38f83a51ac05cc4841524b708d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#ga3d70286918405ac81fa795c7d09dc6fd">ARM_MCI_ReadWP</a> : Read Write Protect (WP) state.  <a href="#aee6f8b38f83a51ac05cc4841524b708d">More...</a><br/></td></tr>
<tr class="separator:aee6f8b38f83a51ac05cc4841524b708d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:affefb5c1d352082933c2fb0620b37212"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#affefb5c1d352082933c2fb0620b37212">SendCommand</a> )(uint32_t cmd, uint32_t arg, uint32_t flags, uint32_t *response)</td></tr>
<tr class="memdesc:affefb5c1d352082933c2fb0620b37212"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#ga5a431da89feabc2b4bc0c27943dff6f2">ARM_MCI_SendCommand</a> : Send Command to card and get the response.  <a href="#affefb5c1d352082933c2fb0620b37212">More...</a><br/></td></tr>
<tr class="separator:affefb5c1d352082933c2fb0620b37212"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc63bab660e8304d78faa1ac429e792b"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#adc63bab660e8304d78faa1ac429e792b">SetupTransfer</a> )(uint8_t *data, uint32_t block_count, uint32_t block_size, uint32_t mode)</td></tr>
<tr class="memdesc:adc63bab660e8304d78faa1ac429e792b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#gaaec681bcd8e6811c5743e33ee0f35ed1">ARM_MCI_SetupTransfer</a> : Setup data transfer operation.  <a href="#adc63bab660e8304d78faa1ac429e792b">More...</a><br/></td></tr>
<tr class="separator:adc63bab660e8304d78faa1ac429e792b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa8103cc20ba96420b7471455bbb87e4"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#afa8103cc20ba96420b7471455bbb87e4">AbortTransfer</a> )(void)</td></tr>
<tr class="memdesc:afa8103cc20ba96420b7471455bbb87e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#ga3dfcf7b7186b711f9b63a096be816fe5">ARM_MCI_AbortTransfer</a> : Abort current data transfer.  <a href="#afa8103cc20ba96420b7471455bbb87e4">More...</a><br/></td></tr>
<tr class="separator:afa8103cc20ba96420b7471455bbb87e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e0f47a92f626a971c5197fca6545505"><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#a6e0f47a92f626a971c5197fca6545505">Control</a> )(uint32_t control, uint32_t arg)</td></tr>
<tr class="memdesc:a6e0f47a92f626a971c5197fca6545505"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#gaec0506a2aa4ae75cf6bc02528f36fe30">ARM_MCI_Control</a> : Control MCI Interface.  <a href="#a6e0f47a92f626a971c5197fca6545505">More...</a><br/></td></tr>
<tr class="separator:a6e0f47a92f626a971c5197fca6545505"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2dc63353d6869c0ea2d3d29155c88b49"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__mci__interface__gr.html#structARM__MCI__STATUS">ARM_MCI_STATUS</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mci__interface__gr.html#a2dc63353d6869c0ea2d3d29155c88b49">GetStatus</a> )(void)</td></tr>
<tr class="memdesc:a2dc63353d6869c0ea2d3d29155c88b49"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a class="el" href="group__mci__interface__gr.html#ga8d61aa42ce78d1864fa928c1f273cbd9">ARM_MCI_GetStatus</a> : Get MCI status.  <a href="#a2dc63353d6869c0ea2d3d29155c88b49">More...</a><br/></td></tr>
<tr class="separator:a2dc63353d6869c0ea2d3d29155c88b49"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h4 class="groupheader">Field Documentation</h4>
<a class="anchor" id="a8834b281da48583845c044a81566c1b3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a>(* GetVersion)(void)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#ga3418183015dbf3025b94eebaedb00ab1">ARM_MCI_GetVersion</a> : Get driver version. </p>

</div>
</div>
<a class="anchor" id="a5648b4224e0346ba5e20fefc7e83aee8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__mci__interface__gr.html#structARM__MCI__CAPABILITIES">ARM_MCI_CAPABILITIES</a>(* GetCapabilities)(void)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#ga7e5a78b6e6409189833a0b72a0a3c48a">ARM_MCI_GetCapabilities</a> : Get driver capabilities. </p>

</div>
</div>
<a class="anchor" id="ae51ec82c310aff0edda6220f9ebfd822"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t(* Initialize)(<a class="el" href="group__mci__interface__gr.html#ga0d14651f6788c1ffd81544602565faf1">ARM_MCI_SignalEvent_t</a> cb_event)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#ga6f34d4ab362e596ddaf23aac093268cf">ARM_MCI_Initialize</a> : Initialize MCI Interface. </p>

</div>
</div>
<a class="anchor" id="adcf20681a1402869ecb5c6447fada17b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t(* Uninitialize)(void)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#gaef8183e77797e74997551d03646d42c2">ARM_MCI_Uninitialize</a> : De-initialize MCI Interface. </p>

</div>
</div>
<a class="anchor" id="aba8f1c8019af95ffe19c32403e3240ef"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t(* PowerControl)(<a class="el" href="group__common__drv__gr.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5">ARM_POWER_STATE</a> state)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#ga19752749d04ed22dc91c4294645e0244">ARM_MCI_PowerControl</a> : Control MCI Interface Power. </p>

</div>
</div>
<a class="anchor" id="a73334c737658b227ef3097343d5c78bb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t(* CardPower)(uint32_t voltage)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#gab161f80e0eda2815f3e0ebbba1314ff0">ARM_MCI_CardPower</a> : Set card power supply voltage. </p>

</div>
</div>
<a class="anchor" id="aa4285dd6b0f9b8ca41b6710a478ad641"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t(* ReadCD)(void)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#ga012fca8f1ce5366fce14b708c771c635">ARM_MCI_ReadCD</a> : Read Card Detect (CD) state. </p>

</div>
</div>
<a class="anchor" id="aee6f8b38f83a51ac05cc4841524b708d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t(* ReadWP)(void)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#ga3d70286918405ac81fa795c7d09dc6fd">ARM_MCI_ReadWP</a> : Read Write Protect (WP) state. </p>

</div>
</div>
<a class="anchor" id="affefb5c1d352082933c2fb0620b37212"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t(* SendCommand)(uint32_t cmd, uint32_t arg, uint32_t flags, uint32_t *response)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#ga5a431da89feabc2b4bc0c27943dff6f2">ARM_MCI_SendCommand</a> : Send Command to card and get the response. </p>

</div>
</div>
<a class="anchor" id="adc63bab660e8304d78faa1ac429e792b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t(* SetupTransfer)(uint8_t *data, uint32_t block_count, uint32_t block_size, uint32_t mode)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#gaaec681bcd8e6811c5743e33ee0f35ed1">ARM_MCI_SetupTransfer</a> : Setup data transfer operation. </p>

</div>
</div>
<a class="anchor" id="afa8103cc20ba96420b7471455bbb87e4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t(* AbortTransfer)(void)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#ga3dfcf7b7186b711f9b63a096be816fe5">ARM_MCI_AbortTransfer</a> : Abort current data transfer. </p>

</div>
</div>
<a class="anchor" id="a6e0f47a92f626a971c5197fca6545505"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t(* Control)(uint32_t control, uint32_t arg)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#gaec0506a2aa4ae75cf6bc02528f36fe30">ARM_MCI_Control</a> : Control MCI Interface. </p>

</div>
</div>
<a class="anchor" id="a2dc63353d6869c0ea2d3d29155c88b49"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__mci__interface__gr.html#structARM__MCI__STATUS">ARM_MCI_STATUS</a>(* GetStatus)(void)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#ga8d61aa42ce78d1864fa928c1f273cbd9">ARM_MCI_GetStatus</a> : Get MCI status. </p>

</div>
</div>

</div>
</div>
<a name="structARM__MCI__CAPABILITIES" id="structARM__MCI__CAPABILITIES"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct ARM_MCI_CAPABILITIES</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>MCI Driver Capabilities. </p>
<p>A MCI driver can be implemented with different capabilities. The data fields of this struct encode the capabilities implemented by this driver.</p>
<p><b>Returned by:</b></p>
<ul>
<li><a class="el" href="group__mci__interface__gr.html#ga7e5a78b6e6409189833a0b72a0a3c48a">ARM_MCI_GetCapabilities</a> </li>
</ul>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="af47e73979b028c86c7c1fbe39b095140"></a>uint32_t</td>
<td class="fieldname">
cd_state: 1</td>
<td class="fielddoc">
Card Detect State available. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="abcabfa504d3226c723d9bf5debe2f164"></a>uint32_t</td>
<td class="fieldname">
cd_event: 1</td>
<td class="fielddoc">
Signal Card Detect change event. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a02df0162d3a653c36158a7b6a76f6175"></a>uint32_t</td>
<td class="fieldname">
wp_state: 1</td>
<td class="fielddoc">
Write Protect State available. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a414baec222a72be862e262f02b821dce"></a>uint32_t</td>
<td class="fieldname">
vdd: 1</td>
<td class="fielddoc">
Supports VDD Card Power Supply Control. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="abeb0330f882ebed8cabde782652233dd"></a>uint32_t</td>
<td class="fieldname">
vdd_1v8: 1</td>
<td class="fielddoc">
Supports 1.8 VDD Card Power Supply. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ab1cdfce6eb051bed7b904e0fd1719afa"></a>uint32_t</td>
<td class="fieldname">
vccq: 1</td>
<td class="fielddoc">
Supports VCCQ Card Power Supply Control (eMMC) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a1896a7548bb6fab285f23cc0d0b23d7d"></a>uint32_t</td>
<td class="fieldname">
vccq_1v8: 1</td>
<td class="fielddoc">
Supports 1.8 VCCQ Card Power Supply (eMMC) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="af4f95215005e38700ef527714932b361"></a>uint32_t</td>
<td class="fieldname">
vccq_1v2: 1</td>
<td class="fielddoc">
Supports 1.2 VCCQ Card Power Supply (eMMC) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a950669a8c88b49c8da4c56163b45a79d"></a>uint32_t</td>
<td class="fieldname">
data_width_4: 1</td>
<td class="fielddoc">
Supports 4-bit data. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a808703d6c70a501464e156e55f5cabd2"></a>uint32_t</td>
<td class="fieldname">
data_width_8: 1</td>
<td class="fielddoc">
Supports 8-bit data. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="abb1a604b0ee4f7e3510409747890e41e"></a>uint32_t</td>
<td class="fieldname">
data_width_4_ddr: 1</td>
<td class="fielddoc">
Supports 4-bit data, DDR (Dual Data Rate) - MMC only. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="acd5f6dce3a548d12c292e8cd17e4e9e2"></a>uint32_t</td>
<td class="fieldname">
data_width_8_ddr: 1</td>
<td class="fielddoc">
Supports 8-bit data, DDR (Dual Data Rate) - MMC only. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a83ecf7d4472c55362750ef72d8f8f47d"></a>uint32_t</td>
<td class="fieldname">
high_speed: 1</td>
<td class="fielddoc">
Supports SD/MMC High Speed Mode. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a084188480d589cdc8d3e164b9f41bea9"></a>uint32_t</td>
<td class="fieldname">
uhs_signaling: 1</td>
<td class="fielddoc">
Supports SD UHS-I (Ultra High Speed) 1.8V signaling. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a617bf7fb73b49a20398b90098ecc3ec0"></a>uint32_t</td>
<td class="fieldname">
uhs_tuning: 1</td>
<td class="fielddoc">
Supports SD UHS-I tuning. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a5c3dcb2f8aa6f65408d9a6741abb7b3e"></a>uint32_t</td>
<td class="fieldname">
uhs_sdr50: 1</td>
<td class="fielddoc">
Supports SD UHS-I SDR50 (Single Data Rate) up to 50MB/s. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ae07ceef1800252495a79f225142740e7"></a>uint32_t</td>
<td class="fieldname">
uhs_sdr104: 1</td>
<td class="fielddoc">
Supports SD UHS-I SDR104 (Single Data Rate) up to 104MB/s. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a1ee73c19020d5f1bedf7c013d0e5f730"></a>uint32_t</td>
<td class="fieldname">
uhs_ddr50: 1</td>
<td class="fielddoc">
Supports SD UHS-I DDR50 (Dual Data Rate) up to 50MB/s. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="afe5de4fdc6657aa19fa87577a8d460e5"></a>uint32_t</td>
<td class="fieldname">
uhs_driver_type_a: 1</td>
<td class="fielddoc">
Supports SD UHS-I Driver Type A. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a3c3df9641e7216dd20d3bc395dc4948f"></a>uint32_t</td>
<td class="fieldname">
uhs_driver_type_c: 1</td>
<td class="fielddoc">
Supports SD UHS-I Driver Type C. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a639bebbcb9a3a743f4f232fec82e2bfc"></a>uint32_t</td>
<td class="fieldname">
uhs_driver_type_d: 1</td>
<td class="fielddoc">
Supports SD UHS-I Driver Type D. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a61e2a440b27d7d22c866ad4427f4b825"></a>uint32_t</td>
<td class="fieldname">
sdio_interrupt: 1</td>
<td class="fielddoc">
Supports SD I/O Interrupt. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a5e38e4ee9cebcc99904e287adc8e6217"></a>uint32_t</td>
<td class="fieldname">
read_wait: 1</td>
<td class="fielddoc">
Supports Read Wait (SD I/O) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="abb03f0187e4658f417b5a24cac33eed9"></a>uint32_t</td>
<td class="fieldname">
suspend_resume: 1</td>
<td class="fielddoc">
Supports Suspend/Resume (SD I/O) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a3303194ea68bd1094841d4f958f6dbbf"></a>uint32_t</td>
<td class="fieldname">
mmc_interrupt: 1</td>
<td class="fielddoc">
Supports MMC Interrupt. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a072a194948489d4dbd2409b94fdca56b"></a>uint32_t</td>
<td class="fieldname">
mmc_boot: 1</td>
<td class="fielddoc">
Supports MMC Boot. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a2e8bd27f2c5c3093c4fec557890b97d4"></a>uint32_t</td>
<td class="fieldname">
rst_n: 1</td>
<td class="fielddoc">
Supports RST_n Pin Control (eMMC) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a13c956ba993083f1e59379968e2badbe"></a>uint32_t</td>
<td class="fieldname">
ccs: 1</td>
<td class="fielddoc">
Supports Command Completion Signal (CCS) for CE-ATA. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a9739c230a13b46482feb5475d257e482"></a>uint32_t</td>
<td class="fieldname">
ccs_timeout: 1</td>
<td class="fielddoc">
Supports Command Completion Signal (CCS) timeout for CE-ATA. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aa43c4c21b173ada1b6b7568956f0d650"></a>uint32_t</td>
<td class="fieldname">
reserved: 3</td>
<td class="fielddoc">
Reserved (must be zero) </td></tr>
</table>

</div>
</div>
<a name="structARM__MCI__STATUS" id="structARM__MCI__STATUS"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct ARM_MCI_STATUS</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>MCI Status. </p>
<p>Structure with information about the status of the MCI.</p>
<p><b>Returned by:</b></p>
<ul>
<li><a class="el" href="group__mci__interface__gr.html#ga8d61aa42ce78d1864fa928c1f273cbd9">ARM_MCI_GetStatus</a> </li>
</ul>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aa22ef7c7597e90835bd67d5795ba757e"></a>uint32_t</td>
<td class="fieldname">
command_active: 1</td>
<td class="fielddoc">
Command active flag. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a56e426979c3872254c156e9ae7eead5b"></a>uint32_t</td>
<td class="fieldname">
command_timeout: 1</td>
<td class="fielddoc">
Command timeout flag (cleared on start of next command) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="afca11cd2ce661c67455a6d75328848cc"></a>uint32_t</td>
<td class="fieldname">
command_error: 1</td>
<td class="fielddoc">
Command error flag (cleared on start of next command) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a2655d3422b720097b091a28e8bbcea8f"></a>uint32_t</td>
<td class="fieldname">
transfer_active: 1</td>
<td class="fielddoc">
Transfer active flag. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a598ae4a196316d6dcb97d07fd337ecdd"></a>uint32_t</td>
<td class="fieldname">
transfer_timeout: 1</td>
<td class="fielddoc">
Transfer timeout flag (cleared on start of next command) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a21d4bc1a03e161bd33693619039a6afa"></a>uint32_t</td>
<td class="fieldname">
transfer_error: 1</td>
<td class="fielddoc">
Transfer error flag (cleared on start of next command) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a61e2a440b27d7d22c866ad4427f4b825"></a>uint32_t</td>
<td class="fieldname">
sdio_interrupt: 1</td>
<td class="fielddoc">
SD I/O Interrupt flag (cleared on start of monitoring) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a13c956ba993083f1e59379968e2badbe"></a>uint32_t</td>
<td class="fieldname">
ccs: 1</td>
<td class="fielddoc">
CCS flag (cleared on start of next command) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aa43c4c21b173ada1b6b7568956f0d650"></a>uint32_t</td>
<td class="fieldname">
reserved: 24</td>
<td class="fielddoc">
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="ga0d14651f6788c1ffd81544602565faf1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ARM_MCI_SignalEvent_t</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a class="el" href="group__mci__interface__gr.html#gaac2dbd1c1a98436938c5d0d6248cb700">ARM_MCI_SignalEvent</a> : Signal MCI Card Event. </p>
<p>Provides the typedef for the callback function <a class="el" href="group__mci__interface__gr.html#gaac2dbd1c1a98436938c5d0d6248cb700">ARM_MCI_SignalEvent</a>.</p>
<p><b>Parameter for:</b></p>
<ul>
<li><a class="el" href="group__mci__interface__gr.html#ga6f34d4ab362e596ddaf23aac093268cf">ARM_MCI_Initialize</a> </li>
</ul>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga3418183015dbf3025b94eebaedb00ab1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a> ARM_MCI_GetVersion </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get driver version. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a></dd></dl>
<p>The function <b>ARM_MCI_GetVersion</b> returns version information of the driver implementation in <a class="el" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a></p>
<ul>
<li>API version is the version of the CMSIS-Driver specification used to implement this driver.</li>
<li>Driver version is source code version of the actual driver implementation.</li>
</ul>
<p>Example: </p>
<div class="fragment"><div class="line"><span class="keyword">extern</span> <a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> Driver_MCI0;</div>
<div class="line"><a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> *drv_info;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> setup_mci (<span class="keywordtype">void</span>)  {</div>
<div class="line">  <a class="code" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a>  version;</div>
<div class="line"> </div>
<div class="line">  drv_info = &amp;Driver_MCI0;</div>
<div class="line">  version = drv_info-&gt;<a class="code" href="group__mci__interface__gr.html#a8834b281da48583845c044a81566c1b3">GetVersion</a> ();</div>
<div class="line">  <span class="keywordflow">if</span> (version.<a class="code" href="group__common__drv__gr.html#ad180da20fbde1d3dafc074af87c19540">api</a> &lt; 0x10A)   {      <span class="comment">// requires at minimum API version 1.10 or higher</span></div>
<div class="line">    <span class="comment">// error handling</span></div>
<div class="line">    <span class="keywordflow">return</span>;</div>
<div class="line">  }</div>
<div class="line">}</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ga7e5a78b6e6409189833a0b72a0a3c48a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__mci__interface__gr.html#structARM__MCI__CAPABILITIES">ARM_MCI_CAPABILITIES</a> ARM_MCI_GetCapabilities </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get driver capabilities. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__mci__interface__gr.html#structARM__MCI__CAPABILITIES">ARM_MCI_CAPABILITIES</a></dd></dl>
<p>The function <b>ARM_MCI_GetCapabilities</b> returns information about capabilities in this driver implementation. The data fields of the structure <a class="el" href="group__mci__interface__gr.html#structARM__MCI__CAPABILITIES">ARM_MCI_CAPABILITIES</a> encode various capabilities, for example supported bus modes ...</p>
<p>Example: </p>
<div class="fragment"><div class="line"><span class="keyword">extern</span> <a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> Driver_MCI0;</div>
<div class="line"><a class="code" href="group__mci__interface__gr.html#structARM__DRIVER__MCI">ARM_DRIVER_MCI</a> *drv_info;</div>
<div class="line">  </div>
<div class="line"><span class="keywordtype">void</span> read_capabilities (<span class="keywordtype">void</span>)  {</div>
<div class="line">  <a class="code" href="group__mci__interface__gr.html#structARM__MCI__CAPABILITIES">ARM_MCI_CAPABILITIES</a> drv_capabilities;</div>
<div class="line"> </div>
<div class="line">  drv_info = &amp;Driver_MCI0;  </div>
<div class="line">  drv_capabilities = drv_info-&gt;<a class="code" href="group__mci__interface__gr.html#a5648b4224e0346ba5e20fefc7e83aee8">GetCapabilities</a> ();</div>
<div class="line">  <span class="comment">// interrogate capabilities</span></div>
<div class="line"> </div>
<div class="line">}</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ga6f34d4ab362e596ddaf23aac093268cf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_MCI_Initialize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__mci__interface__gr.html#ga0d14651f6788c1ffd81544602565faf1">ARM_MCI_SignalEvent_t</a>&#160;</td>
          <td class="paramname"><em>cb_event</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the Memory Card Interface. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cb_event</td><td>Pointer to <a class="el" href="group__mci__interface__gr.html#gaac2dbd1c1a98436938c5d0d6248cb700">ARM_MCI_SignalEvent</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_MCI_Initialize</b> initializes the MCI interface. It is called when the middleware component starts operation.</p>
<p>The function performs the following operations:</p>
<ul>
<li>Initializes the resources needed for the MCI interface.</li>
<li>Registers the <a class="el" href="group__mci__interface__gr.html#gaac2dbd1c1a98436938c5d0d6248cb700">ARM_MCI_SignalEvent</a> callback function.</li>
</ul>
<p>The parameter <em>cb_event</em> is a pointer to the <a class="el" href="group__mci__interface__gr.html#gaac2dbd1c1a98436938c5d0d6248cb700">ARM_MCI_SignalEvent</a> callback function; use a NULL pointer when no callback signals are required.</p>
<p><b>Example:</b> </p>
<ul>
<li>see <a class="el" href="group__mci__interface__gr.html">MCI Interface</a> - Driver Functions </li>
</ul>

</div>
</div>
<a class="anchor" id="gaef8183e77797e74997551d03646d42c2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_MCI_Uninitialize </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>De-initialize Memory Card Interface. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_MCI_Uninitialize</b> de-initializes the resources of I2C interface.</p>
<p>It is called when the middleware component stops operation and releases the software resources used by the interface. </p>

</div>
</div>
<a class="anchor" id="ga19752749d04ed22dc91c4294645e0244"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_MCI_PowerControl </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__common__drv__gr.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5">ARM_POWER_STATE</a>&#160;</td>
          <td class="paramname"><em>state</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Control Memory Card Interface Power. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">state</td><td>Power state <a class="el" href="group__common__drv__gr.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5">ARM_POWER_STATE</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_MCI_PowerControl</b> operates the power modes of the MCI interface.</p>
<p>The parameter <em>state</em> can have the following values:</p>
<ul>
<li><a class="el" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5abed52b77a9ce4775570e44a842b1295e">ARM_POWER_FULL</a> : set-up peripheral for data transfers, enable interrupts (NVIC) and optionally DMA. Can be called multiple times. If the peripheral is already in this mode, then the function performs no operation and returns with <a class="el" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>.</li>
<li><a class="el" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5a9ef9e57cbcc948d0e22314e73dc8c434">ARM_POWER_LOW</a> : may use power saving. Returns <a class="el" href="group__execution__status.html#ga2efa59e480d82697795439220e6884e4">ARM_DRIVER_ERROR_UNSUPPORTED</a> when not implemented.</li>
<li><a class="el" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5ab6f5becc85ebd51c3dd2524a95d2ca35">ARM_POWER_OFF</a> : terminates any pending data transfers, disables peripheral, disables related interrupts and DMA.</li>
</ul>
<p>Refer to <a class="el" href="theoryOperation.html#CallSequence">Function Call Sequence</a> for more information. </p>

</div>
</div>
<a class="anchor" id="gab161f80e0eda2815f3e0ebbba1314ff0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_MCI_CardPower </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>voltage</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set Memory Card Power supply voltage. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">voltage</td><td>Memory Card Power supply voltage </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_MCI_CardPower</b> operates the memory card power supply voltage.</p>
<p>The parameter <em>voltage</em> sets the voltage. Not every voltage might be supported by the driver implementation. The structure <a class="el" href="group__mci__interface__gr.html#structARM__MCI__CAPABILITIES">ARM_MCI_CAPABILITIES</a> encodes the supported voltage. Retrieve the information with the function <a class="el" href="group__mci__interface__gr.html#ga7e5a78b6e6409189833a0b72a0a3c48a">ARM_MCI_GetCapabilities</a> and verify the data fields.</p>
<p>The following values:</p>
<table class="doxtable">
<tr>
<th align="left">Parameter <em>voltage</em> </th><th align="left">Description </th><th>supported when <a class="el" href="group__mci__interface__gr.html#structARM__MCI__CAPABILITIES" title="MCI Driver Capabilities. ">ARM_MCI_CAPABILITIES</a>  </th></tr>
<tr>
<td align="left"><a class="el" href="group__mci__card__power__ctrls.html#ga288fbd80b384739a80e8f3ec31205cf5">ARM_MCI_POWER_VDD_OFF</a> </td><td align="left">VDD (VCC) turned off </td><td><em>always supported</em> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__card__power__ctrls.html#ga565ecd36c8d0379fb4172da577cc540d">ARM_MCI_POWER_VDD_3V3</a> </td><td align="left">VDD (VCC) = <span class="XML-Token">3.3V</span> </td><td>data field <em>vdd</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__card__power__ctrls.html#ga2ce8e379c3691da3b51c9c97d61770ef">ARM_MCI_POWER_VDD_1V8</a> </td><td align="left">VDD (VCC) = <span class="XML-Token">1.8V</span> </td><td>data field <em>vdd_1v8</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__card__power__ctrls.html#ga6929c98a6bc8d898939a95111509220b">ARM_MCI_POWER_VCCQ_OFF</a> </td><td align="left">eMMC VCCQ turned off </td><td><em>always supported</em> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__card__power__ctrls.html#ga91a7201173cc092eaf7f0bcee028871e">ARM_MCI_POWER_VCCQ_3V3</a> </td><td align="left">eMMC VCCQ = <span class="XML-Token">3.3V</span> </td><td>data field <em>vccq</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__card__power__ctrls.html#gaaf389e0a139d5808dff8ebb6897d4c7b">ARM_MCI_POWER_VCCQ_1V8</a> </td><td align="left">eMMC VCCQ = <span class="XML-Token">1.8V</span> </td><td>data field <em>vccq_1v8</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__card__power__ctrls.html#ga5304b3b6cadc5113f841c3d526ab5db6">ARM_MCI_POWER_VCCQ_1V2</a> </td><td align="left">eMMC VCCQ = <span class="XML-Token">1.2V</span> </td><td>data field <em>vccq_1v2</em> = <span class="XML-Token">1</span> </td></tr>
</table>

</div>
</div>
<a class="anchor" id="ga012fca8f1ce5366fce14b708c771c635"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_MCI_ReadCD </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read Card Detect (CD) state. </p>
<dl class="section return"><dt>Returns</dt><dd>1:card detected, 0:card not detected, or error</dd></dl>
<p>The function <b>ARM_MCI_ReadCD</b> reads the status of the Card Detect (CD) pin. </p>

</div>
</div>
<a class="anchor" id="ga3d70286918405ac81fa795c7d09dc6fd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_MCI_ReadWP </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read Write Protect (WP) state. </p>
<dl class="section return"><dt>Returns</dt><dd>1:write protected, 0:not write protected, or error</dd></dl>
<p>The function <b>ARM_MCI_ReadWP</b> reads the status of the Write Protect (WP) pin. </p>

</div>
</div>
<a class="anchor" id="ga5a431da89feabc2b4bc0c27943dff6f2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_MCI_SendCommand </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>response</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send Command to card and get the response. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cmd</td><td>Memory Card command </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">arg</td><td>Command argument </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">flags</td><td>Command flags </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">response</td><td>Pointer to buffer for response </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_MCI_SendCommand</b> </p>
<ul>
<li>sends commands to the memory card</li>
<li>retrieve the response from the card</li>
<li>optionally, start the data transfer.</li>
</ul>
<p>The parameter <em>cmd</em> is the command sent to the card. <br/>
The parameter <em>arg</em> contains arguments for the command <em>cmd</em>. <br/>
The parameter <em>flags</em> controls the behavior of the operation and takes predefined values listed in the table below. <br/>
The parameter <em>response</em> is a pointer to receive data.</p>
<p>The parameter <em>flags</em> can have the following values:</p>
<table class="doxtable">
<tr>
<th align="left">Parameter <em>flags</em> </th><th align="left">Description  </th></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#ga70934cef80884e8c75fb4eebf8452118">ARM_MCI_RESPONSE_NONE</a> </td><td align="left">No response expected (default) </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#gaa5ddf1cf772b234e3c247039effd0e7b">ARM_MCI_RESPONSE_SHORT</a> </td><td align="left">Short response (<span class="XML-Token">48</span>-bit) expected </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#gaa1d541b0edf32ec05e68d623c727ef9c">ARM_MCI_RESPONSE_SHORT_BUSY</a> </td><td align="left">Short response with busy signal (<span class="XML-Token">48</span>-bit) expected </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#gac49c7b39a7c51bd2193e048835bec2fb">ARM_MCI_RESPONSE_LONG</a> </td><td align="left">Long response (<span class="XML-Token">136</span>-bit) expected </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#ga497abf878c6e12f54cc7ddb92da76c4a">ARM_MCI_RESPONSE_INDEX</a> </td><td align="left">Check command index in response </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#ga6ab3f4c1a2bf0fdb81fbcf7a5698f2de">ARM_MCI_RESPONSE_CRC</a> </td><td align="left">Check CRC in response </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#ga68e879799bb27a1b13baf57ed19d719d">ARM_MCI_WAIT_BUSY</a> </td><td align="left">Wait until busy before sending the command </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#ga8aa566f69aa74ed416213df6ca3267bd">ARM_MCI_TRANSFER_DATA</a> </td><td align="left">Activate Data transfer </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#ga81606bd94ce782e2c3764b913f929f60">ARM_MCI_CARD_INITIALIZE</a> </td><td align="left">Execute Memory Card initialization sequence </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#gab2bfeedf1dc2df1872ebbcc559a7385a">ARM_MCI_INTERRUPT_COMMAND</a> </td><td align="left">Send Interrupt command (CMD40 - MMC only) </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#gabc31b6b26988998c84c92a9a698fd5dc">ARM_MCI_INTERRUPT_RESPONSE</a> </td><td align="left">Send Interrupt response (CMD40 - MMC only) </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#gae04254f51dfd9838583206cae0a5f8f7">ARM_MCI_BOOT_OPERATION</a> </td><td align="left">Execute Boot operation (MMC only) </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#ga30bd304652d4f870ee7ce61c266a9348">ARM_MCI_BOOT_ALTERNATIVE</a> </td><td align="left">Execute Alternative Boot operation (MMC only) </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#ga8c55bc0a310630d49810802ccd1bb10d">ARM_MCI_BOOT_ACK</a> </td><td align="left">Expect Boot Acknowledge (MMC only) </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#gab9df5169b37621764f8bb0f93db5281a">ARM_MCI_CCSD</a> </td><td align="left">Send Command Completion Signal Disable (CCSD) for CE-ATA device </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__send__command__flags__ctrls.html#gab82c472e4ca3fca12ae3291e25997f00">ARM_MCI_CCS</a> </td><td align="left">Expect Command Completion Signal (CCS) for CE-ATA device </td></tr>
</table>
<p>Calling the function <b>ARM_MCI_SendCommand</b> only starts the operation. The function is non-blocking and returns as soon as the driver has started the operation. It is not allowed to call this function again until the operation is in progress.</p>
<p>After the command is sent the response is retrieved if specified with <b>ARM_MCI_RESPONSE_xxx</b> flags. When the command completes successfully (requested response is received without errors) the <a class="el" href="group__mci__event__gr.html#gae69356c75d55103d93ef91ac1bc02b49">ARM_MCI_EVENT_COMMAND_COMPLETE</a> event is generated. In case that response is requested but not received the <a class="el" href="group__mci__event__gr.html#gab79b3ab4dcd03c38df1e173fa903d822">ARM_MCI_EVENT_COMMAND_TIMEOUT</a> event is generated instead. In case of invalid response (or CRC error) the <a class="el" href="group__mci__event__gr.html#ga373aeb3eca0e4c6d159312488a130442">ARM_MCI_EVENT_COMMAND_ERROR</a> event is generated instead. Progress of command operation can be monitored by calling the <a class="el" href="group__mci__interface__gr.html#ga8d61aa42ce78d1864fa928c1f273cbd9">ARM_MCI_GetStatus</a> and checking the <em>command_active</em> flag.</p>
<p>After the command operation the data transfer operation is started if specified with <b>ARM_MCI_TRANSFER_DATA</b> flag. The data transfer needs to be configured before that by calling the <a class="el" href="group__mci__interface__gr.html#gaaec681bcd8e6811c5743e33ee0f35ed1">ARM_MCI_SetupTransfer</a>. When the data transfer completes successfully the <a class="el" href="group__mci__event__gr.html#gabc3c468dedaed890683360f2c5c65bea">ARM_MCI_EVENT_TRANSFER_COMPLETE</a> event is generated. In case that data transfer is not completed in-time (specified by <a class="el" href="group__mci__mode__ctrls.html#ga09a58821e42595f0c2e55f8cc2d32ceb">ARM_MCI_DATA_TIMEOUT</a>) the <a class="el" href="group__mci__event__gr.html#ga614e7c7226adbaa8ec4165bf8b87ef27">ARM_MCI_EVENT_TRANSFER_TIMEOUT</a> event is generated instead. In case of CRC errors the <a class="el" href="group__mci__event__gr.html#ga5d2cee5ba6d0e40ad505983155706c29">ARM_MCI_EVENT_TRANSFER_ERROR</a> event is generated instead. Progress of data transfer operation can be monitored by calling the <a class="el" href="group__mci__interface__gr.html#ga8d61aa42ce78d1864fa928c1f273cbd9">ARM_MCI_GetStatus</a> and checking the <em>transfer_active</em> flag.</p>
<p><b>See also:</b></p>
<ul>
<li><a class="el" href="group__mci__interface__gr.html#gaac2dbd1c1a98436938c5d0d6248cb700">ARM_MCI_SignalEvent</a> </li>
</ul>

</div>
</div>
<a class="anchor" id="gaaec681bcd8e6811c5743e33ee0f35ed1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_MCI_SetupTransfer </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>block_count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>block_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Setup read or write transfer operation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">data</td><td>Pointer to data block(s) to be written or read </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">block_count</td><td>Number of blocks </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">block_size</td><td>Size of a block in bytes </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mode</td><td>Transfer mode </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_MCI_SetupTransfer</b> prepares the data transfer operation that is initiated by calling the function <a class="el" href="group__mci__interface__gr.html#ga5a431da89feabc2b4bc0c27943dff6f2">ARM_MCI_SendCommand</a> with the parameter <em>flags</em> = <a class="el" href="group__mci__send__command__flags__ctrls.html#ga8aa566f69aa74ed416213df6ca3267bd">ARM_MCI_TRANSFER_DATA</a>.</p>
<p>The parameter <em>data</em> is a pointer to the data to transfer. <br/>
The parameter <em>block_count</em> is the number of blocks to transfer. <br/>
The parameter <em>block_size</em> is the size of a block. <br/>
The parameter <em>mode</em> sets the transfer mode and can have the values liste in the table below:</p>
<table class="doxtable">
<tr>
<th align="left">Transfer Directions </th><th align="left">Description  </th></tr>
<tr>
<td align="left"><a class="el" href="group__mci__transfer__ctrls.html#gaa6f3be235a9dce5c66be8fe64f399846">ARM_MCI_TRANSFER_READ</a> </td><td align="left">Read data from MCI </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__transfer__ctrls.html#gaddc60aab15f75993a99f98f71ddbd50c">ARM_MCI_TRANSFER_WRITE</a> </td><td align="left">Write data to MCI </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__transfer__ctrls.html#ga4ced782e7c0c70d5f0edbddd1e48323b">ARM_MCI_TRANSFER_BLOCK</a> (default) </td><td align="left">Block Data transfer </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__transfer__ctrls.html#gac7db0cffd571e60758627d889ba7a432">ARM_MCI_TRANSFER_STREAM</a> </td><td align="left">Stream Data transfer (MMC only) </td></tr>
</table>

</div>
</div>
<a class="anchor" id="ga3dfcf7b7186b711f9b63a096be816fe5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_MCI_AbortTransfer </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Abort current read/write data transfer. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>The function <b>ARM_MCI_AbortTransfer</b> aborts the active data transfer operation initiated with <a class="el" href="group__mci__interface__gr.html#ga5a431da89feabc2b4bc0c27943dff6f2">ARM_MCI_SendCommand</a>. </p>

</div>
</div>
<a class="anchor" id="gaec0506a2aa4ae75cf6bc02528f36fe30"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t ARM_MCI_Control </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>control</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Control MCI Interface. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">control</td><td>Operation </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">arg</td><td>Argument of operation (optional) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__execution__status.html">Status Error Codes</a></dd></dl>
<p>Th function <b>ARM_MCI_Control</b> controls the MCI interface and executes various operations.</p>
<p>The parameter <em>control</em> specifies the operation. Values for <em>control</em> cannot be ORed, but must be called separately in the code. <br/>
The parameter <em>arg</em> provides, depending on the operation, additional information or sets values.</p>
<dl class="section note"><dt>Note</dt><dd>For parameters, the values marked with (default) are the setting after the driver initialization.</dd></dl>
<p>The table lists values for the parameter <em>control</em>.</p>
<table class="doxtable">
<tr>
<th align="left">Parameter <em>control</em> </th><th align="left">Operation  </th></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#ga7f982d2e5aec768307d35a83c65fb3ef">ARM_MCI_BUS_SPEED</a> </td><td align="left">Set the Bus Speed. The parameter <em>arg</em> specifies the speed in bits/s; The function returns the bus speed configured in bits/s. </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#gaf7ede525eabc618fbbb9f7a294c8ed96">ARM_MCI_BUS_SPEED_MODE</a> </td><td align="left">Set the Bus Speed Mode. Predefined values for <em>arg</em> are listed in the table <b>Bus Speed Mode</b>. </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#ga8b7571e37520c07d8ef4f697f3886715">ARM_MCI_BUS_CMD_MODE</a> </td><td align="left">Set the CMD Line Mode. Predefined values for <em>arg</em> are listed in the table <b>Bus CMD Line Mode</b>. </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#ga876d964d0eeacdb16e93f7558a544587">ARM_MCI_BUS_DATA_WIDTH</a> </td><td align="left">Set data bus width. Predefined values for <em>arg</em> are encoded in <b>Bus Data Width</b>. </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#ga78068f519139f2ae7b09e0608070aaf6">ARM_MCI_DRIVER_STRENGTH</a> </td><td align="left">Set driver strength. Predefined values for <em>arg</em> are listed in the table <b>Driver Type</b> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#ga21e403e8c3fa8cc75431a513813f0a16">ARM_MCI_CONTROL_RESET</a> </td><td align="left">Control optional RST_n Pin (eMMC). The parameter <em>arg</em> can have the values <span class="XML-Token">[0:inactive(default); 1:active]</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#ga889473fbfbdcb89aab4d53cc8a13f615">ARM_MCI_CONTROL_CLOCK_IDLE</a> </td><td align="left">Control clock generation on CLK Pin when idle. The parameter <em>arg</em> can have the values <span class="XML-Token">[0:disabled; 1:enabled]</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#ga98853f60bdc085aeeccd66f7bdf22d3d">ARM_MCI_UHS_TUNING_OPERATION</a> </td><td align="left">Sampling clock Tuning operation (SD UHS-I). The parameter <em>arg</em> can have the values <span class="XML-Token">[0:reset; 1:execute]</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#gabd3af448e26da5657c1c5a03330476b7">ARM_MCI_UHS_TUNING_RESULT</a> </td><td align="left">Sampling clock Tuning result (SD UHS-I). Returns <span class="XML-Token">[0:done; 1:in progress; -1:error]</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#ga09a58821e42595f0c2e55f8cc2d32ceb">ARM_MCI_DATA_TIMEOUT</a> </td><td align="left">Set Data timeout; The parameter <em>arg</em> sets the timeout in bus cycles. </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#gae97b1a819a5d326b1f1009b0d6d48b5a">ARM_MCI_CSS_TIMEOUT</a> </td><td align="left">Set Command Completion Signal (CCS) timeout. The parameter <em>arg</em> sets timeout in bus cycles. </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#ga19fd7d3b74ac48ca74a2e138b3ee9963">ARM_MCI_MONITOR_SDIO_INTERRUPT</a> </td><td align="left">Monitor SD I/O interrupt. The parameter <em>arg</em> can have the values <span class="XML-Token">[0:disabled(default); 1:enabled]</span>. Monitoring is automatically disabled when an interrupt is recognized. </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#gaaa10c5aa7a8108aa59c3734b3eec2e3a">ARM_MCI_CONTROL_READ_WAIT</a> </td><td align="left">Control Read/Wait states for SD I/O. The parameter <em>arg</em> can have the values <span class="XML-Token">[0:disabled(default); 1:enabled]</span>. </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#ga04cf174b0ef13240f26225bf8e45a4a0">ARM_MCI_SUSPEND_TRANSFER</a> </td><td align="left">Suspend Data transfer (SD I/O). Returns the number of remaining bytes to transfer. </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__mode__ctrls.html#gac4907319499072fddf61f2f83b0dd966">ARM_MCI_RESUME_TRANSFER</a> </td><td align="left">Resume Data transfer (SD I/O). </td></tr>
</table>
<p><b>Bus Speed Mode</b></p>
<p>The function <a class="el" href="group__mci__interface__gr.html#ga7e5a78b6e6409189833a0b72a0a3c48a">ARM_MCI_GetCapabilities</a> lists the supported bus speed modes. Initially, all SD cards use a 3.3 volt electrical interface. Some SD cards can switch to 1.8 volt operation. For example, the use of ultra-high-speed (UHS) SD cards requires 1.8 volt operation and a 4-bit bus data width. The bit field <a class="el" href="group__mci__interface__gr.html#a084188480d589cdc8d3e164b9f41bea9" title="Supports SD UHS-I (Ultra High Speed) 1.8V signaling. ">ARM_MCI_CAPABILITIES.uhs_signaling</a> encodes whether the driver supports 1.8 volt UHS signaling.</p>
<p>The <em>control</em> operation <b>ARM_MCI_BUS_SPEED_MODE</b> sets the bus speed mode using the parameter <em>arg</em>.</p>
<table class="doxtable">
<tr>
<th align="left">Parameter <em>arg</em> </th><th align="left">Bus Speed Mode  </th></tr>
<tr>
<td align="left"><a class="el" href="group__mci__bus__speed__ctrls.html#ga601fa8b27ab2e5f6d90c93d54c8f412d">ARM_MCI_BUS_DEFAULT_SPEED</a> (default) </td><td align="left">Set the bus speed for SD/MMC cards: Default Speed mode up to <span class="XML-Token">[25;26]MHz</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__bus__speed__ctrls.html#gaabda746ac7d6b4497358ff655a8ea6be">ARM_MCI_BUS_HIGH_SPEED</a> </td><td align="left">Set the bus speed for SD/MMC: High Speed mode up to <span class="XML-Token">[50;52]MHz</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__bus__speed__ctrls.html#ga0473c44a7b65044b3c6a8e7012009a4a">ARM_MCI_BUS_UHS_SDR12</a> </td><td align="left">Set the bus speed for SD: SDR12 (Single Data Rate) up to <span class="XML-Token">25MHz, 12.5MB/s: UHS-I (Ultra High Speed) 1.8V signalling</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__bus__speed__ctrls.html#gae32422631052307b3c4d269b25415907">ARM_MCI_BUS_UHS_SDR25</a> </td><td align="left">Set the bus speed for SD: SDR25 (Single Data Rate) up to <span class="XML-Token">50MHz, 25 MB/s: UHS-I (Ultra High Speed) 1.8V signalling</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__bus__speed__ctrls.html#ga9f326c02391d965918ae619b912b81e7">ARM_MCI_BUS_UHS_SDR50</a> </td><td align="left">Set the bus speed for SD: SDR50 (Single Data Rate) up to <span class="XML-Token">100MHz, 50 MB/s: UHS-I (Ultra High Speed) 1.8V signalling</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__bus__speed__ctrls.html#gad2bab563e7bbb4bcf6bdabe6a13dadf4">ARM_MCI_BUS_UHS_SDR104</a> </td><td align="left">Set the bus speed for SD: SDR104 (Single Data Rate) up to <span class="XML-Token">208MHz, 104 MB/s: UHS-I (Ultra High Speed) 1.8V signalling</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__bus__speed__ctrls.html#ga04da920a5cac99eab9784527057f1b9c">ARM_MCI_BUS_UHS_DDR50</a> </td><td align="left">Set the bus speed for SD: DDR50 (Dual Data Rate) up to <span class="XML-Token">50MHz, 50 MB/s: UHS-I (Ultra High Speed) 1.8V signalling</span> </td></tr>
</table>
<p><b>Bus CMD Line Mode</b></p>
<p>The <em>control</em> operation <b>ARM_MCI_BUS_CMD_MODE</b> sets the bus command line mode using the parameter <em>arg</em>.</p>
<table class="doxtable">
<tr>
<th align="left">Parameter <em>arg</em> </th><th align="left">Bus CMD Line Mode  </th></tr>
<tr>
<td align="left"><a class="el" href="group__mci__cmd__line__ctrls.html#gaaed404312d9bc073e3489779a911c7dc">ARM_MCI_BUS_CMD_PUSH_PULL</a> (default) </td><td align="left">Set the Push-Pull CMD line </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__cmd__line__ctrls.html#gaadf8667985731964d57d1ed672e90fd3">ARM_MCI_BUS_CMD_OPEN_DRAIN</a> </td><td align="left">Set the Open Drain CMD line (MMC only) </td></tr>
</table>
<p><b>Bus Data Width</b></p>
<p>Specifies the bus data width (the number of data I/O pins on the SD/MMC interface).</p>
<p>For high speed memory cards, a 4-bit bus data width should be used (or 8-bit for eMMC). The bit fields <a class="el" href="group__mci__interface__gr.html#a950669a8c88b49c8da4c56163b45a79d" title="Supports 4-bit data. ">ARM_MCI_CAPABILITIES.data_width_4</a> and <a class="el" href="group__mci__interface__gr.html#a808703d6c70a501464e156e55f5cabd2" title="Supports 8-bit data. ">ARM_MCI_CAPABILITIES.data_width_8</a> encode whether the driver supports a specific bus data with.</p>
<p>The <em>control</em> operation <b>ARM_MCI_BUS_DATA_WIDTH</b> sets the bus data width using the parameter <em>arg</em>.</p>
<table class="doxtable">
<tr>
<th align="left">Parameter <em>arg</em> </th><th align="left">Bus Data Width  </th></tr>
<tr>
<td align="left"><a class="el" href="group__mci__bus__data__width__ctrls.html#gaa09a00d810a4dfd1d1824311ee290585">ARM_MCI_BUS_DATA_WIDTH_1</a> (default) </td><td align="left">Set the Bus data width to <span class="XML-Token">1 bit</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__bus__data__width__ctrls.html#gaa28150d8c3789e8cf1bcda318f74a28c">ARM_MCI_BUS_DATA_WIDTH_4</a> </td><td align="left">Set the Bus data width to <span class="XML-Token">4 bits</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__bus__data__width__ctrls.html#ga3bb99a2d98ba9fb8c5bc97fa2b8ef469">ARM_MCI_BUS_DATA_WIDTH_8</a> </td><td align="left">Set the Bus data width to <span class="XML-Token">8 bits</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__bus__data__width__ctrls.html#gaccb174bd131f8fd8cd9a56439a8ebb60">ARM_MCI_BUS_DATA_WIDTH_4_DDR</a> </td><td align="left">Set the Bus data width to <span class="XML-Token">4 bits</span>, DDR (Dual Data Rate) - MMC only </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__bus__data__width__ctrls.html#ga7b31f81ae703229095fe9efcfbe80b47">ARM_MCI_BUS_DATA_WIDTH_8_DDR</a> </td><td align="left">Set the Bus data width to <span class="XML-Token">8 bits</span>, DDR (Dual Data Rate) - MMC only </td></tr>
</table>
<p><b>Driver Type</b></p>
<p>Specifies the interface driver type.</p>
<p>The <em>control</em> operation <b>ARM_MCI_DRIVER_STRENGTH</b> sets the interface driver type using the parameter <em>arg</em>.</p>
<table class="doxtable">
<tr>
<th align="left">Parameter <em>arg</em> </th><th align="left">Driver Type  </th></tr>
<tr>
<td align="left"><a class="el" href="group__mci__driver__strength__ctrls.html#ga64eb1c4847711a262f084c361b60a912">ARM_MCI_DRIVER_TYPE_A</a> </td><td align="left">Set the interface to SD UHS-I Driver Type A </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__driver__strength__ctrls.html#ga078d3c3bc7c9335b92e6445a0abafc46">ARM_MCI_DRIVER_TYPE_B</a> (default) </td><td align="left">Set the interface to SD UHS-I Driver Type B </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__driver__strength__ctrls.html#ga3da11696d1fcd3930eb7e70fe097d747">ARM_MCI_DRIVER_TYPE_C</a> </td><td align="left">Set the interface to SD UHS-I Driver Type C </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__driver__strength__ctrls.html#ga8185f82b1d8857a3f0eb461d664f2b3d">ARM_MCI_DRIVER_TYPE_D</a> </td><td align="left">Set the interface to SD UHS-I Driver Type D </td></tr>
</table>
<p><b>Examples:</b> </p>
<div class="fragment"><div class="line"><span class="comment">// Set Bus Speed to 25MHz</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga7f982d2e5aec768307d35a83c65fb3ef">ARM_MCI_BUS_SPEED</a>, 25000000);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Set High Speed mode</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#gaf7ede525eabc618fbbb9f7a294c8ed96">ARM_MCI_BUS_SPEED_MODE</a>, <a class="code" href="group__mci__bus__speed__ctrls.html#gaabda746ac7d6b4497358ff655a8ea6be">ARM_MCI_BUS_HIGH_SPEED</a>);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Configure CMD line as Open Drain (MMC only)</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga8b7571e37520c07d8ef4f697f3886715">ARM_MCI_BUS_CMD_MODE</a>, <a class="code" href="group__mci__cmd__line__ctrls.html#gaadf8667985731964d57d1ed672e90fd3">ARM_MCI_BUS_CMD_OPEN_DRAIN</a>);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Set Bus Data Width = 4bits</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga876d964d0eeacdb16e93f7558a544587">ARM_MCI_BUS_DATA_WIDTH</a>, <a class="code" href="group__mci__bus__data__width__ctrls.html#gaa28150d8c3789e8cf1bcda318f74a28c">ARM_MCI_BUS_DATA_WIDTH_4</a>);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Set SD UHS-I Driver Type B</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga78068f519139f2ae7b09e0608070aaf6">ARM_MCI_DRIVER_STRENGTH</a>, <a class="code" href="group__mci__driver__strength__ctrls.html#ga078d3c3bc7c9335b92e6445a0abafc46">ARM_MCI_DRIVER_TYPE_B</a>);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// RTS_n Pin is not active by default</span></div>
<div class="line"><span class="comment">// Assert RTS_n Pin (eMMC)</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga21e403e8c3fa8cc75431a513813f0a16">ARM_MCI_CONTROL_RESET</a>, 1);</div>
<div class="line"><span class="comment">// De-assert RTS_n Pin (eMMC)</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga21e403e8c3fa8cc75431a513813f0a16">ARM_MCI_CONTROL_RESET</a>, 0);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Clock generation on CLK when Idle: hardware specific default behavior</span></div>
<div class="line"><span class="comment">// Enable Clock generation on CLK when Idle</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga889473fbfbdcb89aab4d53cc8a13f615">ARM_MCI_CONTROL_CLOCK_IDLE</a>, 1);</div>
<div class="line"><span class="comment">// Disable Clock generation on CLK when Idle</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga889473fbfbdcb89aab4d53cc8a13f615">ARM_MCI_CONTROL_CLOCK_IDLE</a>, 0);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// UHS Tuning</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga98853f60bdc085aeeccd66f7bdf22d3d">ARM_MCI_UHS_TUNING_OPERATION</a>, 1);  <span class="comment">// start tuning</span></div>
<div class="line"><span class="keywordflow">do</span> {</div>
<div class="line">  status = MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#gabd3af448e26da5657c1c5a03330476b7">ARM_MCI_UHS_TUNING_RESULT</a>, 0<span class="comment">/*argument not used*/</span>);</div>
<div class="line">  <span class="keywordflow">if</span> (status == -1) { <span class="keywordflow">break</span>; <span class="comment">/* tuning failed */</span> }</div>
<div class="line">} <span class="keywordflow">while</span> (status == 1);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Set Data Timeout to 12500000 bus cycles (0.5s @25MHz Bus Speed)</span></div>
<div class="line"><span class="comment">// Default value is hardware specific (typically 2^32-1)</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga09a58821e42595f0c2e55f8cc2d32ceb">ARM_MCI_DATA_TIMEOUT</a>, 12500000);</div>
<div class="line">  </div>
<div class="line"><span class="comment">// Set CSS Timeout to 1000000 bus cycles</span></div>
<div class="line"><span class="comment">// Default value is hardware specific</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#gae97b1a819a5d326b1f1009b0d6d48b5a">ARM_MCI_CSS_TIMEOUT</a>, 1000000);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// SD I/O Interrupt Monitoring is disabled by default</span></div>
<div class="line"><span class="comment">// Enable SD I/O Interrupt Monitoring</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga19fd7d3b74ac48ca74a2e138b3ee9963">ARM_MCI_MONITOR_SDIO_INTERRUPT</a>, 1);</div>
<div class="line"><span class="comment">// Disable SD I/O Interrupt Monitoring</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga19fd7d3b74ac48ca74a2e138b3ee9963">ARM_MCI_MONITOR_SDIO_INTERRUPT</a>, 0);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Read/Wait for SD I/O is disabled by default</span></div>
<div class="line"><span class="comment">// Enable Read/Wait for SD I/O</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#gaaa10c5aa7a8108aa59c3734b3eec2e3a">ARM_MCI_CONTROL_READ_WAIT</a>, 1);</div>
<div class="line"><span class="comment">// Disable Read/Wait for SD I/O</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#gaaa10c5aa7a8108aa59c3734b3eec2e3a">ARM_MCI_CONTROL_READ_WAIT</a>, 0);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Suspend Data transfer (SD I/O)</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#ga04cf174b0ef13240f26225bf8e45a4a0">ARM_MCI_SUSPEND_TRANSFER</a>, 0<span class="comment">/*argument not used*/</span>);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Resume Data transfer (SD I/O)</span></div>
<div class="line">MCIdrv-&gt;Control(<a class="code" href="group__mci__mode__ctrls.html#gac4907319499072fddf61f2f83b0dd966">ARM_MCI_RESUME_TRANSFER</a>, 0<span class="comment">/*argument not used*/</span>);</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ga8d61aa42ce78d1864fa928c1f273cbd9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__mci__interface__gr.html#structARM__MCI__STATUS">ARM_MCI_STATUS</a> ARM_MCI_GetStatus </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get MCI status. </p>
<dl class="section return"><dt>Returns</dt><dd>MCI status <a class="el" href="group__mci__interface__gr.html#structARM__MCI__STATUS">ARM_MCI_STATUS</a></dd></dl>
<p>The function <b>ARM_MCI_GetStatus</b> returns the current MCI interface status. </p>

</div>
</div>
<a class="anchor" id="gaac2dbd1c1a98436938c5d0d6248cb700"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ARM_MCI_SignalEvent </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>event</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Callback function that signals a MCI Card Event. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">event</td><td><a class="el" href="group__mci__event__gr.html">MCI Events</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>none</dd></dl>
<p>The function <b>ARM_MCI_SignalEvent</b> is a callback function registered by the function <a class="el" href="group__mci__interface__gr.html#ga6f34d4ab362e596ddaf23aac093268cf">ARM_MCI_Initialize</a>.</p>
<p>The parameter <em>event</em> indicates one or more events that occurred during driver operation. Each event is encoded in a separate bit and therefore it is possible to signal multiple events within the same call.</p>
<p>Not every event is necessarily generated by the driver. This depends on the implemented capabilities stored in the data fields of the structure <a class="el" href="group__nand__interface__gr.html#structARM__NAND__CAPABILITIES">ARM_NAND_CAPABILITIES</a>, which can be retrieved with the function <a class="el" href="group__nand__interface__gr.html#ga9f2609975c2008d21b9ae28f15daf147">ARM_NAND_GetCapabilities</a>.</p>
<p>The following events can be generated:</p>
<table class="doxtable">
<tr>
<th align="left">Parameter <em>event</em> </th><th align="right">Bit </th><th align="left">Description </th><th align="left">supported when <a class="el" href="group__nand__interface__gr.html#structARM__NAND__CAPABILITIES">ARM_NAND_CAPABILITIES</a>  </th></tr>
<tr>
<td align="left"><a class="el" href="group__mci__event__gr.html#gae2cf8ef238c092e94e96a01602f3a23c">ARM_MCI_EVENT_CARD_INSERTED</a> </td><td align="right">0 </td><td align="left">Occurs after Memory Card inserted </td><td align="left"><em>always supported</em> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__event__gr.html#ga92ba748f9324ec13898f10456f17c8cc">ARM_MCI_EVENT_CARD_REMOVED</a> </td><td align="right">1 </td><td align="left">Occurs after Memory Card removal </td><td align="left"><em>always supported</em> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__event__gr.html#gae69356c75d55103d93ef91ac1bc02b49">ARM_MCI_EVENT_COMMAND_COMPLETE</a> </td><td align="right">2 </td><td align="left">Occurs after command completed successfully </td><td align="left"><em>always supported</em> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__event__gr.html#gab79b3ab4dcd03c38df1e173fa903d822">ARM_MCI_EVENT_COMMAND_TIMEOUT</a> </td><td align="right">3 </td><td align="left">Occurs after command timeout </td><td align="left"><em>always supported</em> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__event__gr.html#ga373aeb3eca0e4c6d159312488a130442">ARM_MCI_EVENT_COMMAND_ERROR</a> </td><td align="right">4 </td><td align="left">Occurs after command response error (CRC error or invalid response) </td><td align="left"><em>always supported</em> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__event__gr.html#gabc3c468dedaed890683360f2c5c65bea">ARM_MCI_EVENT_TRANSFER_COMPLETE</a> </td><td align="right">5 </td><td align="left">Occurs after data transfer completed successfully </td><td align="left"><em>always supported</em> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__event__gr.html#ga614e7c7226adbaa8ec4165bf8b87ef27">ARM_MCI_EVENT_TRANSFER_TIMEOUT</a> </td><td align="right">6 </td><td align="left">Occurs after data transfer timeout </td><td align="left"><em>always supported</em> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__event__gr.html#ga5d2cee5ba6d0e40ad505983155706c29">ARM_MCI_EVENT_TRANSFER_ERROR</a> </td><td align="right">7 </td><td align="left">Occurs after data transfer error (CRC failed) </td><td align="left"><em>always supported</em> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__event__gr.html#ga75a050fdfe04e6816e96c938d6a6c197">ARM_MCI_EVENT_SDIO_INTERRUPT</a> </td><td align="right">8 </td><td align="left">Indicates SD I/O Interrupt </td><td align="left">data field <em>sdio_interrupt</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__event__gr.html#ga8161f3960ddf2a3cdc3c4c83148c6099">ARM_MCI_EVENT_CCS</a> </td><td align="right">9 </td><td align="left">Indicates a Command Completion Signal (CCS) </td><td align="left">data field <em>ccs</em> = <span class="XML-Token">1</span> </td></tr>
<tr>
<td align="left"><a class="el" href="group__mci__event__gr.html#gafa8cbcd597a05c64901eeb777cc0b74f">ARM_MCI_EVENT_CCS_TIMEOUT</a> </td><td align="right">10 </td><td align="left">Indicates a Command Completion Signal (CCS) Timeout </td><td align="left">data field <em>css_timeout</em> = <span class="XML-Token">1</span> </td></tr>
</table>
<p><b>See also:</b></p>
<ul>
<li><a class="el" href="group__mci__interface__gr.html#ga5a431da89feabc2b4bc0c27943dff6f2">ARM_MCI_SendCommand</a> </li>
</ul>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Wed Jul 10 2019 15:20:31 for CMSIS-Driver Version 2.7.1 by Arm Ltd. All rights reserved.
	<!--
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 
	-->
	</li>
  </ul>
</div>
</body>
</html>