Jump to main content

##

# 2.105.13 SDHCx_CommandErrorGet Function

## C

    /* x = SDHC instance number (x is applicable only on devices with more than one instances of SDHC) */

    uint16_t SDHCx_CommandErrorGet (void)

## Summary

Returns the errors associated with a command transfer.

## Description

Returns the errors associated with a command transfer. For a command transfer, the returned value is a bit wise OR of the following errors, Command Timeout Error, Command CRC Error, Data CRC Error and Command End Bit Error. Refer the data sheet for the bit position of the errors.

## Precondition

A command must have been initiated using the SDHCx_CommandSend() function.

## Parameters

None.

## Returns

Bit wise OR of the following command error flags - Command Timeout Error, Command CRC Error, Data CRC Error and Command End Bit Error. Refer the data sheet for the bit position of the errors.

## Example

    uint16_t cmd_error = SDHC1_CommandErrorGet();

    if (cmd_error != 0)
    {
        // Handle command error
    }

## Remarks

None.