Sd2Card.h File Reference

#include "ArduinoPins.h"
#include "SdInfo.h"
Include dependency graph for Sd2Card.h:
This graph shows which files directly or indirectly include this file:

subjects

class   Sd2Card
  Raw access to SD and SDHC flash memory cards. More...

Defines

#define  SPI_SS_PIN   SS_PIN
#define  SPI_MOSI_PIN   MOSI_PIN
#define  SPI_MISO_PIN   MISO_PIN
#define  SPI_SCK_PIN   SCK_PIN
#define  OPTIMIZE_HARDWARE_SPI
#define  SD_PROTECT_BLOCK_ZERO   1
#define  SD_ERASE_TIMEOUT   10000
#define  SD_READ_TIMEOUT   300
#define  SD_WRITE_TIMEOUT   600
#define  SD_CARD_ERROR_CMD0   0X1
#define  SD_CARD_ERROR_CMD8   0X2
#define  SD_CARD_ERROR_CMD17   0X3
#define  SD_CARD_ERROR_CMD24   0X4
#define  SD_CARD_ERROR_CMD58   0X5
#define  SD_CARD_ERROR_ACMD41   0X6
#define  SD_CARD_ERROR_BAD_CSD   0X7
#define  SD_CARD_ERROR_READ_REG   0X8
#define  SD_CARD_ERROR_WRITE_TIMEOUT   0X9
#define  SD_CARD_ERROR_WRITE_BLOCK_ZERO   0XA
#define  SD_CARD_ERROR_ERASE_SINGLE_BLOCK   0XB
#define  SD_CARD_ERROR_ERASE   0XC
#define  SD_CARD_ERROR_READ_TIMEOUT   0XD
#define  SD_CARD_ERROR_ACMD23   0XE
#define  SD_CARD_ERROR_ERASE_TIMEOUT   0XF
#define  SD_CARD_ERROR_CMD25   0X10
#define  SD_CARD_ERROR_READ   0X11
#define  SD_CARD_ERROR_WRITE   0X12
#define  SD_CARD_ERROR_WRITE_PROGRAMMING   0X13
#define  SD_CARD_TYPE_SD1   1
#define  SD_CARD_TYPE_SD2   2
#define  SD_CARD_TYPE_SDHC   3

Detailed Description

Sd2Card class


Define Documentation

#define OPTIMIZE_HARDWARE_SPI

optimize loops for hardware SPI

#define SD_CARD_ERROR_ACMD23   0XE

SET_WR_BLK_ERASE_COUNT failed

#define SD_CARD_ERROR_ACMD41   0X6

card's ACMD41 initialization process timeout

#define SD_CARD_ERROR_BAD_CSD   0X7

card returned a bad CSR version field

#define SD_CARD_ERROR_CMD0   0X1

timeout error for command CMD0

#define SD_CARD_ERROR_CMD17   0X3

card returned an error response for CMD17 (read block)

#define SD_CARD_ERROR_CMD24   0X4

card returned an error response for CMD24 (write block)

#define SD_CARD_ERROR_CMD25   0X10

WRITE_MULTIPLE_BLOCKS command failed

#define SD_CARD_ERROR_CMD58   0X5

card returned an error response for CMD58 (read OCR)

#define SD_CARD_ERROR_CMD8   0X2

CMD8 was not accepted - not a valid SD card

#define SD_CARD_ERROR_ERASE   0XC

erase block group command failed

#define SD_CARD_ERROR_ERASE_SINGLE_BLOCK   0XB

card not capable of single block erase

#define SD_CARD_ERROR_ERASE_TIMEOUT   0XF

Erase sequence timed out

#define SD_CARD_ERROR_READ   0X11

card returned an error token instead of read data

#define SD_CARD_ERROR_READ_REG   0X8

read CID or CSD failed

#define SD_CARD_ERROR_READ_TIMEOUT   0XD

timeout while waiting for start of read data

#define SD_CARD_ERROR_WRITE   0X12

card returned an error token as a response to a write operation

#define SD_CARD_ERROR_WRITE_BLOCK_ZERO   0XA

attempt to write protected block zero

#define SD_CARD_ERROR_WRITE_PROGRAMMING   0X13

card returned an error to a CMD13 status check after a write

#define SD_CARD_ERROR_WRITE_TIMEOUT   0X9

timeout occurred during write programming

#define SD_CARD_TYPE_SD1   1

Standard capacity V1 SD card

#define SD_CARD_TYPE_SD2   2

Standard capacity V2 SD card

#define SD_CARD_TYPE_SDHC   3

High Capacity SD card

#define SD_ERASE_TIMEOUT   10000

erase timeout ms

#define SD_PROTECT_BLOCK_ZERO   1

Protect block zero from write if nonzero

#define SD_READ_TIMEOUT   300

read timeout ms

#define SD_WRITE_TIMEOUT   600

write time out ms

#define SPI_MISO_PIN   MISO_PIN

SPI Master In Slave Out pin

#define SPI_MOSI_PIN   MOSI_PIN

SPI Master Out Slave In pin

#define SPI_SCK_PIN   SCK_PIN

SPI Clock pin

#define SPI_SS_PIN   SS_PIN

Define MEGA_SOFT_SPI to use software SPI on Mega Arduinos. Pins used are SS 10, MOSI 11, MISO 12, and SCK 13.

MEGA_SOFT_SPI allows an unmodified Adafruit GPS Shield to be used on Mega Arduinos. Software SPI works well with GPS Shield V1.1 but many SD cards will fail with GPS Shield V1.0. SPI Slave Select pin


Generated on Wed Dec 23 08:22:21 2009 for SdFat by  doxygen 1.6.1