📄 sdmmc.h
字号:
/* #endif */
#if (USE_MULTI)
/*******************************************************************************
* Name: mmcReadMultiple - Reads multiple card sectors
*
* Input:
* PDEVICE_CONTROLLER pc
* UINT16 RCA Card address
* ULONG dataAddress Sector address
*
* Output:
* sector data
*
* Returns:
* Completion code
*
******************************************************************************/
MMC_CC mmcReadMultiple( PDEVICE_CONTROLLER pc, ULONG dataAddress, UINT16 RCA, UINT16 noBlocks );
/*******************************************************************************
* mmcWriteMultiple - Writes multiple card sector
*
* Input:
* PDEVICE_CONTROLLER pc
* UINT16 RCA Card address
* ULONG dataAddress Sector address
*
* Output:
* None.
*
* Returns: completion code
*
*****************************************************************************/
MMC_CC mmcWriteMultiple( PDEVICE_CONTROLLER pc, ULONG dataAddress, UINT16 RCA, UINT16 noBlocks );
#endif
/*****************************************************************************
* mmcGetWPMap - If state of the card has write protect
* this function asks the card to send the
* status of the write protection bits
*
* input: dataAddress - Sector address
* RCA - card address
*
* output: bufPtr - read data
*
* returns: completion code
*
******************************************************************************/
MMC_CC mmcGetWPMap( PDEVICE_CONTROLLER pc, ULONG dataAddress, UINT16 RCA );
/*******************************************************************************
* mmcSetGroupWP - Sets the write protection bit of the addressed group
*
* input: dataAddress -Sector address
*
* output: None.
*
* returns: completion code
*
******************************************************************************/
MMC_CC mmcSetGroupWP( PDEVICE_CONTROLLER pc, ULONG dataAddress, UINT16 RCA );
/*****************************************************************************
* mmcClearGroupWP - Clear the write protection bit of the addressed group
*
* input: groupAddress - Write protect address group
*
* output: None.
*
* returns: completion code
*
******************************************************************************/
MMC_CC mmcClearGroupWP( PDEVICE_CONTROLLER pc, ULONG groupAddress, UINT16 RCA );
/*****************************************************************************
* mmcEraseSectors - Erase selected Sector one card
*
* input: Sectors address (start ,end ,untage )
*
* output: None.
*
* returns: completion code
*
******************************************************************************/
MMC_CC mmcEraseSectors( PDEVICE_CONTROLLER pc, UINT16 RCA, ULONG start, ULONG end, ULONG untag );
/*****************************************************************************
* mmcEraseGroup - Erase selected group one card
*
* input: Group address (start ,end ,untage )
*
* output: None.
*
* returns: completion code
*
******************************************************************************/
MMC_CC mmcEraseGroup( PDEVICE_CONTROLLER pc, UINT16 RCA, ULONG start, ULONG end, ULONG untag );
/*******************************************************************************
* mmcGetStatus - Retrieves the card current status.
*
* input:
* PDEVICE_CONTROLLER pc
* UINT16 RCA
*
* output:
* None.
*
* returns:
* Completion code
*
******************************************************************************/
MMC_CC mmcGetStatus( PDEVICE_CONTROLLER pc, UINT16 RCA);
#if ( USE_SPI || USE_SPI_EMULATION )
#if (USE_SET_FEATURES)
/*******************************************************************************
*
* mmcTurnCRCOnOff - Turns the CRC option ON or OFF.
*
* input: 1 - turns the option ON
* 0 - turns the option OFF.
*
* output: None.
*
* returns: completion code
*
*****************************************************************************/
MMC_CC mmcTurnCRCOnOff( PDEVICE_CONTROLLER pc, UINT16 RCA, UINT16 opt );
#endif /* (USE_SET_FEATURES) */
#endif /* (USE_SPI || USE_SPI_EMULATION) */
/*********************************************************************************
* Name: mmedia_io
*
* Description:
*
*
* Input:
* INT16 driveno
* ULONG sector
* UCHAR *buffer
* UCOUNT scount
* INT16 op
*
* Output:
*
* Return:
* Completion code
*
****************************************************************************************/
MMC_CC mmedia_io( INT16 driveno, ULONG sector, UCHAR *buffer, UCOUNT scount, INT16 op );
/****************************************************************************************
* Name: mmedia_drive_open
*
* Description:
* Initialize the drive, configure the drive's data structure
*
* Input:
* INT16 driveno
*
* Output:
* None
*
* Return:
* YES if successful
* NO if failure
*
*****************************************************************************************/
SDBOOL mmedia_drive_open ( INT16 driveno );
/****************************************************************************************
* Name: mmedia_drive_close
*
* Description:
* Remove drive's data structure and restore old system configuration.
*
* Input:
* INT16 driveno
*
* Output:
* None
*
* Return:
* YES if successful
* NO if failure
*
*****************************************************************************************/
SDBOOL mmedia_drive_close ( INT16 driveno );
/***************************************************************************************
* Name: mmedia_read_serial
*
* Description:
* This routine does the following operations:
* . calls identify drive to get serial no
* . copies the string into the output string and null terminate
*
* Inputs:
* driveno - drive number
* pserialno - pointer to a buffer to hold the model number (at least 21 bytes)
*
* Returns:
* YES on success else NO.
* If NO pc->error_no will contain the error.
*
****************************************************************************************/
SDBOOL mmedia_read_serial(INT16 driveno, PDRV_GEOMETRY_DESC idDrvPtr);
#if (USE_SD)
#if (USE_SECURITY)
SDIMPORT MMC_CC mmcSecureRead(ULONG startingSector, UCHAR *buff, UINT16 numSectors, INT16 drvNo);
SDIMPORT MMC_CC mmcSecureWrite(ULONG startingSector, UCHAR *buff, UINT16 numSectors, INT16 drvNo);
SDIMPORT MMC_CC mmcSecureErase(ULONG startingSector, UINT16 numSectors, INT16 drvNo);
SDIMPORT SDVOID setupMMcHostSecurity(UINT16 cmdIndex, UINT16 *cmdDatContReg, UINT16 *noBlocks, UINT16 *blkLength);
#define SETUPSPECIALCOMMANDS(cmdIndex, cmdDatContReg, noBlocks, blkLength) (\
setupMMcHostSecurity(cmdIndex, cmdDatContReg, noBlocks, blkLength))
SDIMPORT SDBOOL whereIsTheRequest(INT16 driveno);
#define FINDSOURCEOFREQUEST(driveno) (whereIsTheRequest(driveno))
#else
#define SETUPSPECIALCOMMANDS(cmdIndex, cmdDatContReg, noBlocks, blkLength)
#define FINDSOURCEOFREQUEST(driveno) NO
#endif /* USE_SECURITY */
#endif /* USE_SD */
/********************************* FOR SPI INTERFACE ************************************/
#if (USE_SPI || USE_SPI_EMULATION)
/*****************************************************************************
* spiCardInit - Initialize spi devices.
*
* input: None.
*
* output: None.
*
* returns: None
*
******************************************************************************/
SDVOID spiCardInit ( INT16 ctrlno );
/*****************************************************************************
* selectChip - Activates CS signal.
*
* input:
* UINT16 driveno Device Number
*
* output:
* None.
*
* Returns:
* Completion code
*
******************************************************************************/
#define selectChip(driveno) (spi_cs_enable(driveno))
/******************************************************************************
* deSelectChip - deactivates CS signal.
*
* Input:
* UINT16 driveno Device Number
*
* Output:
* None.
*
* Returns:
* Completion code
*
******************************************************************************/
#define deSelectChip(driveno) (spi_cs_disable(driveno))
#endif /* (USE_SPI || USE_SPI_EMULATION) */
/********************************* FOR MMC INTERFACE ************************************/
#if (USE_MMC || USE_MMC_EMULATION)
/*****************************************************************************
*
* mmcCardInit - Initialize the mmc cards.
*
* input: None.
*
* output: None.
*
* returns: None
*
******************************************************************************/
SDBOOL mmcBusStart(INT16 ctrlNo); /* Initialize the cards with 80 clocks */
SDBOOL mmc_init_setup( SDVOID );
MMC_CC mmcConfigDevice( INT16 driveno );
#endif /* (USE_MMC || USE_MMC_EMULATION) */
#endif /* (USE_SD || USE_SPI || USE_SPI_EMULATION || USE_MMC || USE_MMC_EMULATION) */
#ifdef __cplusplus
}
#endif
#define _SDMMC_H_
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -