- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Defines | Typedefs | Functions
csl_mmcsd_ataIf.h File Reference

Functional layer API header file for MMCSD ATA file system interface. More...

`#include "ata.h"`
`#include "csl_types.h"`

Go to the source code of this file.

## Data Structures
struct | AtaMMCState
| Structure to hold the media ATA state values specific to MMCSD. More...
## Defines
#define | CSL_MMCSD_PAGE_SIZE (512u)
#define | USE_ATA_NO_SWAP (TRUE)
## Typedefs
typedef struct AtaMMCState | AtaMMCState
| Structure to hold the media ATA state values specific to MMCSD.
## Functions
AtaError | MMC_readWriteControl (AtaSector phySector, void *pAtaMediaState, AtaUint16 *pWord, int byteSwap)
AtaError | MMC_initState (AtaState *pDrive)
AtaError | MMC_issueReadCommand (AtaSector phySector, void *pAtaMediaState, AtaUint16 sectorCount)
AtaError | MMC_readNextWord (void *pAtaMediaState, AtaUint16 *pWord)
AtaError | MMC_readNextWord1 (void *pAtaMediaState, AtaUint16 *pWord, AtaUint16 word_delta)
AtaError | MMC_readNextNWords (void *pAtaMediaState, AtaUint16 *pData, AtaUint16 words)
AtaError | MMC_writeSector (AtaSector phySector, void *pAtaMediaState, AtaUint16 *pWord, int byteSwap)
AtaError | MMC_readNSectors (void *pAtaMediaState, AtaUint16 *pReadBuf, AtaSector startSector, AtaUint16 sectorCount)
AtaError | MMC_writeNSectors (void *pAtaMediaState, AtaUint16 *pWriteBuf, AtaSector startSector, AtaUint16 sectorCount)
AtaError | MMC_read_CID (void *pAtaMediaState, unsigned int *pBuf)
AtaError | MMC_read_CSD (void *pAtaMediaState, unsigned int *pBuf)
AtaError | MMC_writeSectorFlush (void *pAtaMediaState)
int | MMC_commandReadyStatusCheck (void *pAtaMediaState)
AtaError | MMC_dataReadyStatusCheck (void *pAtaMediaState)
AtaError | MMC_busyStatusCheck (void *pAtaMediaState)
AtaUint16 | MMC_getSerialID (void *pAtaMediaState, AtaSerialID *pSerID)
AtaUint16 | MMC_file_system_format (void *pAtaMediaState)
AtaError | MMC_reset (void *pAtaMediaState)
AtaUint16 | MMC_get_time (void)
AtaUint16 | MMC_get_mod_time (void)
AtaUint16 | MMC_get_date (void)
AtaUint16 | MMC_get_mod_date (void)
AtaError | MMC_flushFat (void *pAtaMediaState)
static AtaError | getAtaErrorNo (CSL_Status result)

## Detailed Description

Functional layer API header file for MMCSD ATA file system interface.

Path: \(CSLPATH)\ inc

## Function Documentation

AtaError MMC_readWriteControl | ( | AtaSector | phySector,
|  | void * | pAtaMediaState,
|  | AtaUint16 * | pWord,
|  | int | last_sector
| ) |  |

===========================================================================
MMC_readWriteControl //KR041110

Description
This function is used to cache and write data to the media. This function can write 1 to 4 sectors each sector containing 512 bytes

Arguments

                phySector         Sector number from which data needs to be read
                pAtaMediaState    ATA media state structure
                pWord             Write data buffer
                last_sector       Flag to flush cache

Return Value AtaError

- ATA_ERROR_NONE - Returned for success
- ATA_ERROR_INVALID_PARAM - Returned for Invalid input parameters
- ATA_ERROR_TIMEOUT - Time out Error Occurred
- ATA_ERROR_UNSUPPORTED - MMC/SD hardware is not supported

Pre Condition
MMC_initState API should be called successfully.

Post Condition
Writes Data to MMC/SD card

Modifies
MMCSD Sector data

Example

     			#define CSL_MMCSD_BUF_SIZE (256u)

    			AtaMMCState    ataMediaState;
    			AtaState       ataState;
    			AtaState       *pAtaState;
    			AtaError       ataErr;
    			AtaSector      phySector;
    			AtaUint16      writeBuf[CSL_MMCSD_BUF_SIZE];

    			pAtaState = &ataState;

    			phySector = 0;
    			ataState->pAtaMediaState = &ataMediaState;

    			ataErr = MMC_initState(&ataState);

                ataErr = pAtaState->AtaWriteSector(phySector,
                                                   ataState->pAtaMediaState,
                                                   writeBuf, FALSE);

===========================================================================

References CSL_MMCSD_PAGE_SIZE, MMC_writeNSectors(), and MMC_writeSector().

Referenced by MMC_initState().