Prusa3d Marlin fork
Classes | Variables
Sd2Card.h File Reference

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

Go to the source code of this file.

Classes

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

Variables

uint8_t const SPI_FULL_SPEED = 0
 
uint8_t const SPI_HALF_SPEED = 1
 
uint8_t const SPI_QUARTER_SPEED = 2
 
uint8_t const SPI_EIGHTH_SPEED = 3
 
uint8_t const SPI_SIXTEENTH_SPEED = 4
 
uint16_t const SD_INIT_TIMEOUT = 2000
 
uint16_t const SD_ERASE_TIMEOUT = 10000
 
uint16_t const SD_READ_TIMEOUT = 300
 
uint16_t const SD_WRITE_TIMEOUT = 600
 
uint8_t const SD_CARD_ERROR_CMD0 = 0X1
 
uint8_t const SD_CARD_ERROR_CMD8 = 0X2
 
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_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_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_READ = 0XF
 
uint8_t const SD_CARD_ERROR_READ_REG = 0X10
 
uint8_t const SD_CARD_ERROR_READ_TIMEOUT = 0X11
 
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_ERROR_SCK_RATE = 0X18
 
uint8_t const SD_CARD_ERROR_INIT_NOT_CALLED = 0X19
 
uint8_t const SD_CARD_ERROR_CRC = 0X20
 
uint8_t const SD_CARD_ERROR_FF_TIMEOUT = 0X21
 
uint8_t const SD_CARD_ERROR_CMD48 = 0x80
 
uint8_t const SD_CARD_ERROR_CMD49 = 0x81
 
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 SPI_MOSI_PIN = SOFT_SPI_MOSI_PIN
 
uint8_t const SPI_MISO_PIN = SOFT_SPI_MISO_PIN
 
uint8_t const SPI_SCK_PIN = SOFT_SPI_SCK_PIN
 

Variable Documentation

◆ SD_CARD_ERROR_ACMD23

uint8_t const SD_CARD_ERROR_ACMD23 = 0X9

SET_WR_BLK_ERASE_COUNT failed

◆ SD_CARD_ERROR_ACMD41

uint8_t const SD_CARD_ERROR_ACMD41 = 0XA

ACMD41 initialization process timeout

◆ SD_CARD_ERROR_BAD_CSD

uint8_t const SD_CARD_ERROR_BAD_CSD = 0XB

card returned a bad CSR version field

◆ SD_CARD_ERROR_CMD0

uint8_t const SD_CARD_ERROR_CMD0 = 0X1

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

◆ SD_CARD_ERROR_CMD12

uint8_t const SD_CARD_ERROR_CMD12 = 0X3

card returned an error response for CMD12 (write stop)

◆ SD_CARD_ERROR_CMD17

uint8_t const SD_CARD_ERROR_CMD17 = 0X4

card returned an error response for CMD17 (read block)

◆ SD_CARD_ERROR_CMD18

uint8_t const SD_CARD_ERROR_CMD18 = 0X5

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

◆ SD_CARD_ERROR_CMD24

uint8_t const SD_CARD_ERROR_CMD24 = 0X6

card returned an error response for CMD24 (write block)

◆ SD_CARD_ERROR_CMD25

uint8_t const SD_CARD_ERROR_CMD25 = 0X7

WRITE_MULTIPLE_BLOCKS command failed

◆ SD_CARD_ERROR_CMD48

uint8_t const SD_CARD_ERROR_CMD48 = 0x80

Toshiba FlashAir: iSDIO

◆ SD_CARD_ERROR_CMD49

uint8_t const SD_CARD_ERROR_CMD49 = 0x81

Toshiba FlashAir: iSDIO

◆ SD_CARD_ERROR_CMD58

uint8_t const SD_CARD_ERROR_CMD58 = 0X8

card returned an error response for CMD58 (read OCR)

◆ SD_CARD_ERROR_CMD8

uint8_t const SD_CARD_ERROR_CMD8 = 0X2

CMD8 was not accepted - not a valid SD card

◆ SD_CARD_ERROR_CRC

uint8_t const SD_CARD_ERROR_CRC = 0X20

crc check error

◆ SD_CARD_ERROR_ERASE

uint8_t const SD_CARD_ERROR_ERASE = 0XC

erase block group command failed

◆ SD_CARD_ERROR_ERASE_SINGLE_BLOCK

