SdFat
Classes | Variables
Arduino/libraries/SdFat/Sd2Card.h File Reference

Sd2Card class for V2 SD/SDHC cards. More...

#include <Arduino.h>
#include <SdFatConfig.h>
#include <SdInfo.h>
Include dependency graph for Sd2Card.h:
This graph shows which files directly or indirectly include this file:

Classes

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

Variables

const uint8_t MAX_SCK_RATE_ID = 14
uint8_t const SD_CARD_ERROR_ACMD23 = 0X9
uint8_t const SD_CARD_ERROR_ACMD41 = 0XA
uint8_t const SD_CARD_ERROR_BAD_CSD = 0XB
uint8_t const SD_CARD_ERROR_CMD0 = 0X1
uint8_t const SD_CARD_ERROR_CMD12 = 0X3
uint8_t const SD_CARD_ERROR_CMD17 = 0X4
uint8_t const SD_CARD_ERROR_CMD18 = 0X5
uint8_t const SD_CARD_ERROR_CMD24 = 0X6
uint8_t const SD_CARD_ERROR_CMD25 = 0X7
uint8_t const SD_CARD_ERROR_CMD58 = 0X8
uint8_t const SD_CARD_ERROR_CMD59 = 0X1A
uint8_t const SD_CARD_ERROR_CMD8 = 0X2
uint8_t const SD_CARD_ERROR_ERASE = 0XC
uint8_t const SD_CARD_ERROR_ERASE_SINGLE_BLOCK = 0XD
uint8_t const SD_CARD_ERROR_ERASE_TIMEOUT = 0XE
uint8_t const SD_CARD_ERROR_INIT_NOT_CALLED = 0X19
uint8_t const SD_CARD_ERROR_READ = 0XF
uint8_t const SD_CARD_ERROR_READ_CRC = 0X1B
uint8_t const SD_CARD_ERROR_READ_REG = 0X10
uint8_t const SD_CARD_ERROR_READ_TIMEOUT = 0X11
uint8_t const SD_CARD_ERROR_SCK_RATE = 0X18
uint8_t const SD_CARD_ERROR_SPI_DMA = 0X1C
uint8_t const SD_CARD_ERROR_STOP_TRAN = 0X12
uint8_t const SD_CARD_ERROR_WRITE = 0X13
uint8_t const SD_CARD_ERROR_WRITE_BLOCK_ZERO = 0X14
uint8_t const SD_CARD_ERROR_WRITE_MULTIPLE = 0X15
uint8_t const SD_CARD_ERROR_WRITE_PROGRAMMING = 0X16
uint8_t const SD_CARD_ERROR_WRITE_TIMEOUT = 0X17
uint8_t const SD_CARD_TYPE_SD1 = 1
uint8_t const SD_CARD_TYPE_SD2 = 2
uint8_t const SD_CARD_TYPE_SDHC = 3
uint8_t const SD_CHIP_SELECT_PIN = SS
uint16_t const SD_ERASE_TIMEOUT = 10000
uint16_t const SD_INIT_TIMEOUT = 2000
uint16_t const SD_READ_TIMEOUT = 300
uint16_t const SD_WRITE_TIMEOUT = 600
uint8_t const SPI_DIV3_SPEED = 1
uint8_t const SPI_DIV6_SPEED = 3
uint8_t const SPI_EIGHTH_SPEED = 6
uint8_t const SPI_FULL_SPEED = 0
uint8_t const SPI_HALF_SPEED = 2
uint8_t const SPI_QUARTER_SPEED = 4
uint8_t const SPI_SIXTEENTH_SPEED = 8

Detailed Description

Sd2Card class for V2 SD/SDHC cards.


Variable Documentation

const uint8_t MAX_SCK_RATE_ID = 14

MAX rate test - see spiInit for a given chip for details

uint8_t const SD_CARD_ERROR_ACMD23 = 0X9

SET_WR_BLK_ERASE_COUNT failed

uint8_t const SD_CARD_ERROR_ACMD41 = 0XA

ACMD41 initialization process timeout

uint8_t const SD_CARD_ERROR_BAD_CSD = 0XB

card returned a bad CSR version field

uint8_t const SD_CARD_ERROR_CMD0 = 0X1

timeout error for command CMD0 (initialize card in SPI mode)

uint8_t const SD_CARD_ERROR_CMD12 = 0X3

