Altera HWLIB  16.0
The Altera HW Manager API Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
General Purpose Block I/O

Description

The functions in this group provide general purpose block read and write flash functions.

Functions

ALT_STATUS_CODE alt_sdmmc_read (ALT_SDMMC_CARD_INFO_t *card_info, void *dest, void *src, const size_t size)
 
ALT_STATUS_CODE alt_sdmmc_write (ALT_SDMMC_CARD_INFO_t *card_info, void *dest, void *src, const size_t size)
 

Function Documentation

ALT_STATUS_CODE alt_sdmmc_read ( ALT_SDMMC_CARD_INFO_t card_info,
void *  dest,
void *  src,
const size_t  size 
)

Reads a block of data from the SD/MMC flash card.

Reads a block of size data bytes from the SD/MMC flash src address into the user supplied dest buffer.

Parameters
card_infoA pointer to a ALT_SDMMC_CARD_INFO_t structure that holds identification and device property information for any detected card.
destThe address of a caller supplied destination buffer in system memory large enough to contain the requested block of flash data.
srcThe flash memory address to begin reading data from.
sizeThe requested number of data bytes to read from the flash device.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_STATUS_CODE alt_sdmmc_write ( ALT_SDMMC_CARD_INFO_t card_info,
void *  dest,
void *  src,
const size_t  size 
)

Write a block of data to the SD/MMC flash card.

Writes a block of size data bytes to the SD/MMC flash dest address from the designated src buffer. The actual number of bytes written to the flash card is size bytes rounded up to the next whole multiple flash card block size. That is: actual_bytes_written = ((size / flash_block_size) + 1) * flash_block_size

Parameters
card_infoA pointer to a ALT_SDMMC_CARD_INFO_t structure that holds identification and device property information for any detected card.
destThe destination flash memory address to begin writing data to.
srcThe source address in system memory to begin writing data from.
sizeThe requested number of data bytes to write to the flash device.
Return values
ALT_E_SUCCESSIndicates successful completion.
ALT_E_ERRORIndicates an error occurred.