Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

void  FSDev_SD_Card_BSP_CmdDataWr (FS_QTY               unit_nbr,

...

                                   FS_DEV_SD_CARD_CMD  *p_cmd,

...

                                   void                *p_src,

...

1142683 FS_DEV_SD_CARD_ERR *p_err); Anchor11426971142697  

...

File

...

...

Called from

...

...

Code enabled by

...

fs_dev_sd_card_bsp.c

...

FSDev_SD_Card_WrData()

...

...

N/A

Anchor11426981142698Write data following a command. Anchor11426991142699

Arguments

...

1142700unit_nbr Anchor11427011142701

Unit number of SD/MMC card.

...

1142702p_cmd Anchor11427031142703

Pointer to command that was started.

...

11427041142704p_src Anchor11427051142705

Pointer to source buffer.

...

11427061142706p_err Anchor11427071142707

Pointer to variable that will receive the return error code from this function:

...

classWebWorks_Indent_1

...

FS_DEV_SD_CARD_ERR_NONE

...

classWebWorks_Indent_2

...

No error.

...

classWebWorks_Indent_1

...

...

FS_DEV_SD_CARD_ERR_NO_CARD

...

classWebWorks_Indent_2

...

No card present.

...

classWebWorks_Indent_1

...

...

FS_DEV_SD_CARD_ERR_UNKNOWN

...

classWebWorks_Indent_2

...

Unknown or other error.

...

classWebWorks_Indent_1

...

...

FS_DEV_SD_CARD_ERR_WAIT_TIMEOUT

...

classWebWorks_Indent_2

...

Timeout in waiting for data.

...

classWebWorks_Indent_1

...

...

FS_DEV_SD_CARD_ERR_DATA_UNDERRUN

...

...

Data underrun.

...

classWebWorks_Indent_1

...

FS_DEV_SD_CARD_ERR_DATA_CHKSUM

...

classWebWorks_Indent_2

...

Error in data checksum.

...

classWebWorks_Indent_1

...

FS_DEV_SD_CARD_ERR_DATA_START_BIT

...

...

Data start bit error.

...

classWebWorks_Indent_1

...

FS_DEV_SD_CARD_ERR_DATA

...

classWebWorks_Indent_2

...

Other data error.

...

Returned Value

Anchor11427251142725None. Anchor11427261142726

Notes/Warnings

Anchor11427271142727None. Anchor11427281142728

Example

...

The implementation of FSDev_SD_Card_BSP_CmdDataWr() in Listing C Listing C-10 is targeted for the same host controller as the other listings in this chapter; for more information, see FSDev_SD_Card_BSP_CmdStart(). Anchor11427731142773  

...

...

Listing C-10 FSDev_SD_Card_BSP_CmdDataWr(

...

)

LC-10(1) Wait until data transfer completes or an error occurs. The wait loop (or wait on semaphore) SHOULD always have a timeout to avoid blocking the task in the case of an unforeseen hardware malfunction or a software flaw.

...

LC-10(2) Check if an error occurred. The error status register is decoded to produce the actual error condition. That is not necessary, strictly, but error counters that accumulate within the generic driver based upon returned error values may be useful while debugging a port.

...

LC-10(3) Return no error. The data has been transferred already from the memory buffer using DMA.