SD_Read callback function not implemented

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guys, I need to find away to know when a read/write to the sdmmc card is finished, however it would appear that the software framework driver is not fully implemented.  Have a look below.

 * Read Blocks of data in a buffer pointed by pData. The buffer size must be at
 * least 512 byte long. This function checks the SD card status register and
 * address the card if required before sending the read command.
 * \return 0 if successful; otherwise returns an \ref sdmmc_rc "error code".
 * \param pSd      Pointer to a SD card driver instance.
 * \param address  Address of the block to read.
 * \param pData    Data buffer whose size is at least the block size. It shall
 * follow the peripheral and DMA alignment requirements.
 * \param length   Number of blocks to be read.
 * \param pCallback Pointer to callback function that invoked when read done.
 *                  0 to start a blocked read.
 * \param pArgs     Pointer to callback function arguments.
SD_Read(sSdCard * pSd,
	uint32_t address,
	void *pData, uint32_t length, fSdmmcCallback pCallback, void *pArgs)
	uint8_t *out = NULL;
	uint32_t remaining, blk_no;
	uint16_t limited;
	uint8_t error = SDMMC_OK;

	assert(pSd != NULL);
	assert(pData != NULL);

	for (blk_no = address, remaining = length, out = (uint8_t *)pData;
	    remaining != 0 && error == SDMMC_OK;
	    blk_no += limited, remaining -= limited,
	    out += (uint32_t)limited * (uint32_t)BLOCK_SIZE(pSd)) {
		limited = (uint16_t)min_u32(remaining, 65535);
		error = MoveToTransferState(pSd, blk_no, &limited, out, 1);
	trace_debug("SDrd(%lu,%lu) %s\n\r", address, length,
	return error;

It would appear the pCallback is not implemented.  I'm going to dig deeper into the framework to see if I can find away of achieving this, any advise would be welcomed.