PDK API Guide for J721E
MMCSD Driver

Introduction

Sub Modules

 MMCSD Driver API
 

Data Structures

struct  MMCSD_ConfigParams
 SD Parameters. More...
 
struct  MMCSD_FxnTable
 The definition of a SD function table that contains the required set of functions to control a specific SD driver implementation. More...
 
struct  MMCSD_Config
 SD Global configuration. More...
 
struct  MMCSD_mediaParams
 Parameters of the media attached to the controller. More...
 

Functions

MMCSD_Error MMCSD_close (MMCSD_Handle handle)
 Function to close a SD peripheral specified by the SD handle. More...
 
MMCSD_Error MMCSD_control (MMCSD_Handle handle, uint32_t cmd, void *arg)
 Function performs implementation specific features on a given MMCSD_Handle. More...
 
MMCSD_Error MMCSD_init (void)
 Function to initializes the SD module. More...
 
MMCSD_Error MMCSD_open (uint32_t index, MMCSD_Params params, MMCSD_Handle *handle)
 Function to initialize a given SD peripheral specified by the particular index value. The parameter specifies which mode the SD will operate. More...
 
MMCSD_Error MMCSD_Params_init (MMCSD_Params params)
 Function to initialize the MMCSD_Params struct to its defaults. More...
 
MMCSD_Error MMCSD_write (MMCSD_Handle handle, uint8_t *buf, uint32_t block, uint32_t numBlks)
 Function that handles the SD write for SYS/BIOS. More...
 
MMCSD_Error MMCSD_read (MMCSD_Handle handle, uint8_t *buf, uint32_t block, uint32_t numBlks)
 Function that handles the SD read for SYS/BIOS. More...
 

Variables

const MMCSD_FxnTable MMCSD_fxnTable
 
const MMCSD_Config_list MMCSD_config
 

Typedefs

typedef int32_t MMCSD_Error
 Return status of MMCSD. More...
 
typedef void * MMCSD_Handle
 A handle that is returned from a MMCSD_open() call. More...
 
typedef void * MMCSD_Params
 A handle that is returned from a MMCSD_open() call. More...
 
typedef void(* MMCSD_CardDetectCallbackFxn) (MMCSD_Handle handle, uint32_t temp)
 MMCSD callback function. More...
 
typedef MMCSD_Error(* MMCSD_CloseFxn) (MMCSD_Handle handle)
 A function pointer to a driver specific implementation of MMCSD_close(). More...
 
typedef MMCSD_Error(* MMCSD_ControlFxn) (MMCSD_Handle handle, uint32_t cmd, const void *arg)
 A function pointer to a driver specific implementation of MMCSD_control(). More...
 
typedef MMCSD_Error(* MMCSD_InitFxn) (MMCSD_Handle handle)
 A function pointer to a driver specific implementation of MMCSD_init(). More...
 
typedef MMCSD_Error(* MMCSD_OpenFxn) (MMCSD_Handle handle, MMCSD_Params params)
 A function pointer to a driver specific implementation of MMCSD_open(). More...
 
typedef MMCSD_Error(* MMCSD_WriteFxn) (MMCSD_Handle handle, uint8_t *buf, uint32_t block, uint32_t numBlks)
 A function pointer to a driver specific implementation of MMCSD_write(). More...
 
typedef MMCSD_Error(* MMCSD_ReadFxn) (MMCSD_Handle handle, uint8_t *buf, uint32_t block, uint32_t numBlks)
 A function pointer to a driver specific implementation of MMCSD_read(). More...
 
typedef MMCSD_Config MMCSD_Config_list[MMCSD_MAX_CONFIG_CNT]
 

Macros

#define MMCSD_MAX_CONFIG_CNT   (5U)
 

Macro Definition Documentation

◆ MMCSD_MAX_CONFIG_CNT

#define MMCSD_MAX_CONFIG_CNT   (5U)

Typedef Documentation

◆ MMCSD_Error

typedef int32_t MMCSD_Error

Return status of MMCSD.

◆ MMCSD_Handle

typedef void* MMCSD_Handle

A handle that is returned from a MMCSD_open() call.

◆ MMCSD_Params

typedef void* MMCSD_Params

A handle that is returned from a MMCSD_open() call.

◆ MMCSD_CardDetectCallbackFxn

typedef void(* MMCSD_CardDetectCallbackFxn) (MMCSD_Handle handle, uint32_t temp)

MMCSD callback function.

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

Parameters
MMCSD_HandleMMCSD_Handle
boolResults of the I2C transaction

