#include "sd_modules.h"
#include "ssd192X.h"
#include "io.h"
#include "diskio.h"
#include "system.h"
#include "trace.h"
#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 |
-----------------------------------------------------------------------/ Initialize Disk Drive / -----------------------------------------------------------------------/
References GetSDCD(), Init_SD(), SD_OK, STA_NODISK, and STA_NOINIT.
Referenced by chk_mounted().
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().
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().
-----------------------------------------------------------------------/ Get Disk Status / -----------------------------------------------------------------------/
References STA_NOINIT.
Referenced by chk_mounted().
DWORD get_fattime | ( | void | ) |
SDCardData* GetSDCD | ( | void | ) |
Referenced by disk_initialize(), disk_ioctl(), disk_read(), and disk_write().
void long_delay | ( | UINT16 | d | ) |
References delay_ns().
Referenced by SD_read(), and SD_write().
TRACE1("Reg 1124-27 @read routine = 0x%x\r\n",SSD_REGRL(0x1124));
References CMD17, cmd_check, data_present, delay_ns(), SDCardData::isSDHC, long_delay(), r1_resp, SD_clear_int_1130(), SD_NOT_READY, SD_OK, SD_reset_inhibit_DAT(), SD_Send_CMD(), SD_set_block_size(), SD_set_transfer_mode(), SD_UNKNOWN_E, SD_wait_cmd_complete(), SD_wait_cmd_complete_val(), SD_wait_cmd_resp_check(), SSD_REGRB, SSD_REGWB, SSD_REGWL, SSD_REGWW, TMR_DMA_EN, TMR_RD_EN, TRACE, TRACE1, and TRACE2.
Referenced by disk_read().
UINT8 SD_read_multiple | ( | SDCardData * | sdcd, | |
UINT32 | LBA_address, | |||
UINT8 * | buf, | |||
UINT8 | rsize, | |||
UINT16 | count | |||
) |
References CMD12, CMD18, cmd_check, data_present, SDCardData::isSDHC, r1_resp, r1b_resp, SD_clear_int_1130(), SD_NOT_READY, SD_OK, SD_READ_DMA_E, SD_reset_inhibit_DAT(), SD_Send_CMD(), SD_set_block_size(), SD_set_transfer_mode(), SD_UNKNOWN_E, SD_wait_cmd_complete(), SSD_REGRB, SSD_REGRL, SSD_REGRW, SSD_REGWB, SSD_REGWL, SSD_REGWW, TMR_AUTOCMD12_EN, TMR_DMA_EN, TMR_MULTI_EN, TMR_RD_EN, TRACE, TRACE1, and TRACE3.
Referenced by disk_read().
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().
void SD_set_block_size | ( | ) |
References SSD_REGWB.
Referenced by SD_read(), SD_read_multiple(), and SD_write().
void SD_set_transfer_mode | ( | UINT8 | mode | ) |
References SSD_REGWB.
Referenced by SD_read(), SD_read_multiple(), and SD_write().
UINT8 SD_write | ( | SDCardData * | sdcd, | |
UINT32 | LBA_address, | |||
const UINT8 * | buf, | |||
UINT8 | count | |||
) |
References CMD24, cmd_check, data_present, delay_ns(), get_cardstatus(), SDCardData::isSDHC, long_delay(), r1_resp, SDCardData::rca, SD_clear_int_1130(), SD_NOT_READY, SD_OK, SD_reset_inhibit_DAT(), SD_Send_CMD(), SD_set_block_size(), SD_set_transfer_mode(), SD_UNKNOWN_E, SD_wait_cmd_complete(), SD_wait_cmd_complete_val(), SD_WRITE_E, SSD_REGRB, SSD_REGWB, SSD_REGWW, TRACE, TRACE1, and TRACE2.
Referenced by disk_write().
const UINT8 g_delayFactor = 4 |
UINT16 ssdBufSize[] = {8,16,32,64,128,256,512} |
Referenced by disk_read().