- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

csl_mmcsd_ataIf.h
Go to the documentation of this file.

    00001 /*  ===========================================================================
    00002  *   Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005, 2008
    00003  *
    00004  *   Use of this software is controlled by the terms and conditions found in
    00005  *   the license agreement under which this software has been supplied.
    00006  *  ===========================================================================
    00007  */
    00008
    00016 /* ============================================================================
    00017  * Revision History
    00018  * ================
    00019  * 20-May-2009 Created
    00020  * 08-Mar-2010 Added get_mod_date and get_mod_time routines  KR030810
    00021  * 21-Mar-2010 Added MMC_readNextWord1 routine               KR032110
    00022  * 11-Apr-2010 Added write sector cache in  MMC_readWriteControl      KR041110
    00023  *             added write sector cache flush to MMC_issueReadCommand KR041110
    00024  * 06-Apr-2010 - Incorporated Frank's comments
    00025  * 26-Apr-2010 - Added support for 'ATA_No_Swap' used by the ATA FS
    00026  * 30-Apr-2010 - Incorporated internal review comments
    00027  * ============================================================================
    00028  */
    00029
    00030 #ifndef CSL_MMCSD_ATAIF_H
    00031 #define CSL_MMCSD_ATAIF_H
    00032
    00033 #include "ata.h"
    00034 #include "csl_types.h"
    00035
    00040 #define CSL_MMCSD_PAGE_SIZE     (512u)
    00041
    00043 #define USE_ATA_NO_SWAP         (TRUE)
    00044
    00056 typedef struct AtaMMCState
    00057 {
    00059     void        *hMmcSd;
    00061     AtaState    *pDrive;
    00063     void        *pMmcSdptr;
    00065     AtaUint16   *pReadBuf;
    00067     Uint16      *pWriteBuf;
    00069     Uint32      currentsectorR;
    00071     Uint32      currentwordR;
    00073     Uint32      currentsectorWr;
    00075     Uint32      currentwordWr;
    00077     void (*mmcsdCallBack)(void);
    00078 } AtaMMCState;
    00079
    00138 AtaError MMC_readWriteControl (AtaSector    phySector,
    00139                                void         *pAtaMediaState,
    00140                                AtaUint16    *pWord,
    00141                                int          byteSwap);
    00142
    00183 AtaError MMC_initState(AtaState *pDrive);
    00184
    00241 AtaError MMC_issueReadCommand (AtaSector    phySector,
    00242                                void         *pAtaMediaState,
    00243                                AtaUint16    sectorCount);
    00244
    00306 AtaError MMC_readNextWord (void         *pAtaMediaState,
    00307                            AtaUint16    *pWord);
    00308
    00371 AtaError MMC_readNextWord1 (void         *pAtaMediaState,  // KR032110
    00372                             AtaUint16    *pWord,
    00373                             AtaUint16    word_delta);
    00374
    00430 AtaError MMC_readNextNWords (void         *pAtaMediaState,
    00431                              AtaUint16    *pData,
    00432                              AtaUint16    words);
    00433
    00492 AtaError MMC_writeSector (AtaSector    phySector,
    00493                           void         *pAtaMediaState,
    00494                           AtaUint16    *pWord,
    00495                           int          byteSwap);
    00496
    00551 AtaError MMC_readNSectors (void         *pAtaMediaState,
    00552                            AtaUint16    *pReadBuf,
    00553                            AtaSector    startSector,
    00554                            AtaUint16    sectorCount);
    00555
    00609 AtaError MMC_writeNSectors (void         *pAtaMediaState,
    00610                             AtaUint16    *pWriteBuf,
    00611                             AtaSector    startSector,
    00612                             AtaUint16    sectorCount);
    00613
    00671 AtaError MMC_read_CID (void            *pAtaMediaState,
    00672                        unsigned int    *pBuf);
    00673
    00731 AtaError MMC_read_CSD (void            *pAtaMediaState,
    00732                        unsigned int    *pBuf);
    00733
    00777 AtaError MMC_writeSectorFlush(void *pAtaMediaState);
    00778
    00823 int MMC_commandReadyStatusCheck(void *pAtaMediaState);
    00824
    00868 AtaError MMC_dataReadyStatusCheck(void *pAtaMediaState);
    00869
    00913 AtaError MMC_busyStatusCheck (void *pAtaMediaState);
    00914
    00962 AtaUint16 MMC_getSerialID (void           *pAtaMediaState,
    00963                            AtaSerialID    *pSerID);
    00964
    01009 AtaUint16 MMC_file_system_format (void *pAtaMediaState);
    01010
    01054 AtaError MMC_reset(void *pAtaMediaState);
    01055
    01097 AtaUint16 MMC_get_time (void);
    01098
    01140 AtaUint16 MMC_get_mod_time (void);
    01141
    01183 AtaUint16 MMC_get_date (void);
    01184
    01226 AtaUint16 MMC_get_mod_date (void);
    01227
    01270 AtaError  MMC_flushFat (void *pAtaMediaState);
    01271
    01311 static AtaError getAtaErrorNo(CSL_Status    result);
    01312
    01316 #endif    /* CSL_MMCSD_ATAIF_H */
    01317