Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
a5119d69
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a5119d69
编写于
8月 27, 2014
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[BSP] Add RT_DEVICE_CTRL_BLK_GETGEOME command handling in device control of LPC176x bsp
上级
7f45ac18
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
450 addition
and
378 deletion
+450
-378
bsp/lpc176x/drivers/sd.c
bsp/lpc176x/drivers/sd.c
+417
-346
bsp/lpc176x/drivers/sd.h
bsp/lpc176x/drivers/sd.h
+33
-32
未找到文件。
bsp/lpc176x/drivers/sd.c
浏览文件 @
a5119d69
此差异已折叠。
点击以展开。
bsp/lpc176x/drivers/sd.h
浏览文件 @
a5119d69
...
...
@@ -4,42 +4,43 @@
#include <stdint.h>
/* SD/MMC Commands */
#define GO_IDLE_STATE
(0x40 + 0)
// CMD0
#define SEND_OP_COND
(0x40 + 1)
#define CMD8
(0x40 + 8)
// CMD8
#define SEND_CSD
(0x40 + 9)
#define SEND_CID
(0x40 + 10)
// CMD10
#define STOP_TRAN
(0x40 + 12)
// CMD12
#define SET_BLOCKLEN
(0x40 + 16)
// CMD16
#define READ_BLOCK
(0x40 + 17)
#define READ_MULT_BLOCK
(0x40 + 18)
#define WRITE_BLOCK
(0x40 + 24)
#define WRITE_MULT_BLOCK
(0x40 + 25)
#define APP_CMD
(0x40 + 55)
// CMD55
#define READ_OCR
(0x40 + 58)
// CMD58
#define CRC_ON_OFF
(0x40 + 59)
#define SD_SEND_OP_COND
(0xC0 + 41)
// ACMD41
#define SD_STATUS
(0xC0 + 13)
// ACMD13, SD_STATUS (SDC)
#define SET_WR_BLK_ERASE_COUNT
(0xC0 + 23)
// ACMD23 (SDC)
#define GO_IDLE_STATE
(0x40 + 0)
// CMD0
#define SEND_OP_COND
(0x40 + 1)
#define CMD8
(0x40 + 8)
// CMD8
#define SEND_CSD
(0x40 + 9)
#define SEND_CID
(0x40 + 10)
// CMD10
#define STOP_TRAN
(0x40 + 12)
// CMD12
#define SET_BLOCKLEN
(0x40 + 16)
// CMD16
#define READ_BLOCK
(0x40 + 17)
#define READ_MULT_BLOCK
(0x40 + 18)
#define WRITE_BLOCK
(0x40 + 24)
#define WRITE_MULT_BLOCK
(0x40 + 25)
#define APP_CMD
(0x40 + 55)
// CMD55
#define READ_OCR
(0x40 + 58)
// CMD58
#define CRC_ON_OFF
(0x40 + 59)
#define SD_SEND_OP_COND
(0xC0 + 41)
// ACMD41
#define SD_STATUS
(0xC0 + 13)
// ACMD13, SD_STATUS (SDC)
#define SET_WR_BLK_ERASE_COUNT
(0xC0 + 23)
// ACMD23 (SDC)
/* Card type flags (CardType) */
#define CT_NONE
0x00
#define CT_MMC
0x01
#define CT_SD1
0x02
#define CT_SD2
0x04
#define CT_SDC
(CT_SD1|CT_SD2)
#define CT_BLOCK
0x08
#define CT_NONE
0x00
#define CT_MMC
0x01
#define CT_SD1
0x02
#define CT_SD2
0x04
#define CT_SDC
(CT_SD1|CT_SD2)
#define CT_BLOCK
0x08
/* MMC device configuration */
typedef
struct
tagSDCFG
{
uint32_t
sernum
;
// serial number
uint32_t
size
;
// size=sectorsize*sectorcnt
uint32_t
sectorcnt
;
//
uint32_t
sectorsize
;
// 512
uint32_t
blocksize
;
// erase block size
uint8_t
ocr
[
4
];
// OCR
uint8_t
cid
[
16
];
// CID
uint8_t
csd
[
16
];
// CSD
typedef
struct
tagSDCFG
{
uint32_t
sernum
;
// serial number
uint32_t
size
;
// size=sectorsize*sectorcnt
uint32_t
sectorcnt
;
//
uint32_t
sectorsize
;
// 512
uint32_t
blocksize
;
// erase block size
uint8_t
ocr
[
4
];
// OCR
uint8_t
cid
[
16
];
// CID
uint8_t
csd
[
16
];
// CSD
}
SDCFG
;
void
rt_hw_sdcard_init
(
void
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录