◆ MMCSD_CloseFxn

typedef MMCSD_Error(* MMCSD_CloseFxn) (MMCSD_Handle handle)

A function pointer to a driver specific implementation of MMCSD_close().

◆ MMCSD_ControlFxn

typedef MMCSD_Error(* MMCSD_ControlFxn) (MMCSD_Handle handle, uint32_t cmd, const void *arg)

A function pointer to a driver specific implementation of MMCSD_control().

◆ MMCSD_InitFxn

typedef MMCSD_Error(* MMCSD_InitFxn) (MMCSD_Handle handle)

A function pointer to a driver specific implementation of MMCSD_init().

◆ MMCSD_OpenFxn

typedef MMCSD_Error(* MMCSD_OpenFxn) (MMCSD_Handle handle, MMCSD_Params params)

A function pointer to a driver specific implementation of MMCSD_open().

◆ MMCSD_WriteFxn

typedef MMCSD_Error(* MMCSD_WriteFxn) (MMCSD_Handle handle, uint8_t *buf, uint32_t block, uint32_t numBlks)

A function pointer to a driver specific implementation of MMCSD_write().

◆ MMCSD_ReadFxn

typedef MMCSD_Error(* MMCSD_ReadFxn) (MMCSD_Handle handle, uint8_t *buf, uint32_t block, uint32_t numBlks)

A function pointer to a driver specific implementation of MMCSD_read().

◆ MMCSD_Config_list

typedef MMCSD_Config MMCSD_Config_list[MMCSD_MAX_CONFIG_CNT]

Function Documentation

◆ MMCSD_close()

MMCSD_Error MMCSD_close ( MMCSD_Handle  handle)

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

Precondition
MMCSD_open() had to be called first.
Parameters
handleA MMCSD_Handle returned from MMCSD_open
See also
MMCSD_open()

◆ MMCSD_control()

MMCSD_Error MMCSD_control ( MMCSD_Handle  handle,
uint32_t  cmd,
void *  arg 
)

Function performs implementation specific features on a given MMCSD_Handle.

Precondition
MMCSD_open() has to be called first.
Parameters
handleA SD handle returned from MMCSD_open()
cmdA command value defined by the driver specific implementation
argAn optional R/W (read/write) argument that is accompanied with cmd
Returns
Implementation specific return codes. Negative values indicate unsuccessful operations.
See also
MMCSD_open()

◆ MMCSD_init()

MMCSD_Error MMCSD_init ( void  )

Function to initializes the SD module.

Precondition
The MMCSD_config structure must exist and be persistent before this function can be called. This function must also be called before any other SD driver APIs. This function call does not modify any peripheral registers.

◆ MMCSD_open()

MMCSD_Error MMCSD_open ( uint32_t  index,
MMCSD_Params  params,
MMCSD_Handle handle 
)

Function to initialize a given SD peripheral specified by the particular index value. The parameter specifies which mode the SD will operate.

Precondition
SD controller has been initialized
Parameters
indexLogical peripheral number for the SD indexed into the MMCSD_config table
paramsPointer to an parameter block, if NULL it will use default values. All the fields in this structure are RO (read-only).
handleA pointer to the MMCSD_Handle
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_Params_init()

MMCSD_Error MMCSD_Params_init ( MMCSD_Params  params)

Function to initialize the MMCSD_Params struct to its defaults.

Parameters
paramsAn pointer to MMCSD_Params structure for initialization

◆ MMCSD_write()

MMCSD_Error MMCSD_write ( MMCSD_Handle  handle,
uint8_t *  buf,
uint32_t  block,
uint32_t  numBlks 
)

Function that handles the SD write for SYS/BIOS.

Parameters
handleA MMCSD_Handle
bufA pointer to buffer
blockStart block to write.
numBlksNumber of blocks to be read.
Returns
true on successful write false on an error, such as a SD bus fault
See also
MMCSD_open

◆ MMCSD_read()

MMCSD_Error MMCSD_read ( MMCSD_Handle  handle,
uint8_t *  buf,
uint32_t  block,
uint32_t  numBlks 
)

Function that handles the SD read for SYS/BIOS.

Parameters
handleA MMCSD_Handle
bufA pointer to buffer
blockStart block to read.
numBlksNumber of blocks to be read.
Returns
true on successful read false on an error, such as a SD bus fault
See also
MMCSD_open

Variable Documentation

◆ MMCSD_fxnTable

const MMCSD_FxnTable MMCSD_fxnTable

◆ MMCSD_config

const MMCSD_Config_list MMCSD_config