uint8_t const SD_CARD_ERROR_ERASE_SINGLE_BLOCK = 0XD

card not capable of single block erase

◆ SD_CARD_ERROR_ERASE_TIMEOUT

uint8_t const SD_CARD_ERROR_ERASE_TIMEOUT = 0XE

Erase sequence timed out

◆ SD_CARD_ERROR_FF_TIMEOUT

uint8_t const SD_CARD_ERROR_FF_TIMEOUT = 0X21

no response to sent 0xFF

◆ SD_CARD_ERROR_INIT_NOT_CALLED

uint8_t const SD_CARD_ERROR_INIT_NOT_CALLED = 0X19

init() not called

◆ SD_CARD_ERROR_READ

uint8_t const SD_CARD_ERROR_READ = 0XF

card returned an error token instead of read data

◆ SD_CARD_ERROR_READ_REG

uint8_t const SD_CARD_ERROR_READ_REG = 0X10

read CID or CSD failed

◆ SD_CARD_ERROR_READ_TIMEOUT

uint8_t const SD_CARD_ERROR_READ_TIMEOUT = 0X11

timeout while waiting for start of read data

◆ SD_CARD_ERROR_SCK_RATE

uint8_t const SD_CARD_ERROR_SCK_RATE = 0X18

incorrect rate selected

◆ SD_CARD_ERROR_STOP_TRAN

uint8_t const SD_CARD_ERROR_STOP_TRAN = 0X12

card did not accept STOP_TRAN_TOKEN

◆ SD_CARD_ERROR_WRITE

uint8_t const SD_CARD_ERROR_WRITE = 0X13

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

◆ SD_CARD_ERROR_WRITE_BLOCK_ZERO

uint8_t const SD_CARD_ERROR_WRITE_BLOCK_ZERO = 0X14

attempt to write protected block zero

◆ SD_CARD_ERROR_WRITE_MULTIPLE

uint8_t const SD_CARD_ERROR_WRITE_MULTIPLE = 0X15

card did not go ready for a multiple block write

◆ SD_CARD_ERROR_WRITE_PROGRAMMING

uint8_t const SD_CARD_ERROR_WRITE_PROGRAMMING = 0X16

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

◆ SD_CARD_ERROR_WRITE_TIMEOUT

uint8_t const SD_CARD_ERROR_WRITE_TIMEOUT = 0X17

timeout occurred during write programming

◆ SD_CARD_TYPE_SD1

uint8_t const SD_CARD_TYPE_SD1 = 1

Standard capacity V1 SD card

◆ SD_CARD_TYPE_SD2

uint8_t const SD_CARD_TYPE_SD2 = 2

Standard capacity V2 SD card

◆ SD_CARD_TYPE_SDHC

uint8_t const SD_CARD_TYPE_SDHC = 3

High Capacity SD card

◆ SD_ERASE_TIMEOUT

uint16_t const SD_ERASE_TIMEOUT = 10000

erase timeout ms

◆ SD_INIT_TIMEOUT

uint16_t const SD_INIT_TIMEOUT = 2000

init timeout ms

◆ SD_READ_TIMEOUT

uint16_t const SD_READ_TIMEOUT = 300

read timeout ms

◆ SD_WRITE_TIMEOUT

uint16_t const SD_WRITE_TIMEOUT = 600

write time out ms

◆ SPI_EIGHTH_SPEED

uint8_t const SPI_EIGHTH_SPEED = 3

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

◆ SPI_FULL_SPEED

uint8_t const SPI_FULL_SPEED = 0

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

◆ SPI_HALF_SPEED

uint8_t const SPI_HALF_SPEED = 1

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

◆ SPI_MISO_PIN

uint8_t const SPI_MISO_PIN = SOFT_SPI_MISO_PIN

SPI Master In Slave Out pin

◆ SPI_MOSI_PIN

uint8_t const SPI_MOSI_PIN = SOFT_SPI_MOSI_PIN

SPI Master Out Slave In pin

◆ SPI_QUARTER_SPEED

uint8_t const SPI_QUARTER_SPEED = 2

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

◆ SPI_SCK_PIN

uint8_t const SPI_SCK_PIN = SOFT_SPI_SCK_PIN

SPI Clock pin

◆ SPI_SIXTEENTH_SPEED

uint8_t const SPI_SIXTEENTH_SPEED = 4

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