我在讲嵌入式Linux驱动开发的时候,发现不少学员对SD卡驱动这块比较感兴趣,课下来找我探讨。而在很多技术论坛,
也有不少人问这方面的问题,所以就想写一下这方面的内容,希望对大家的学习能有所帮助。想了解SD卡的工作原理,首先需要了解的就是SD卡协议了,这个在
网上可以轻松的下载到。在了解协议后,就可以看看下面的一些开发思路了。
首先看下脱离操作系统如何在S3C2410上实现SD卡的读写。过程可以分为3个大的步骤:初始化sd卡、写sd卡、读sd卡;下面的过程是我通过realview-MDK环境测试过的。
一、初始化sd卡

二、写sd卡
写sd卡可以分为3种方式:POLL、中断、DMA
(1)POLL写

(2)中断写

(3)DMA写

三、读sd卡
读sd卡也可分为3中方式:POLL、中断、DMA
(1)POLL读

(2)中断读

(3)DMA读