AM64x MCU+ SDK  11.00.00

Introduction

The MMCSD header file should be included in an application as follows:

#include <drivers/mmcsd.h>

This module contains APIs to program and use the MMCSD module. The APIs can be used by other drivers to get access to MMCSD and also by application to initiate data transfer operation.

Files

file  mmcsd.h
 MMCSD Driver API/interface file.
 

Data Structures

struct  MMCSD_Params
 MMCSD instance attributes - used during initialization. More...
 
struct  MMCSD_Attrs
 MMCSD instance attributes - used during init time. More...
 
struct  MMCSD_Object
 MMCSD driver object. More...
 
struct  MMCSD_Config
 MMCSD Global configuration. More...
 

Functions

void MMCSD_init (void)
 This function initializes the MMCSD module. More...
 
void MMCSD_deinit (void)
 This function de-initializes the MMCSD module. More...
 
void MMCSD_Params_init (MMCSD_Params *mmcsdParams)
 Initialize data structure with defaults. More...
 
MMCSD_Handle MMCSD_open (uint32_t index, const MMCSD_Params *openParams)
 This function opens a given MMCSD peripheral. More...
 
void MMCSD_close (MMCSD_Handle handle)
 Function to close a MMCSD peripheral specified by the MMCSD handle. More...
 
MMCSD_Handle MMCSD_getHandle (uint32_t index)
 This function returns the handle of an open MMCSD Instance from the instance index. More...
 
