📄 sdcrc.c__.htm
字号:
<html><head><title>SD卡读写模块.rar - sdcrc.c</title></head><body>
<script language="JavaScript">
function openwin(url)
{
window.open(url, 'ProgramSourceCode');
}
</script>
<textarea cols=105 rows=17>文件头:
/****************************************Copyright (c)**************************************************
** Guangzhou ZLG-MCU Development Co.,LTD.
** graduate school
** http://www.zlgmcu.com
**
**--------------File Info-------------------------------------------------------------------------------
** File name: sdtools.c
** Last modified Date: 2005-1-6
** Last Version: V1.0
** Descriptions: sd 卡驱动软件包: SD卡相关工具函数 ---- CRC校验
** Soft Packet of SD Card Driver: tool funcitons about sd card ---- crc check
**
**------------------------------------------------------------------------------------------------------
** Created by: Ming Yuan Zheng
** Created date: 2005-1-6
** Version: V1.0
** Descriptions: The original version
**
**------------------------------------------------------------------------------------------------------
** Modified by:
</textarea><BR>
<table width=756 border=0>
<tr><td width=1 bgcolor=#B0B0B0></td><td>
<script type="text/javascript"><!--
google_ad_client = "pub-8055710228382273";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_text = "333333";
google_color_url = "666666";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
<td width=15 bgcolor=#E4E0D8></td></tr></table>
<textarea cols=105 rows=12>文件尾:
*********************
** 函数名称: INT8U SD_GetCmdByte6() Name: INT8U SD_GetCmdByte6()
** 功能描述: 获取SD卡命令的CRC7 Function: get the CRC7 of the command of SD card
** 输 入: INT8U cmd : 命令 Input: INT8U cmd : command
INT8U *param: 命令的参数,长度为4字节 INT8U *param: the param of command,length is 4 bytes
** 输 出: CRC7码 Output: CRC7 code
********************************************************************************************************************/
INT8U SD_GetCmdByte6(INT8U cmd, INT8U *param)
{
INT8U i, j;
INT8U reg = 0;
INT8U array[5];
array[0] = cmd;
for (i = 1; i < 5; i++) /* 将参数的顺序重新排列 */
array[i] = param[4 - i];
for (i = 0; i < 5; i++) /* 计算5个字节的CRC7 */
{
for (j = 0; j < 8; j++)
{
reg <<= 1;
reg ^= ((((array[i] << j) ^ reg) & 0x80) ? 0x9 : 0);
}
}
return ((reg << 1) + 0x01) ; /* 计算结果的CRC7左移一位,并将最低位置1 */
}
#endif
</textarea><BR>
<a href=http://www.pudn.com><small><font color=#A0A0A0>程序员联合开发网</font></small></a> <a href="/downloads28\sourcecode\embed/detail90300.html"><small><font color=#A0A0A0>返回SD卡读写模块.rar</font></small></a>
<a href="javascript:openwin('/view_src.asp?id=90300&f=SD卡读写模块/SD/sdcrc.c');"><small><font color=#A00000>在线阅读整个文件</font></small></a>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -