capi/sdcmd.c File Reference

#include "sd_modules.h"
#include "ssd192X.h"
#include "io.h"
#include "diskio.h"
#include "system.h"
#include "trace.h"
Include dependency graph for sdcmd.c:

Defines

#define STA_NOINIT   0x01
#define STA_NODISK   0x02
#define STA_PROTECT   0x04
#define CTRL_SYNC   0
#define GET_SECTOR_COUNT   1
#define GET_SECTOR_SIZE   2
#define GET_BLOCK_SIZE   3
#define CTRL_POWER   4
#define CTRL_LOCK   5
#define CTRL_EJECT   6
#define MMC_GET_TYPE   10
#define MMC_GET_CSD   11
#define MMC_GET_CID   12
#define MMC_GET_OCR   13
#define MMC_GET_SDSTAT   14
#define ATA_GET_REV   20
#define ATA_GET_MODEL   21
#define ATA_GET_SN   22

Functions

void long_delay (UINT16 d)
void SD_set_transfer_mode (UINT8 mode)
void SD_set_block_size ()
UINT8 SD_reset_inhibit_DAT ()
UINT8 SD_read (SDCardData *sdcd, UINT32 LBA_address, UINT8 *buf, UINT8 count, UINT8 bToSSDMem)
UINT8 SD_read_multiple (SDCardData *sdcd, UINT32 LBA_address, UINT8 *buf, UINT8 rsize, UINT16 count)
UINT8 SD_write (SDCardData *sdcd, UINT32 LBA_address, const UINT8 *buf, UINT8 count)
SDCardDataGetSDCD (void)
DSTATUS disk_initialize (BYTE drv)
DSTATUS disk_status (BYTE drv)
DRESULT disk_read (BYTE drv, BYTE *buff, DWORD sector, WORD count, BYTE bToSSDMem, BYTE bBulk)
DRESULT disk_write (BYTE drv, const BYTE *buff, DWORD sector, BYTE count)
DRESULT disk_ioctl (BYTE drv, BYTE ctrl, void *buff)
DWORD get_fattime (void)

Variables

const UINT8 g_delayFactor = 4
UINT16 ssdBufSize [] = {8,16,32,64,128,256,512}

Define Documentation

#define ATA_GET_MODEL   21
#define ATA_GET_REV   20
#define ATA_GET_SN   22
#define CTRL_EJECT   6
#define CTRL_LOCK   5
#define CTRL_POWER   4
#define CTRL_SYNC   0
#define GET_BLOCK_SIZE   3
#define GET_SECTOR_COUNT   1
#define GET_SECTOR_SIZE   2
#define MMC_GET_CID   12
#define MMC_GET_CSD   11
#define MMC_GET_OCR   13
#define MMC_GET_SDSTAT   14
#define MMC_GET_TYPE   10
#define STA_NODISK   0x02
#define STA_NOINIT   0x01
#define STA_PROTECT   0x04

Function Documentation

DSTATUS disk_initialize ( BYTE  drv  ) 

-----------------------------------------------------------------------/ Initialize Disk Drive / -----------------------------------------------------------------------/

References GetSDCD(), Init_SD(), SD_OK, STA_NODISK, and STA_NOINIT.

Referenced by chk_mounted().

Here is the call graph for this function:

Here is the caller graph for this function:

DRESULT disk_ioctl ( BYTE  drv,
BYTE  ctrl,
void *  buff 
)

Get number of sectors on the disk (DWORD)

References CTRL_SYNC, DWORD, SDCardData::erase_size, GET_BLOCK_SIZE, GET_SECTOR_COUNT, GetSDCD(), RES_ERROR, RES_NOTRDY, RES_OK, RES_PARERR, SDCardData::sector_count, and STA_NOINIT.

Referenced by chk_mounted().

Here is the call graph for this function:

Here is the caller graph for this function:

DRESULT disk_read ( BYTE  drv,
BYTE buff,
DWORD  sector,
WORD  count,
BYTE  bToSSDMem,
BYTE  bBulk 
)

References GetSDCD(), RES_ERROR, RES_NOTRDY, RES_OK, RES_PARERR, SD_read(), SD_read_multiple(), ssdBufSize, STA_NOINIT, TRACE1, TRACE3, and TRACE4.

Referenced by chk_mounted(), f_lseek(), f_read(), f_write(), LoadFileToSSDMem(), and PlayMJPEG().

Here is the call graph for this function:

Here is the caller graph for this function:

DSTATUS disk_status ( BYTE  drv  ) 

-----------------------------------------------------------------------/ Get Disk Status / -----------------------------------------------------------------------/

References STA_NOINIT.

Referenced by chk_mounted().

Here is the caller graph for this function:

DRESULT disk_write ( BYTE  drv,
const BYTE buff,
DWORD  sector,
BYTE  count 
)

References GetSDCD(), RES_ERROR, RES_OK, SD_write(), and TRACE3.

Referenced by f_lseek(), f_read(), f_sync(), and f_write().

Here is the call graph for this function:

Here is the caller graph for this function:

DWORD get_fattime ( void   ) 

Referenced by f_open(), and f_sync().

Here is the caller graph for this function:

SDCardData* GetSDCD ( void   ) 

Referenced by disk_initialize(), disk_ioctl(), disk_read(), and disk_write().

Here is the caller graph for this function:

void long_delay ( UINT16  d  ) 

References delay_ns().

Referenced by SD_read(), and SD_write().

Here is the call graph for this function:

Here is the caller graph for this function:

UINT8 SD_read ( SDCardData sdcd,
UINT32  LBA_address,
UINT8 buf,
UINT8  count,
UINT8  bToSSDMem 
)
UINT8 SD_read_multiple ( SDCardData sdcd,
UINT32  LBA_address,
UINT8 buf,
UINT8  rsize,
UINT16  count 
)
UINT8 SD_reset_inhibit_DAT (  ) 

References SD_DATAline, SD_NOT_READY, SD_OK, SD_reset_quick(), SSD_REGRB, and TRACE.

Referenced by SD_read(), SD_read_multiple(), and SD_write().

Here is the call graph for this function:

Here is the caller graph for this function:

void SD_set_block_size (  ) 

References SSD_REGWB.

Referenced by SD_read(), SD_read_multiple(), and SD_write().

Here is the caller graph for this function:

void SD_set_transfer_mode ( UINT8  mode  ) 

References SSD_REGWB.

Referenced by SD_read(), SD_read_multiple(), and SD_write().

Here is the caller graph for this function:

UINT8 SD_write ( SDCardData sdcd,
UINT32  LBA_address,
const UINT8 buf,
UINT8  count 
)

Variable Documentation

const UINT8 g_delayFactor = 4
UINT16 ssdBufSize[] = {8,16,32,64,128,256,512}

Referenced by disk_read().

Generated on Wed Mar 23 11:08:32 2011 for Omnima LCD by  doxygen 1.6.3