int32_t MMCSD_read (MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
 Function to perform block reads from the MMC/SD media. More...
 
int32_t MMCSD_write (MMCSD_Handle handle, uint8_t *buf, uint32_t startBlk, uint32_t numBlks)
 Function to perform block writes to the MMC/SD media. More...
 
uint32_t MMCSD_getBlockSize (MMCSD_Handle handle)
 This function returns the block size of the MMC/SD media connected to the MMCSD controller. More...
 
uint32_t MMCSD_getBlockCount (MMCSD_Handle handle)
 This function returns the block count of User Data Area of the MMC/SD media connected to the MMCSD controller. More...
 
uint32_t MMCSD_isHC (MMCSD_Handle handle)
 This function returns if the media connected is High Capacity (> 2GB in size) or not. More...
 
int32_t MMCSD_change_Bus_Config (MMCSD_Handle handle, uint32_t busSpeed, uint32_t busWidth)
 This function reconfigures the bus Configuration. More...
 
int32_t MMCSD_change_Tuning_Type (MMCSD_Handle handle, uint32_t tuningType)
 This function reconfigures the bus Configuration. More...
 
int32_t MMCSD_enableBootPartition (MMCSD_Handle handle, uint32_t partitionNum)
 This function enables the boot partition if the connected media is eMMC. More...
 
int32_t MMCSD_disableBootPartition (MMCSD_Handle handle)
 This function disables the boot partition if the connected media is eMMC. More...
 

Typedefs

typedef void * MMCSD_Handle
 
typedef void(* MMCSD_txnCallbackFxn) (MMCSD_Handle mmcsdHandle, int32_t transferStatus)
 MMCSD callback function. More...
 

MACROS used to select the transfer mode

MMCSD_MODE_BLOCKING block task execution while a Transfer is in progress MMCSD_MODE_CALLBACK does not block task execution; but calls a callback function when the MMCSD transfer has completed

#define MMCSD_MODE_BLOCKING   ((uint32_t) 0U)
 
#define MMCSD_MODE_CALLBACK   ((uint32_t) 1U)
 

Macro Definition Documentation

◆ MMCSD_MODE_BLOCKING

#define MMCSD_MODE_BLOCKING   ((uint32_t) 0U)

◆ MMCSD_MODE_CALLBACK

#define MMCSD_MODE_CALLBACK   ((uint32_t) 1U)

Typedef Documentation

◆ MMCSD_Handle

typedef void* MMCSD_Handle

◆ MMCSD_txnCallbackFxn

typedef void(* MMCSD_txnCallbackFxn) (MMCSD_Handle mmcsdHandle, int32_t transferStatus)

MMCSD callback function.

User definable callback function prototype. The MMCSD driver will call the defined function and pass in the MMCSD driver's handle, the pointer to the MMCSD transaction that just completed, and the status of Transaction.

Parameters
mmcsdHandleMMCSD_Handle
transferStatusResults of the MMCSD transaction

Function Documentation

◆ MMCSD_init()

void MMCSD_init ( void  )

This function initializes the MMCSD module.

◆ MMCSD_deinit()

void MMCSD_deinit ( void  )

This function de-initializes the MMCSD module.

◆ MMCSD_Params_init()

void MMCSD_Params_init ( MMCSD_Params mmcsdParams)

Initialize data structure with defaults.

Parameters
mmcsdParams[out] Initialized parameters

◆ MMCSD_open()

MMCSD_Handle MMCSD_open ( uint32_t  index,
const MMCSD_Params openParams 
)

This function opens a given MMCSD peripheral.

Precondition
MMCSD controller has been initialized using MMCSD_init()
Parameters
indexIndex of config to use in the MMCSD_Config array
openParamsPointer to parameters to open the driver with
Returns
A MMCSD_Handle on success or a NULL on an error or if it has been opened already
See also
MMCSD_init()
MMCSD_close()

◆ MMCSD_close()

void MMCSD_close ( MMCSD_Handle  handle)

Function to close a MMCSD peripheral specified by the MMCSD handle.

Precondition
MMCSD_open() has to be called first
Parameters
handleMMCSD_Handle returned from MMCSD_open()
See also
MMCSD_open()

◆ MMCSD_getHandle()

MMCSD_Handle MMCSD_getHandle ( uint32_t  index)

This function returns the handle of an open MMCSD Instance from the instance index.

Precondition
MMCSD controller has been opened using MMCSD_open()
Parameters
indexIndex of config to use in the MMCSD_Config array
Returns
An MMCSD_Handle if it has been opened already or NULL otherwise
See also
MMCSD_init()
MMCSD_open()

◆ MMCSD_read()

int32_t MMCSD_read ( MMCSD_Handle  handle,
uint8_t *  buf,
uint32_t  startBlk,
uint32_t  numBlks 
)

Function to perform block reads from the MMC/SD media.

Parameters
handleMMCSD_Handle returned from MMCSD_open()
bufPointer to a buffer to which the data is to be read into
startBlkBlock to start reading data from
numBlksNumber of blocks to read
Returns
SystemP_SUCCESS on successful read; else error on failure
See also
MMCSD_open

◆ MMCSD_write()

int32_t MMCSD_write ( MMCSD_Handle  handle,
uint8_t *  buf,
uint32_t  startBlk,
uint32_t  numBlks 
)

Function to perform block writes to the MMC/SD media.

Parameters
handleMMCSD_Handle returned from MMCSD_open()
bufPointer to a buffer to which the data is to be read into
startBlkBlock to start reading data from
numBlksNumber of blocks to read
Returns
SystemP_SUCCESS on successful read; else error on failure
See also
MMCSD_open

◆ MMCSD_getBlockSize()

uint32_t MMCSD_getBlockSize ( MMCSD_Handle  handle)

This function returns the block size of the MMC/SD media connected to the MMCSD controller.

Precondition
MMCSD controller has been opened using MMCSD_open()
Parameters
handleMMCSD_Handle returned from MMCSD_open()
Returns
Block size of the media
See also
MMCSD_init()
MMCSD_open()

◆ MMCSD_getBlockCount()

uint32_t MMCSD_getBlockCount ( MMCSD_Handle  handle)

This function returns the block count of User Data Area of the MMC/SD media connected to the MMCSD controller.

Precondition
MMCSD controller has been opened using MMCSD_open()
Parameters
handleMMCSD_Handle returned from MMCSD_open()
Returns
Block size of the media
See also
MMCSD_init()
MMCSD_open()

◆ MMCSD_isHC()

uint32_t MMCSD_isHC ( MMCSD_Handle  handle)

This function returns if the media connected is High Capacity (> 2GB in size) or not.

Precondition
MMCSD controller has been opened using MMCSD_open()
Parameters
handleMMCSD_Handle returned from MMCSD_open()
Returns
Block size of the media
See also
MMCSD_init()
MMCSD_open()

◆ MMCSD_change_Bus_Config()

int32_t MMCSD_change_Bus_Config ( MMCSD_Handle  handle,
uint32_t  busSpeed,
uint32_t  busWidth 
)

This function reconfigures the bus Configuration.

Precondition
MMCSD controller has been opened using MMCSD_open()
Parameters
handleMMCSD_Handle returned from MMCSD_open()
busSpeedBus Speed to be Set.
busWidthBus Width to be Set.
Returns
SystemP_SUCCESS on successful read; else error on failure

◆ MMCSD_change_Tuning_Type()

int32_t MMCSD_change_Tuning_Type ( MMCSD_Handle  handle,
uint32_t  tuningType 
)

This function reconfigures the bus Configuration.

Precondition
MMCSD controller has been opened using MMCSD_open()
Parameters
handleMMCSD_Handle returned from MMCSD_open()
tuningTypeTuning Type to be Set.
Returns
SystemP_SUCCESS on successful read; else error on failure

◆ MMCSD_enableBootPartition()

int32_t MMCSD_enableBootPartition ( MMCSD_Handle  handle,
uint32_t  partitionNum 
)

This function enables the boot partition if the connected media is eMMC.

Precondition
MMCSD controller has been opened using MMCSD_open()
Parameters
handleMMCSD_Handle returned from MMCSD_open()
partitionNumBoot partition to be enabled.
Returns
SystemP_SUCCESS on successful read; else error on failure
See also
MMCSD_init()
MMCSD_open()

◆ MMCSD_disableBootPartition()

int32_t MMCSD_disableBootPartition ( MMCSD_Handle  handle)

This function disables the boot partition if the connected media is eMMC.

Precondition
MMCSD controller has been opened using MMCSD_open()
Parameters
handleMMCSD_Handle returned from MMCSD_open()
Returns
SystemP_SUCCESS on successful read; else error on failure
See also
MMCSD_init()
MMCSD_open()

Variable Documentation

◆ gMmcsdConfig

MMCSD_Config gMmcsdConfig[]
extern

Externally defined driver configuration array.

◆ gMmcsdConfigNum

uint32_t gMmcsdConfigNum
extern

Externally defined driver configuration array size.