sd/sd.c
static int sd_cmd8(spi_ctrl* spi)
{
  // Check for high capacity cards
  // Fail if card does not support SDHC
  int rc;
  rc = (sd_cmd(spi, SD_CMD(SD_CMD_SEND_IF_COND), 0x000001AA, 0x87) != SD_RESPONSE_IDLE);
  sd_dummy(spi); /* command version; reserved */
  sd_dummy(spi); /* reserved */
  rc |= ((sd_dummy(spi) & 0xF) != 0x1); /* voltage */
  rc |= (sd_dummy(spi) != 0xAA); /* check pattern */
  sd_cmd_end(spi);
  return rc;
}
/**
 * Check for SD version and supported voltages.
 */
Check for SD version and supported voltages.
Check for SD version and supported voltages .
static int sd_cmd8(spi_ctrl* spi)
{
  int rc;
  rc = (sd_cmd(spi, SD_CMD(SD_CMD_SEND_IF_COND), 0x000001AA, 0x87) != SD_RESPONSE_IDLE);
  sd_dummy(spi); 
  sd_dummy(spi); 
  rc |= ((sd_dummy(spi) & 0xF) != 0x1); 
  rc |= (sd_dummy(spi) != 0xAA); 
  sd_cmd_end(spi);
  return rc;
}
static int sd_cmd8 ( spi_ctrl * spi ) { int rc ; rc = ( sd_cmd ( spi , SD_CMD ( SD_CMD_SEND_IF_COND ) , 0x000001AA , 0x87 ) != SD_RESPONSE_IDLE ) ; sd_dummy ( spi ) ; sd_dummy ( spi ) ; rc |= ( ( sd_dummy ( spi ) & 0xF ) != 0x1 ) ; rc |= ( sd_dummy ( spi ) != 0xAA ) ; sd_cmd_end ( spi ) ; return rc ; }
Check for SD version and supported voltages.
Check for SD version and supported voltages .
// Check for high capacity cards // Fail if card does not support SDHC /* command version; reserved */ /* reserved */ /* voltage */ /* check pattern */