2022-11-23 23:59:23 +08:00
\hypertarget { bsp_ _ _ s_ d_ 8cpp_ source} { } \doxysection { bsp\+ \_ \+ \+ SD.\+ cpp}
2023-03-06 12:44:58 +08:00
\label { bsp_ _ _ s_ d_ 8cpp_ source} \index { D:/gitt/MicrochipFor32/bsp\_ Device/bsp\_ SPI/bsp\_ SD.cpp@{ D:/gitt/MicrochipFor32/bsp\_ Device/bsp\_ SPI/bsp\_ SD.cpp} }
2022-11-23 23:59:23 +08:00
\mbox { \hyperlink { bsp_ _ _ s_ d_ 8cpp} { 浏览该文件的文档.} }
\begin { DoxyCode} { 0}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00001} 00001 \textcolor { comment} { /*-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00002} 00002 \textcolor { comment} { \# } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00003} 00003 \textcolor { comment} { \# Copyright (c) 2022 Yuankang Liang(XerolySkinner)} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00004} 00004 \textcolor { comment} { \# } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00005} 00005 \textcolor { comment} { \# 本软件按原样提供,无任何明示或暗示} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00006} 00006 \textcolor { comment} { \# 在任何情况下,作者都不承担任何损害赔偿责任} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00007} 00007 \textcolor { comment} { \# } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00008} 00008 \textcolor { comment} { \# 使用的许可声明:} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00009} 00009 \textcolor { comment} { \# 1. 不得歪曲本软件的来源,你不能声称你编写了原始软件.} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00010} 00010 \textcolor { comment} { \# 2. 免费授予以任何目的,前提是版权声明出现在所有副本中.} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00011} 00011 \textcolor { comment} { \# 并且版权声明和许可声明同时出现.} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00012} 00012 \textcolor { comment} { \# 3. 你有使用,复制,修改,分发,和销售本软件的许可.} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00013} 00013 \textcolor { comment} { \# 4. 如果你在产品中使用,产品文档中的声明是赞赏的但不是必须的.} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00014} 00014 \textcolor { comment} { \# 5. 本通知不得从任何来源删除或更改.} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00015} 00015 \textcolor { comment} { \# } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00016} 00016 \textcolor { comment} { \# Yuankang Liang(XerolySkinner)} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00017} 00017 \textcolor { comment} { \# E-\/ mail:zabbcccbbaz@163.com} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00018} 00018 \textcolor { comment} { \# QQ:2715099320} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00019} 00019 \textcolor { comment} { \# Mobile Phone:13005636215} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00020} 00020 \textcolor { comment} { \# } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00021} 00021 \textcolor { comment} { \# All rights reserved.} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00022} 00022 \textcolor { comment} { */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00023} 00023 }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00034} 00034 \textcolor { preprocessor} { \# include "{ } \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h} { bsp\_ SD.h} } "{ } } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00036} 00036 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00037} 00037 \textcolor { comment} { // 程序} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00038} 00038 \textcolor { comment} { // } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00043} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a3250f411819ed57543b0326d13faddc6} { 00043} } \textcolor { comment} { } \textcolor { keywordtype} { void} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a3250f411819ed57543b0326d13faddc6} { bsp\_ SD::SD\_ CS} } (\mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } p)\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00044} 00044 HAL\_ GPIO\_ WritePin(\mbox { \hyperlink { classbsp_ _ _ s_ d_ ad7788d2e62152a2fb1a6b307fa902180} { GPIOx\_ CS} } , \mbox { \hyperlink { classbsp_ _ _ s_ d_ a4525b5c0f62e39af1c9adb9a9c22239f} { GPIO\_ Pin\_ CS} } , p == 0 ? GPIO\_ PIN\_ SET: GPIO\_ PIN\_ RESET);\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00045} 00045 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00053} \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { 00053} } \textcolor { comment} { } \mbox { \hyperlink { varint_ 8h_ afaa62991928fb9fb18ff0db62a040aba} { u32} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { bsp\_ SD::SD\_ sendcmd} } (\mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } cmd, \mbox { \hyperlink { varint_ 8h_ afaa62991928fb9fb18ff0db62a040aba} { u32} } arg, \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } crc)\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00054} 00054 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } r1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00055} 00055 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } retry;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00056} 00056 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a3250f411819ed57543b0326d13faddc6} { SD\_ CS} } (0);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00057} 00057 \_ \_ nop();}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00058} 00058 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a3250f411819ed57543b0326d13faddc6} { SD\_ CS} } (1);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00059} 00059 \textcolor { keywordflow} { do} retry = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (\mbox { \hyperlink { classbsp_ _ _ s_ d_ a6c68fa82294f18968a92719931cff5fa} { DFF} } );\textcolor { keywordflow} { while} (retry != 0xFF);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00060} 00060 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (cmd | 0x40);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00061} 00061 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (arg >> 24);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00062} 00062 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (arg >> 16);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00063} 00063 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (arg >> 8);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00064} 00064 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (arg);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00065} 00065 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (crc);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00066} 00066 \textcolor { keywordflow} { if} (cmd == \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a8d6283c9b060afbaa0e6d1ff7e5ea7b8} { CMD12} } ) \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (\mbox { \hyperlink { classbsp_ _ _ s_ d_ a6c68fa82294f18968a92719931cff5fa} { DFF} } );}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00067} 00067 \textcolor { keywordflow} { do} r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (0xFF);\textcolor { keywordflow} { while} (r1 \& 0X80);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00068} 00068 \textcolor { keywordflow} { return} r1;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00069} 00069 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00074} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a1e0a3f09367627bcafc8efaaeb90b066} { 00074} } \textcolor { comment} { } \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ a1e0a3f09367627bcafc8efaaeb90b066} { bsp\_ SD::SD\_ init} } (\textcolor { keywordtype} { void} )\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00075} 00075 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } r1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00076} 00076 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } buff[6] = \{ 0\} ;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00077} 00077 \mbox { \hyperlink { varint_ 8h_ ace9d960e74685e2cd84b36132dbbf8aa} { u16} } retry;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00078} 00078 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } i;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00079} 00079 \textcolor { comment} { // MX\_ SPI3\_ Init();} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00080} 00080 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a5ed95b95b141ee21d83ca70c1b06a31a} { SPI\_ setspeed} } (SPI\_ BAUDRATEPRESCALER\_ 256);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00081} 00081 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a3250f411819ed57543b0326d13faddc6} { SD\_ CS} } (0);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00082} 00082 \textcolor { keywordflow} { for} (retry = 0; retry < 10; retry++) \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (\mbox { \hyperlink { classbsp_ _ _ s_ d_ a6c68fa82294f18968a92719931cff5fa} { DFF} } );}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00083} 00083 \textcolor { comment} { // SD卡进入IDLE状态} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00084} 00084 \textcolor { keywordflow} { do} r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a938c1466755f12fb04ac0d1b775584d1} { CMD0} } , 0, 0x95);\textcolor { keywordflow} { while} (r1 != 0x01);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00085} 00085 \textcolor { comment} { // 查看SD卡的类型} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00086} 00086 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a2350601b90ad75bd434094a9c31475c4} { SD\_ TYPE} } = 0;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00087} 00087 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ ac75b3e0ad1fb013ea946fb49bbe65668} { CMD8} } , 0x1AA, 0x87);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00088} 00088 \textcolor { keywordflow} { if} (r1 == 0x01) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00089} 00089 \textcolor { keywordflow} { for} (i = 0; i < 4; i++) buff[i] = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (\mbox { \hyperlink { classbsp_ _ _ s_ d_ a6c68fa82294f18968a92719931cff5fa} { DFF} } ); \textcolor { comment} { //Get trailing return value of R7 resp} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00090} 00090 \textcolor { keywordflow} { if} (buff[2] == 0X01 \& \& buff[3] == 0XAA) \{ \textcolor { comment} { //卡是否支持2.7\string ~3.6V} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00091} 00091 retry = 0XFFFE;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00092} 00092 \textcolor { keywordflow} { do} \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00093} 00093 \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a78289a7a85ffcfddd626694105dc0780} { CMD55} } , 0, 0X01); \textcolor { comment} { //发送CMD55} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00094} 00094 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a3ca1450d0ac55d2705aab03537bf2865} { CMD41} } , 0x40000000, 0X01); \textcolor { comment} { //发送CMD41} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00095} 00095 \} \textcolor { keywordflow} { while} (r1 \& \& retry-\/ -\/ );}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00096} 00096 \textcolor { keywordflow} { if} (retry \& \& \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ aa7a26b2cf17e1ff5967820a1fa41a7aa} { CMD58} } , 0, 0X01) == 0) \{ \textcolor { comment} { //鉴别SD2.0卡版本开始} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00097} 00097 \textcolor { keywordflow} { for} (i = 0; i < 4; i++) buff[i] = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (0XFF); \textcolor { comment} { //得到OCR值} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00098} 00098 \textcolor { keywordflow} { if} (buff[0] \& 0x40) \mbox { \hyperlink { classbsp_ _ _ s_ d_ a2350601b90ad75bd434094a9c31475c4} { SD\_ TYPE} } = \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ ae52e14c1b95e5162f4fe492d9b1b0fec} { V2HC} } ;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00099} 00099 \textcolor { keywordflow} { else} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a2350601b90ad75bd434094a9c31475c4} { SD\_ TYPE} } = \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a9173468f90b474471bfff59f8487cbc1} { V2} } ;\} \} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00100} 00100 \textcolor { keywordflow} { else} \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00101} 00101 \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a78289a7a85ffcfddd626694105dc0780} { CMD55} } , 0, 0X01); \textcolor { comment} { //发送CMD55} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00102} 00102 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a3ca1450d0ac55d2705aab03537bf2865} { CMD41} } , 0, 0X01); \textcolor { comment} { //发送CMD41} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00103} 00103 \textcolor { keywordflow} { if} (r1 <= 1) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00104} 00104 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a2350601b90ad75bd434094a9c31475c4} { SD\_ TYPE} } = \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ ae21a9518b4dd62d2baeab430c89a657a} { V1} } ;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00105} 00105 retry = 0XFFFE;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00106} 00106 \textcolor { keywordflow} { do} \{ \textcolor { comment} { //等待退出IDLE模式} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00107} 00107 \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a78289a7a85ffcfddd626694105dc0780} { CMD55} } , 0, 0X01); \textcolor { comment} { //发送CMD55} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00108} 00108 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a3ca1450d0ac55d2705aab03537bf2865} { CMD41} } , 0, 0X01); \textcolor { comment} { //发送CMD41} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00109} 00109 \} \textcolor { keywordflow} { while} (r1 \& \& retry-\/ -\/ );\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00110} 00110 \textcolor { keywordflow} { else} \{ \textcolor { comment} { //MMC卡不支持CMD55+CMD41识别} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00111} 00111 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a2350601b90ad75bd434094a9c31475c4} { SD\_ TYPE} } = \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ ab5a7d5477e55758bde614bda3250a93c} { MMC} } ; \textcolor { comment} { //MMC V3} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00112} 00112 retry = 0XFFFE;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00113} 00113 \textcolor { keywordflow} { do} r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ aca9979f299fa78c1128d778084478673} { CMD1} } , 0, 0X01);\textcolor { keywordflow} { while} (r1 \& \& retry-\/ -\/ );\} \textcolor { comment} { //等待退出IDLE模式} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00114} 00114 \textcolor { keywordflow} { if} (retry == 0 || \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ aaeab261b94f2031ba41a1d4d857c3541} { CMD16} } , 512, 0X01) != 0) \mbox { \hyperlink { classbsp_ _ _ s_ d_ a2350601b90ad75bd434094a9c31475c4} { SD\_ TYPE} } = \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a735563036dced0b7d6cc98f97ea4978b} { ERR} } ;\} \textcolor { comment} { //错误的卡} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00115} 00115 \} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00116} 00116 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a3250f411819ed57543b0326d13faddc6} { SD\_ CS} } (0);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00117} 00117 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a5ed95b95b141ee21d83ca70c1b06a31a} { SPI\_ setspeed} } (SPI\_ BAUDRATEPRESCALER\_ 2);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00118} 00118 \textcolor { keywordflow} { if} (\mbox { \hyperlink { classbsp_ _ _ s_ d_ a2350601b90ad75bd434094a9c31475c4} { SD\_ TYPE} } ) \textcolor { keywordflow} { return} 0;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00119} 00119 \textcolor { keywordflow} { else} \textcolor { keywordflow} { return} 1;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00120} 00120 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00127} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a242ec4ccd88203b6691cf4ae1e77fdfe} { 00127} } \textcolor { comment} { } \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ a242ec4ccd88203b6691cf4ae1e77fdfe} { bsp\_ SD::SD\_ ReceiveData} } (\mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } * data, \mbox { \hyperlink { varint_ 8h_ ace9d960e74685e2cd84b36132dbbf8aa} { u16} } len)\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00128} 00128 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } r1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00129} 00129 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a3250f411819ed57543b0326d13faddc6} { SD\_ CS} } (1);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00130} 00130 \textcolor { keywordflow} { do} \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00131} 00131 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (0xFF);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00132} 00132 \_ \_ nop();}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00133} 00133 \} \textcolor { keywordflow} { while} (r1 != 0xFE);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00134} 00134 \textcolor { keywordflow} { while} (len-\/ -\/ ) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00135} 00135 *data = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (0xFF);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00136} 00136 data++;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00137} 00137 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (0xFF);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00138} 00138 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (0xFF);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00139} 00139 \textcolor { keywordflow} { return} 0;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00140} 00140 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00147} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a2df843979bb4c764422a37b255c184ea} { 00147} } \textcolor { comment} { } \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ a2df843979bb4c764422a37b255c184ea} { bsp\_ SD::SD\_ SendBlock} } (\mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } * buf, \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } cmd)\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00148} 00148 \mbox { \hyperlink { varint_ 8h_ ace9d960e74685e2cd84b36132dbbf8aa} { u16} } t;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00149} 00149 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } r1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00150} 00150 \textcolor { keywordflow} { do} r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (0xFF);\textcolor { keywordflow} { while} (r1 != 0xFF);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00151} 00151 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (cmd);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00152} 00152 \textcolor { keywordflow} { if} (cmd != 0XFD) \{ \textcolor { comment} { //不是结束指令} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00153} 00153 \textcolor { keywordflow} { for} (t = 0; t < 512; t++) \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (buf[t]); \textcolor { comment} { //提高速度,减少函数传参时间} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00154} 00154 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (0xFF); \textcolor { comment} { //忽略crc} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00155} 00155 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (0xFF);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00156} 00156 t = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { spi\_ readwrite} } (0xFF); \textcolor { comment} { //接收响应} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00157} 00157 \textcolor { keywordflow} { if} ((t \& 0x1F) != 0x05) \textcolor { keywordflow} { return} 2;\} \textcolor { comment} { //响应错误} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00158} 00158 \textcolor { keywordflow} { return} 0;\} \textcolor { comment} { //写入成功} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00159} 00159 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00164} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a25bc03ff69d0c3c9a73153c71c84a8b0} { 00164} } \textcolor { comment} { } \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ a25bc03ff69d0c3c9a73153c71c84a8b0} { bsp\_ SD::SD\_ GETCID} } (\mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } * cid\_ data)\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00165} 00165 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } r1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00166} 00166 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ ae7b800ed8e7bd52e6f570a5ce72b8104} { CMD10} } , 0, 0x01); \textcolor { comment} { //读取CID寄存器} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00167} 00167 \textcolor { keywordflow} { if} (r1 == 0x00) r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a242ec4ccd88203b6691cf4ae1e77fdfe} { SD\_ ReceiveData} } (cid\_ data, 16);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00168} 00168 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a3250f411819ed57543b0326d13faddc6} { SD\_ CS} } (0);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00169} 00169 \textcolor { keywordflow} { if} (r1) \textcolor { keywordflow} { return} 1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00170} 00170 \textcolor { keywordflow} { else} \textcolor { keywordflow} { return} 0;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00171} 00171 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00176} \mbox { \hyperlink { classbsp_ _ _ s_ d_ ad0426f6a4b550e60a926c95724d81665} { 00176} } \textcolor { comment} { } \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ ad0426f6a4b550e60a926c95724d81665} { bsp\_ SD::SD\_ GETCSD} } (\mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } * csd\_ data)\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00177} 00177 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } r1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00178} 00178 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a1fac6a251d7e7dc204d21639bf521459} { CMD9} } , 0, 0x01); \textcolor { comment} { //发CMD9命令, 读CSD寄存器} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00179} 00179 \textcolor { keywordflow} { if} (r1 == 0) r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a242ec4ccd88203b6691cf4ae1e77fdfe} { SD\_ ReceiveData} } (csd\_ data, 16); \textcolor { comment} { //接收16个字节的数据 } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00180} 00180 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a3250f411819ed57543b0326d13faddc6} { SD\_ CS} } (0); \textcolor { comment} { //取消片选} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00181} 00181 \textcolor { keywordflow} { if} (r1) \textcolor { keywordflow} { return} 1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00182} 00182 \textcolor { keywordflow} { else} \textcolor { keywordflow} { return} 0;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00183} 00183 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00188} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a600cc886dc5da6d34f75d0bf226c1b92} { 00188} } \textcolor { comment} { } \mbox { \hyperlink { varint_ 8h_ afaa62991928fb9fb18ff0db62a040aba} { u32} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ a600cc886dc5da6d34f75d0bf226c1b92} { bsp\_ SD::SD\_ GetSectorCount} } (\textcolor { keywordtype} { void} )\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00189} 00189 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } csd[16];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00190} 00190 \mbox { \hyperlink { varint_ 8h_ afaa62991928fb9fb18ff0db62a040aba} { u32} } Capacity;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00191} 00191 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } n;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00192} 00192 \mbox { \hyperlink { varint_ 8h_ ace9d960e74685e2cd84b36132dbbf8aa} { u16} } csize;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00193} 00193 \textcolor { comment} { //取CSD信息, 如果期间出错, 返回0} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00194} 00194 \textcolor { keywordflow} { if} (\mbox { \hyperlink { classbsp_ _ _ s_ d_ ad0426f6a4b550e60a926c95724d81665} { SD\_ GETCSD} } (csd) != 0) \textcolor { keywordflow} { return} 0;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00195} 00195 \textcolor { comment} { //如果为SDHC卡, 按照下面方式计算} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00196} 00196 \textcolor { keywordflow} { if} ((csd[0] \& 0xC0) == 0x40) \{ \textcolor { comment} { //V2.00的卡} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00197} 00197 csize = csd[9] + ((\mbox { \hyperlink { varint_ 8h_ ace9d960e74685e2cd84b36132dbbf8aa} { u16} } ) csd[8] << 8) + 1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00198} 00198 Capacity = (\mbox { \hyperlink { varint_ 8h_ afaa62991928fb9fb18ff0db62a040aba} { u32} } )}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00199} 00199 csize << 10;\} \textcolor { comment} { //得到扇区数} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00200} 00200 \textcolor { keywordflow} { else} \{ \textcolor { comment} { //V1.XX的卡} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00201} 00201 n = (csd[5] \& 15) + ((csd[10] \& 128) >> 7) + ((csd[9] \& 3) << 1) + 2;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00202} 00202 csize = (csd[8] >> 6) + ((\mbox { \hyperlink { varint_ 8h_ ace9d960e74685e2cd84b36132dbbf8aa} { u16} } ) csd[7] << 2) + ((\mbox { \hyperlink { varint_ 8h_ ace9d960e74685e2cd84b36132dbbf8aa} { u16} } ) (csd[6] \& 3) << 10) + 1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00203} 00203 Capacity = (\mbox { \hyperlink { varint_ 8h_ afaa62991928fb9fb18ff0db62a040aba} { u32} } )}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00204} 00204 csize << (n -\/ 9);\} \textcolor { comment} { //得到扇区数} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00205} 00205 \textcolor { keywordflow} { return} Capacity;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00206} 00206 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00207} \mbox { \hyperlink { classbsp_ _ _ s_ d_ aaf2d27cc9275f3ffa71556124f143d12} { 00207} } \textcolor { keywordtype} { int} \mbox { \hyperlink { classbsp_ _ _ s_ d_ aaf2d27cc9275f3ffa71556124f143d12} { bsp\_ SD::MSD0\_ GetCardInfo} } (\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o} { PMSD\_ CARDINFO} } \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a2c85a6a257358283b46ba829ae0c2dba} { SD0\_ CardInfo} } )\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00208} 00208 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } r1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00209} 00209 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } CSD\_ Tab[16];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00210} 00210 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } CID\_ Tab[16];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00211} 00211 \textcolor { comment} { /* Send CMD9, Read CSD */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00212} 00212 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a1fac6a251d7e7dc204d21639bf521459} { CMD9} } , 0, 0xFF);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00213} 00213 \textcolor { keywordflow} { if} (r1 != 0x00) \textcolor { keywordflow} { return} r1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00214} 00214 \textcolor { keywordflow} { if} (\mbox { \hyperlink { classbsp_ _ _ s_ d_ a242ec4ccd88203b6691cf4ae1e77fdfe} { SD\_ ReceiveData} } (CSD\_ Tab, 16)) \textcolor { keywordflow} { return} 1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00215} 00215 \textcolor { comment} { /* Send CMD10, Read CID */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00216} 00216 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ ae7b800ed8e7bd52e6f570a5ce72b8104} { CMD10} } , 0, 0xFF);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00217} 00217 \textcolor { keywordflow} { if} (r1 != 0x00) \textcolor { keywordflow} { return} r1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00218} 00218 \textcolor { keywordflow} { if} (\mbox { \hyperlink { classbsp_ _ _ s_ d_ a242ec4ccd88203b6691cf4ae1e77fdfe} { SD\_ ReceiveData} } (CID\_ Tab, 16)) \textcolor { keywordflow} { return} 2;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00219} 00219 \textcolor { comment} { /* Byte 0 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00220} 00220 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a53c6d82426462a5f31a0e07bc2014d97} { CSDStruct} } = (CSD\_ Tab[0] \& 0xC0) >> 6;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00221} 00221 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a8709246fbcaa2984e8752e5d028a25e1} { SysSpecVersion} } = (CSD\_ Tab[0] \& 0x3C) >> 2;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00222} 00222 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a43d9f48b7a10b9b16700cc4df7f944c0} { Reserved1} } = CSD\_ Tab[0] \& 0x03;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00223} 00223 \textcolor { comment} { /* Byte 1 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00224} 00224 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ ac80ef2c5f8eedf6e361b9d48da66d98d} { TAAC} } = CSD\_ Tab[1];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00225} 00225 \textcolor { comment} { /* Byte 2 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00226} 00226 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ ae9fdc21394cb38fc96de03821b5b1f5b} { NSAC} } = CSD\_ Tab[2];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00227} 00227 \textcolor { comment} { /* Byte 3 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00228} 00228 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ ae4fe7f59ec2c0fec2d5c5edc912de487} { MaxBusClkFrec} } = CSD\_ Tab[3];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00229} 00229 \textcolor { comment} { /* Byte 4 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00230} 00230 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a235ebfcf7116a28eb8f7e2348b46c279} { CardComdClasses} } = CSD\_ Tab[4] << 4;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00231} 00231 \textcolor { comment} { /* Byte 5 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00232} 00232 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a235ebfcf7116a28eb8f7e2348b46c279} { CardComdClasses} } |= (CSD\_ Tab[5] \& 0xF0) >> 4;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00233} 00233 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a0d503ea30e3553e3dbf1d259c1835bca} { RdBlockLen} } = CSD\_ Tab[5] \& 0x0F;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00234} 00234 \textcolor { comment} { /* Byte 6 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00235} 00235 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a7e302d0f797f25a53205bf683fcb9315} { PartBlockRead} } = (CSD\_ Tab[6] \& 0x80) >> 7;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00236} 00236 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ aaf61be1914d24eeef107b78d57f96f66} { WrBlockMisalign} } = (CSD\_ Tab[6] \& 0x40) >> 6;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00237} 00237 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ ad4c2ce16da22ad02424466d1b42d04b0} { RdBlockMisalign} } = (CSD\_ Tab[6] \& 0x20) >> 5;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00238} 00238 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a6010a523c29470b3fca2a179608bb165} { DSRImpl} } = (CSD\_ Tab[6] \& 0x10) >> 4;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00239} 00239 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ af46b7c72145239d75dcf08e97a8015cb} { Reserved2} } = 0; \textcolor { comment} { /* Reserved */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00240} 00240 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ ab2341b019f101f621817ab7f13f85321} { DeviceSize} } = (CSD\_ Tab[6] \& 0x03) << 10;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00241} 00241 \textcolor { comment} { /* Byte 7 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00242} 00242 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ ab2341b019f101f621817ab7f13f85321} { DeviceSize} } |= (CSD\_ Tab[7]) << 2;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00243} 00243 \textcolor { comment} { /* Byte 8 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00244} 00244 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ ab2341b019f101f621817ab7f13f85321} { DeviceSize} } |= (CSD\_ Tab[8] \& 0xC0) >> 6;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00245} 00245 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a5f028ae76ae390e7efc7581863f86fa4} { MaxRdCurrentVDDMin} } = (CSD\_ Tab[8] \& 0x38) >> 3;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00246} 00246 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a81dee06837a4a641a428af5271ce7881} { MaxRdCurrentVDDMax} } = (CSD\_ Tab[8] \& 0x07);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00247} 00247 \textcolor { comment} { /* Byte 9 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00248} 00248 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a4312d08d19360f8cda0fdcefea8c58a8} { MaxWrCurrentVDDMin} } = (CSD\_ Tab[9] \& 0xE0) >> 5;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00249} 00249 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a5a4157c022770f5f2a22da59f1287ec1} { MaxWrCurrentVDDMax} } = (CSD\_ Tab[9] \& 0x1C) >> 2;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00250} 00250 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a021add43b09781e1c4feb5a911bab718} { DeviceSizeMul} } = (CSD\_ Tab[9] \& 0x03) << 1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00251} 00251 \textcolor { comment} { /* Byte 10 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00252} 00252 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a021add43b09781e1c4feb5a911bab718} { DeviceSizeMul} } |= (CSD\_ Tab[10] \& 0x80) >> 7;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00253} 00253 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a3217bd2b49b77943bcb3e5a6f5f0e419} { EraseGrSize} } = (CSD\_ Tab[10] \& 0x7C) >> 2;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00254} 00254 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a6d4b83a1a42edb0e08f674fa6e611d28} { EraseGrMul} } = (CSD\_ Tab[10] \& 0x03) << 3;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00255} 00255 \textcolor { comment} { /* Byte 11 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00256} 00256 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a6d4b83a1a42edb0e08f674fa6e611d28} { EraseGrMul} } |= (CSD\_ Tab[11] \& 0xE0) >> 5;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00257} 00257 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ aa21f77c612167167e40003b6d3784689} { WrProtectGrSize} } = (CSD\_ Tab[11] \& 0x1F);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00258} 00258 \textcolor { comment} { /* Byte 12 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00259} 00259 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a0d11fc6f8c1e51d1b63887603eee8915} { WrProtectGrEnable} } = (CSD\_ Tab[12] \& 0x80) >> 7;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00260} 00260 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a1ee9e5144b15487f92f6d9ce59835428} { ManDeflECC} } = (CSD\_ Tab[12] \& 0x60) >> 5;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00261} 00261 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a3ededd192a17234569a584cbd72b12ae} { WrSpeedFact} } = (CSD\_ Tab[12] \& 0x1C) >> 2;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00262} 00262 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a0dcba500cb60f6ce8d95864ae2eaa307} { MaxWrBlockLen} } = (CSD\_ Tab[12] \& 0x03) << 2;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00263} 00263 \textcolor { comment} { /* Byte 13 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00264} 00264 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a0dcba500cb60f6ce8d95864ae2eaa307} { MaxWrBlockLen} } |= (CSD\_ Tab[13] \& 0xc0) >> 6;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00265} 00265 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a3c32bff0de0b6cba1f9bd3205159e6e4} { WriteBlockPaPartial} } = (CSD\_ Tab[13] \& 0x20) >> 5;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00266} 00266 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a83b44a54e8cefcfffdfb5a744d0bf3d5} { Reserved3} } = 0;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00267} 00267 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ aaadb152d2dce1323e589580ef0099fec} { ContentProtectAppli} } = (CSD\_ Tab[13] \& 0x01);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00268} 00268 \textcolor { comment} { /* Byte 14 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00269} 00269 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a08f8247c46de7ef2b0677886470d7792} { FileFormatGrouop} } = (CSD\_ Tab[14] \& 0x80) >> 7;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00270} 00270 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a17f58dd1f98e6e6376efe142f352cb59} { CopyFlag} } = (CSD\_ Tab[14] \& 0x40) >> 6;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00271} 00271 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a150bf25ff42008d58320a6b7e531c9ab} { PermWrProtect} } = (CSD\_ Tab[14] \& 0x20) >> 5;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00272} 00272 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a3f2c48bb307e7779173e3563bbd5038f} { TempWrProtect} } = (CSD\_ Tab[14] \& 0x10) >> 4;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00273} 00273 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ ac3510e157155d4b9d9f67591b1cb0c8e} { FileFormat} } = (CSD\_ Tab[14] \& 0x0C) >> 2;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00274} 00274 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a1e153d660ffe4bbafa596d4b0b8c2906} { ECC} } = (CSD\_ Tab[14] \& 0x03);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00275} 00275 \textcolor { comment} { /* Byte 15 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00276} 00276 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a81e9f99cdd87dd2e0305b3b191aa5226} { CSD\_ CRC} } = (CSD\_ Tab[15] \& 0xFE) >> 1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00277} 00277 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ a36b124f6ffc0716dc0dc93c407b975d1} { Reserved4} } = 1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00278} 00278 \textcolor { keywordflow} { if} (\mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a8f29efd96df6abb8cd6353787eebca04} { CardType} } == \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ ae52e14c1b95e5162f4fe492d9b1b0fec} { V2HC} } ) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00279} 00279 \textcolor { comment} { /* Byte 7 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00280} 00280 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ ab2341b019f101f621817ab7f13f85321} { DeviceSize} } = (\mbox { \hyperlink { varint_ 8h_ ace9d960e74685e2cd84b36132dbbf8aa} { u16} } ) (CSD\_ Tab[8]) * 256;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00281} 00281 \textcolor { comment} { /* Byte 8 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00282} 00282 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ ab2341b019f101f621817ab7f13f85321} { DeviceSize} } += CSD\_ Tab[9];\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00283} 00283 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a4e5da8ba91229ac3ccb2d3f11f1ab4bf} { Capacity} } = \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ a9893f18007a0897aa45869e703f4cc2a} { CSD} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ s_ d_ ab2341b019f101f621817ab7f13f85321} { DeviceSize} } * \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a5bda0c70032a9b8625ae5a3c55d21c38} { MSD\_ BLOCKSIZE} } * 1024;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00284} 00284 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ aadaf986217b3c403be1cc4a2fd2fd148} { BlockSize} } = \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a5bda0c70032a9b8625ae5a3c55d21c38} { MSD\_ BLOCKSIZE} } ;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00285} 00285 \textcolor { comment} { /* Byte 0 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00286} 00286 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ a5ae9ad5d65182a34e20b87fa2752010e} { ManufacturerID} } = CID\_ Tab[0];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00287} 00287 \textcolor { comment} { /* Byte 1 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00288} 00288 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ acd04644e46f7ceca82bbe9bdc80f1d53} { OEM\_ AppliID} } = CID\_ Tab[1] << 8;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00289} 00289 \textcolor { comment} { /* Byte 2 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00290} 00290 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ acd04644e46f7ceca82bbe9bdc80f1d53} { OEM\_ AppliID} } |= CID\_ Tab[2];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00291} 00291 \textcolor { comment} { /* Byte 3 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00292} 00292 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ ab7e359a09fecf1fa2d1b18e708dcc292} { ProdName1} } = CID\_ Tab[3] << 24;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00293} 00293 \textcolor { comment} { /* Byte 4 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00294} 00294 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ ab7e359a09fecf1fa2d1b18e708dcc292} { ProdName1} } |= CID\_ Tab[4] << 16;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00295} 00295 \textcolor { comment} { /* Byte 5 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00296} 00296 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ ab7e359a09fecf1fa2d1b18e708dcc292} { ProdName1} } |= CID\_ Tab[5] << 8;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00297} 00297 \textcolor { comment} { /* Byte 6 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00298} 00298 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ ab7e359a09fecf1fa2d1b18e708dcc292} { ProdName1} } |= CID\_ Tab[6];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00299} 00299 \textcolor { comment} { /* Byte 7 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00300} 00300 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ ad0d7606f38a0140075647fb3f66614ea} { ProdName2} } = CID\_ Tab[7];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00301} 00301 \textcolor { comment} { /* Byte 8 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00302} 00302 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ acd9fbacd30fdff0eef7d885ad4ec438b} { ProdRev} } = CID\_ Tab[8];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00303} 00303 \textcolor { comment} { /* Byte 9 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00304} 00304 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ a0c5c88d258f73f17a496f3b92d9cfd5c} { ProdSN} } = CID\_ Tab[9] << 24;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00305} 00305 \textcolor { comment} { /* Byte 10 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00306} 00306 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ a0c5c88d258f73f17a496f3b92d9cfd5c} { ProdSN} } |= CID\_ Tab[10] << 16;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00307} 00307 \textcolor { comment} { /* Byte 11 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00308} 00308 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ a0c5c88d258f73f17a496f3b92d9cfd5c} { ProdSN} } |= CID\_ Tab[11] << 8;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00309} 00309 \textcolor { comment} { /* Byte 12 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00310} 00310 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ a0c5c88d258f73f17a496f3b92d9cfd5c} { ProdSN} } |= CID\_ Tab[12];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00311} 00311 \textcolor { comment} { /* Byte 13 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00312} 00312 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ a1be2e4d82c95f2d158ce5f5157a7fd5b} { Reserved1} } |= (CID\_ Tab[13] \& 0xF0) >> 4;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00313} 00313 \textcolor { comment} { /* Byte 14 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00314} 00314 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ a55015d75002e50ff4f23cd19c9b5c90a} { ManufactDate} } = (CID\_ Tab[13] \& 0x0F) << 8;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00315} 00315 \textcolor { comment} { /* Byte 15 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00316} 00316 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ a55015d75002e50ff4f23cd19c9b5c90a} { ManufactDate} } |= CID\_ Tab[14];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00317} 00317 \textcolor { comment} { /* Byte 16 */} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00318} 00318 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ a61fe89c386eb7bf7b8e2ba44545168de} { CID\_ CRC} } = (CID\_ Tab[15] \& 0xFE) >> 1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00319} 00319 \mbox { \hyperlink { classbsp_ _ _ s_ d_ aab1487286ac43dc9110e65b52c850de4} { SD0\_ CardInfo} } -\/ >\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ a_ r_ d_ i_ n_ f_ o_ ab267c45d70fa28f9ff17829fa8753509} { CID} } .\mbox { \hyperlink { struct_ m_ s_ d_ _ _ c_ i_ d_ aac8e73e305ea1ff29ae195a6c0a63e05} { Reserved2} } = 1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00320} 00320 \textcolor { keywordflow} { return} 0;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00321} 00321 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00329} \mbox { \hyperlink { classbsp_ _ _ s_ d_ af203b65e00206d38ef14640f7b7242b6} { 00329} } \textcolor { comment} { } \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ af203b65e00206d38ef14640f7b7242b6} { bsp\_ SD::SD\_ WriteDisk} } (\mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } * buf, \mbox { \hyperlink { varint_ 8h_ afaa62991928fb9fb18ff0db62a040aba} { u32} } sector, \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } cnt)\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00330} 00330 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } r1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00331} 00331 \textcolor { keywordflow} { if} (\mbox { \hyperlink { classbsp_ _ _ s_ d_ a2350601b90ad75bd434094a9c31475c4} { SD\_ TYPE} } != \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ ae52e14c1b95e5162f4fe492d9b1b0fec} { V2HC} } ) sector *= 512; \textcolor { comment} { //转换为字节地址} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00332} 00332 \textcolor { keywordflow} { if} (cnt == 1)\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00333} 00333 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a252300302c6f7960df547a7f5c25be85} { CMD24} } , sector, 0X01); \textcolor { comment} { //读命令} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00334} 00334 \textcolor { keywordflow} { if} (r1 == 0) \textcolor { comment} { //指令发送成功} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00335} 00335 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a2df843979bb4c764422a37b255c184ea} { SD\_ SendBlock} } (buf, 0xFE);\} \textcolor { comment} { //写512个字节} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00336} 00336 \textcolor { keywordflow} { else} \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00337} 00337 \textcolor { keywordflow} { if} (\mbox { \hyperlink { classbsp_ _ _ s_ d_ a2350601b90ad75bd434094a9c31475c4} { SD\_ TYPE} } != \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ ab5a7d5477e55758bde614bda3250a93c} { MMC} } ) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00338} 00338 \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a78289a7a85ffcfddd626694105dc0780} { CMD55} } , 0, 0X01);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00339} 00339 \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a14506e981f38b6177bc36f72c2ca18b1} { CMD23} } , cnt, 0X01);\} \textcolor { comment} { //发送指令} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00340} 00340 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ aee2c673fba987178f4642531fdeefe9e} { CMD25} } , sector, 0X01); \textcolor { comment} { //连续读命令} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00341} 00341 \textcolor { keywordflow} { if} (r1 == 0) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00342} 00342 \textcolor { keywordflow} { do} \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00343} 00343 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a2df843979bb4c764422a37b255c184ea} { SD\_ SendBlock} } (buf, 0xFC); \textcolor { comment} { //接收512个字节} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00344} 00344 buf += 512;\} \textcolor { keywordflow} { while} (-\/ -\/ cnt \& \& r1 == 0);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00345} 00345 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a2df843979bb4c764422a37b255c184ea} { SD\_ SendBlock} } (0, 0xFD);\} \} \textcolor { comment} { //接收512个字节} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00346} 00346 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a3250f411819ed57543b0326d13faddc6} { SD\_ CS} } (0); \textcolor { comment} { //取消片选} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00347} 00347 \textcolor { keywordflow} { return} r1;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00348} 00348 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00356} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a96f32b50ec777acc0dd819150cd28937} { 00356} } \textcolor { comment} { } \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ a96f32b50ec777acc0dd819150cd28937} { bsp\_ SD::SD\_ ReadDisk} } (\mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } * buf, \mbox { \hyperlink { varint_ 8h_ afaa62991928fb9fb18ff0db62a040aba} { u32} } sector, \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } cnt)\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00357} 00357 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } r1;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00358} 00358 \textcolor { keywordflow} { if} (\mbox { \hyperlink { classbsp_ _ _ s_ d_ a2350601b90ad75bd434094a9c31475c4} { SD\_ TYPE} } != \mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ ae52e14c1b95e5162f4fe492d9b1b0fec} { V2HC} } ) sector <<= 9; \textcolor { comment} { //转换为字节地址} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00359} 00359 \textcolor { keywordflow} { if} (cnt == 1) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00360} 00360 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a6bbfe7dc16a19b7f40efcf554b5666ad} { CMD17} } , sector, 0X01); \textcolor { comment} { //读命令} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00361} 00361 \textcolor { keywordflow} { if} (r1 == 0) \textcolor { comment} { //指令发送成功} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00362} 00362 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a242ec4ccd88203b6691cf4ae1e77fdfe} { SD\_ ReceiveData} } (buf, 512);\} \textcolor { comment} { //接收512个字节} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00363} 00363 \textcolor { keywordflow} { else} \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00364} 00364 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a3d32c27a6be061b865ba539127278f14} { CMD18} } , sector, 0X01); \textcolor { comment} { //连续读命令} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00365} 00365 \textcolor { keywordflow} { do} \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00366} 00366 r1 = \mbox { \hyperlink { classbsp_ _ _ s_ d_ a242ec4ccd88203b6691cf4ae1e77fdfe} { SD\_ ReceiveData} } (buf, 512); \textcolor { comment} { //接收512个字节 } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00367} 00367 buf += 512;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00368} 00368 \textcolor { keywordflow} { while} (-\/ -\/ cnt \& \& r1 == 0);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00369} 00369 \mbox { \hyperlink { classbsp_ _ _ s_ d_ ab799d7d8ebaf4c304bf62722ba10ba37} { SD\_ sendcmd} } (\mbox { \hyperlink { bsp_ _ _ s_ d_ 8h_ a8d6283c9b060afbaa0e6d1ff7e5ea7b8} { CMD12} } , 0, 0X01);\} \textcolor { comment} { //发送停止命令} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00370} 00370 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a3250f411819ed57543b0326d13faddc6} { SD\_ CS} } (0); \textcolor { comment} { //取消片选} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00371} 00371 \textcolor { keywordflow} { return} r1;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00372} 00372 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00373} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { 00373} } \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ a36d1110bcbe2404ddd5796dc078ce1f5} { bsp\_ SD::spi\_ readwrite} } (\mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } Txdata)\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00374} 00374 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } Rxdata;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00375} 00375 HAL\_ SPI\_ TransmitReceive(\mbox { \hyperlink { classbsp_ _ _ s_ d_ a227c7eb7a28e89d6adfda085a4217992} { hspi} } , \& Txdata, \& Rxdata, 1, 0xFF);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00376} 00376 \textcolor { keywordflow} { return} Rxdata;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00377} 00377 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00383} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a5ed95b95b141ee21d83ca70c1b06a31a} { 00383} } \textcolor { comment} { } \textcolor { keywordtype} { void} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a5ed95b95b141ee21d83ca70c1b06a31a} { bsp\_ SD::SPI\_ setspeed} } (\mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } speed)\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00384} 00384 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a227c7eb7a28e89d6adfda085a4217992} { hspi} } -\/ >Init.BaudRatePrescaler = speed;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00385} 00385 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00393} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a164f0bb03133464f2da485f362a52718} { 00393} } \textcolor { comment} { } \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ a164f0bb03133464f2da485f362a52718} { bsp\_ SD::offsetWrite} } (\mbox { \hyperlink { varint_ 8h_ a3f7e2bcbb0b4c338f3c4f6c937cd4234} { u64} } offset,\mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } * dat,\mbox { \hyperlink { varint_ 8h_ a3f7e2bcbb0b4c338f3c4f6c937cd4234} { u64} } datlen) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00394} 00394 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } sectorBuff[512] = \{ 0 \} ;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00395} 00395 \mbox { \hyperlink { varint_ 8h_ a3f7e2bcbb0b4c338f3c4f6c937cd4234} { u64} } sectorBuffptr = 0;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00396} 00396 }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00397} 00397 \mbox { \hyperlink { varint_ 8h_ a3f7e2bcbb0b4c338f3c4f6c937cd4234} { u64} } sectorSour = offset / 512; \textcolor { comment} { // 起始扇} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00398} 00398 \mbox { \hyperlink { varint_ 8h_ a3f7e2bcbb0b4c338f3c4f6c937cd4234} { u64} } sectorSourlen = offset \% 512; \textcolor { comment} { // 起始扇内位} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00399} 00399 }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00400} 00400 \textcolor { comment} { // 填入数据} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00401} 00401 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a96f32b50ec777acc0dd819150cd28937} { SD\_ ReadDisk} } (sectorBuff,sectorSour,1);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00402} 00402 sectorBuffptr = sectorSourlen;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00403} 00403 \textcolor { keywordflow} { for} (\mbox { \hyperlink { varint_ 8h_ a3f7e2bcbb0b4c338f3c4f6c937cd4234} { u64} } i = 0; i < datlen; i++) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00404} 00404 \textcolor { comment} { // 写入数据} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00405} 00405 sectorBuff[sectorBuffptr] = dat[i];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00406} 00406 sectorBuffptr++;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00407} 00407 \textcolor { comment} { // 扇区回写} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00408} 00408 \textcolor { keywordflow} { if} (sectorBuffptr == 512 || i == datlen -\/ 1) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00409} 00409 \mbox { \hyperlink { classbsp_ _ _ s_ d_ af203b65e00206d38ef14640f7b7242b6} { SD\_ WriteDisk} } (sectorBuff,sectorSour,1);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00410} 00410 sectorBuffptr = 0;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00411} 00411 sectorSour++;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00412} 00412 \textcolor { keywordflow} { if} (i != datlen -\/ 1)\mbox { \hyperlink { classbsp_ _ _ s_ d_ a96f32b50ec777acc0dd819150cd28937} { SD\_ ReadDisk} } (sectorBuff,sectorSour,1);\} \} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00413} 00413 \textcolor { keywordflow} { return} 0;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00414} 00414 \} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00415} 00415 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00423} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a1c78e6f5a72f3bdec600a52331dd4d20} { 00423} } \textcolor { comment} { } \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ a1c78e6f5a72f3bdec600a52331dd4d20} { bsp\_ SD::offsetRead} } (\mbox { \hyperlink { varint_ 8h_ a3f7e2bcbb0b4c338f3c4f6c937cd4234} { u64} } offset,\mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } * dat,\mbox { \hyperlink { varint_ 8h_ a3f7e2bcbb0b4c338f3c4f6c937cd4234} { u64} } datlen) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00424} 00424 \mbox { \hyperlink { varint_ 8h_ a92c50087ca0e64fa93fc59402c55f8ca} { u8} } sectorBuff[512] = \{ 0 \} ;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00425} 00425 \mbox { \hyperlink { varint_ 8h_ a3f7e2bcbb0b4c338f3c4f6c937cd4234} { u64} } sectorBuffptr = 0;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00426} 00426 }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00427} 00427 \mbox { \hyperlink { varint_ 8h_ a3f7e2bcbb0b4c338f3c4f6c937cd4234} { u64} } sectorSour = offset / 512; \textcolor { comment} { // 起始扇} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00428} 00428 \mbox { \hyperlink { varint_ 8h_ a3f7e2bcbb0b4c338f3c4f6c937cd4234} { u64} } sectorSourlen = offset \% 512; \textcolor { comment} { // 起始扇内位} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00429} 00429 }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00430} 00430 \textcolor { comment} { // 填入数据} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00431} 00431 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a96f32b50ec777acc0dd819150cd28937} { SD\_ ReadDisk} } (sectorBuff,sectorSour,1);}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00432} 00432 sectorBuffptr = sectorSourlen;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00433} 00433 \textcolor { keywordflow} { for} (\mbox { \hyperlink { varint_ 8h_ a3f7e2bcbb0b4c338f3c4f6c937cd4234} { u64} } i = 0; i < datlen; i++) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00434} 00434 \textcolor { comment} { // 写入数据} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00435} 00435 dat[i]=sectorBuff[sectorBuffptr];}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00436} 00436 sectorBuffptr++;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00437} 00437 \textcolor { comment} { // 扇区回写} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00438} 00438 \textcolor { keywordflow} { if} (sectorBuffptr == 512 || i == datlen -\/ 1) \{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00439} 00439 sectorBuffptr = 0;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00440} 00440 sectorSour++;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00441} 00441 \textcolor { keywordflow} { if} (i != datlen -\/ 1)\mbox { \hyperlink { classbsp_ _ _ s_ d_ a96f32b50ec777acc0dd819150cd28937} { SD\_ ReadDisk} } (sectorBuff,sectorSour,1);\} \} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00442} 00442 \textcolor { keywordflow} { return} 0;\} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00444} 00444 \textcolor { comment} { //-\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ -\/ } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00445} 00445 \textcolor { comment} { // 构造函数} }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00446} 00446 \textcolor { comment} { // } }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00447} \mbox { \hyperlink { classbsp_ _ _ s_ d_ a9f5ace0a335acc31271c9d131cd6d306} { 00447} } \mbox { \hyperlink { classbsp_ _ _ s_ d_ a9f5ace0a335acc31271c9d131cd6d306} { bsp\_ SD::bsp\_ SD} } (}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00448} 00448 SPI\_ HandleTypeDef *hspi,}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00449} 00449 GPIO\_ TypeDef *GPIOx\_ CS,}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00450} 00450 uint16\_ t GPIO\_ Pin\_ CS)\{ }
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00451} 00451 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a227c7eb7a28e89d6adfda085a4217992} { bsp\_ SD::hspi} } =\mbox { \hyperlink { classbsp_ _ _ s_ d_ a227c7eb7a28e89d6adfda085a4217992} { hspi} } ;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00452} 00452 \mbox { \hyperlink { classbsp_ _ _ s_ d_ ad7788d2e62152a2fb1a6b307fa902180} { bsp\_ SD::GPIOx\_ CS} } =\mbox { \hyperlink { classbsp_ _ _ s_ d_ ad7788d2e62152a2fb1a6b307fa902180} { GPIOx\_ CS} } ;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00453} 00453 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a4525b5c0f62e39af1c9adb9a9c22239f} { bsp\_ SD::GPIO\_ Pin\_ CS} } =\mbox { \hyperlink { classbsp_ _ _ s_ d_ a4525b5c0f62e39af1c9adb9a9c22239f} { GPIO\_ Pin\_ CS} } ;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00454} 00454 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a6c68fa82294f18968a92719931cff5fa} { bsp\_ SD::DFF} } =0xFF;}
\DoxyCodeLine { \Hypertarget { bsp_ _ _ s_ d_ 8cpp_ source_ l00455} 00455 \mbox { \hyperlink { classbsp_ _ _ s_ d_ a2350601b90ad75bd434094a9c31475c4} { bsp\_ SD::SD\_ TYPE} } =0x00;\} }
\end { DoxyCode}