card returned an error response for CMD12 (write stop)

uint8_t const SD_CARD_ERROR_CMD17 = 0X4

card returned an error response for CMD17 (read block)

uint8_t const SD_CARD_ERROR_CMD18 = 0X5

card returned an error response for CMD18 (read multiple block)

uint8_t const SD_CARD_ERROR_CMD24 = 0X6

card returned an error response for CMD24 (write block)

uint8_t const SD_CARD_ERROR_CMD25 = 0X7

WRITE_MULTIPLE_BLOCKS command failed

uint8_t const SD_CARD_ERROR_CMD58 = 0X8

card returned an error response for CMD58 (read OCR)

uint8_t const SD_CARD_ERROR_CMD59 = 0X1A

card returned an error for CMD59 (CRC_ON_OFF)

uint8_t const SD_CARD_ERROR_CMD8 = 0X2

CMD8 was not accepted - not a valid SD card

uint8_t const SD_CARD_ERROR_ERASE = 0XC

erase block group command failed

uint8_t const SD_CARD_ERROR_ERASE_SINGLE_BLOCK = 0XD

card not capable of single block erase

uint8_t const SD_CARD_ERROR_ERASE_TIMEOUT = 0XE

Erase sequence timed out

uint8_t const SD_CARD_ERROR_INIT_NOT_CALLED = 0X19

init() not called

uint8_t const SD_CARD_ERROR_READ = 0XF

card returned an error token instead of read data

uint8_t const SD_CARD_ERROR_READ_CRC = 0X1B

invalid read CRC

uint8_t const SD_CARD_ERROR_READ_REG = 0X10

read CID or CSD failed

uint8_t const SD_CARD_ERROR_READ_TIMEOUT = 0X11

timeout while waiting for start of read data

uint8_t const SD_CARD_ERROR_SCK_RATE = 0X18

incorrect rate selected

uint8_t const SD_CARD_ERROR_SPI_DMA = 0X1C

SPI DMA error

uint8_t const SD_CARD_ERROR_STOP_TRAN = 0X12

card did not accept STOP_TRAN_TOKEN

uint8_t const SD_CARD_ERROR_WRITE = 0X13

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

uint8_t const SD_CARD_ERROR_WRITE_BLOCK_ZERO = 0X14

attempt to write protected block zero

uint8_t const SD_CARD_ERROR_WRITE_MULTIPLE = 0X15

card did not go ready for a multiple block write

uint8_t const SD_CARD_ERROR_WRITE_PROGRAMMING = 0X16

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

uint8_t const SD_CARD_ERROR_WRITE_TIMEOUT = 0X17

timeout occurred during write programming

uint8_t const SD_CARD_TYPE_SD1 = 1

Standard capacity V1 SD card

uint8_t const SD_CARD_TYPE_SD2 = 2

Standard capacity V2 SD card

uint8_t const SD_CARD_TYPE_SDHC = 3

High Capacity SD card

uint8_t const SD_CHIP_SELECT_PIN = SS

define SOFTWARE_SPI to use bit-bang SPI The default chip select pin for the SD card is SS.

uint16_t const SD_ERASE_TIMEOUT = 10000

erase timeout ms

uint16_t const SD_INIT_TIMEOUT = 2000

init timeout ms

uint16_t const SD_READ_TIMEOUT = 300

read timeout ms

uint16_t const SD_WRITE_TIMEOUT = 600

write time out ms

uint8_t const SPI_DIV3_SPEED = 1

Set SCK rate to F_CPU/3 for Due

uint8_t const SPI_DIV6_SPEED = 3

Set SCK rate to F_CPU/6 for Due

uint8_t const SPI_EIGHTH_SPEED = 6

Set SCK rate to F_CPU/16. See Sd2Card::setSckRate().

uint8_t const SPI_FULL_SPEED = 0

Set SCK to max rate of F_CPU/2. See Sd2Card::setSckRate().

uint8_t const SPI_HALF_SPEED = 2

Set SCK rate to F_CPU/4. See Sd2Card::setSckRate().

uint8_t const SPI_QUARTER_SPEED = 4

Set SCK rate to F_CPU/8. See Sd2Card::setSckRate().

uint8_t const SPI_SIXTEENTH_SPEED = 8

Set SCK rate to F_CPU/32. See Sd2Card::setSckRate().