GadgetSeed  0.9.6
spi_mmc.c ファイル

MMC ドライバ [詳解]

#include "device.h"
#include "device/spi_ioctl.h"
#include "device/sd_ioctl.h"
#include "tkprintf.h"
#include "dkprintf.h"
#include "diskio.h"
#include "timer.h"
spi_mmc.c の依存先関係図:

[ソースコード]

マクロ定義

#define CMD0   (0x40+0) /* GO_IDLE_STATE */
 
#define CMD1   (0x40+1) /* SEND_OP_COND */
 
#define ACMD41   (0xC0+41) /* SEND_OP_COND (SDC) */
 
#define CMD8   (0x40+8) /* SEND_IF_COND */
 
#define CMD9   (0x40+9) /* SEND_CSD */
 
#define CMD10   (0x40+10) /* SEND_CID */
 
#define CMD12   (0x40+12) /* STOP_TRANSMISSION */
 
#define ACMD13   (0xC0+13) /* SD_STATUS (SDC) */
 
#define CMD16   (0x40+16) /* SET_BLOCKLEN */
 
#define CMD17   (0x40+17) /* READ_SINGLE_BLOCK */
 
#define CMD18   (0x40+18) /* READ_MULTIPLE_BLOCK */
 
#define CMD23   (0x40+23) /* SET_BLOCK_COUNT */
 
#define ACMD23   (0xC0+23) /* SET_WR_BLK_ERASE_COUNT (SDC) */
 
#define CMD24   (0x40+24) /* WRITE_BLOCK */
 
#define CMD25   (0x40+25) /* WRITE_MULTIPLE_BLOCK */
 
#define CMD41   (0x40+41) /* SEND_OP_COND (ACMD) */
 
#define CMD55   (0x40+55) /* APP_CMD */
 
#define CMD58   (0x40+58) /* READ_OCR */
 
#define PKT_TOUT   200
 
#define S_SIZ   512
 

関数

static void SELECT (void)
 
static BYTE rcvr_spi (void)
 
static void DESELECT (void)
 
static void xmit_spi (BYTE dat)
 
static BYTE wait_ready (void)
 
static void release_spi (void)
 
static void power_on (void)
 
static void power_off (void)
 
static int rcvr_datablock (BYTE *buff, UINT btr)
 
static int xmit_datablock (const BYTE *buff, BYTE token)
 
static BYTE send_cmd (BYTE cmd, DWORD arg)
 
static DSTATUS mmc_disk_initialize (BYTE drv)
 
static DRESULT mmc_disk_read (BYTE drv, BYTE *buff, DWORD sector, BYTE count)
 
static DRESULT mmc_disk_write (BYTE drv, const BYTE *buff, DWORD sector, BYTE count)
 
static DRESULT mmc_disk_ioctl (BYTE drv, BYTE ctrl, void *buff)
 
static int mmc_register (struct st_device *dev, char *param)
 
static int mmc_unregister (struct st_device *dev)
 
static int mmc_open (struct st_device *dev)
 
static int mmc_close (struct st_device *dev)
 
static int mmc_block_read (struct st_device *dev, void *data, unsigned int sector, unsigned int count)
 
static int mmc_block_write (struct st_device *dev, const void *data, unsigned int sector, unsigned int count)
 
static int mmc_ioctl (struct st_device *dev, unsigned int com, unsigned int arg, void *param)
 
static int mmc_sync (struct st_device *dev)
 
static int mmc_suspend (struct st_device *dev)
 
static int mmc_resume (struct st_device *dev)
 

変数

static struct st_devicemmc_spi
 
static volatile DSTATUS Stat = STA_NOINIT
 
static BYTE CardType
 
const struct st_device mmc_device
 

詳解

MMC ドライバ

SPIドライバ使用

日付
2008.01.02
著者
Takashi SHUDO

spi_mmc.c に定義があります。

変数詳解

◆ mmc_device

const struct st_device mmc_device
初期値:
= {
.name = DEF_DEV_NAME_SD,
.explan = "MMC/SD SPI mode Strage",
.register_dev = mmc_register,
.unregister_dev = mmc_unregister,
.open = mmc_open,
.close = mmc_close,
.block_read = mmc_block_read,
.block_write = mmc_block_write,
.ioctl = mmc_ioctl,
.sync = mmc_sync,
.suspend = mmc_suspend,
.resume = mmc_resume,
}
#define DEF_DEV_NAME_SD
標準ストレージデバイス名(MMC,SD等)
Definition: sd_ioctl.h:15

spi_mmc.c724 行目に定義があります。