![]() |
Repetier-Firmware
0.80
|
Raw access to SD and SDHC flash memory cards. More...
#include <SdFat.h>
Public Member Functions | |
| Sd2Card () | |
| uint32_t | cardSize () |
| bool | erase (uint32_t firstBlock, uint32_t lastBlock) |
| bool | eraseSingleBlockEnable () |
| void | error (uint8_t code) |
| int | errorCode () const |
| int | errorData () const |
| bool | init (uint8_t sckRateID=SPI_FULL_SPEED, uint8_t chipSelectPin=SD_CHIP_SELECT_PIN) |
| bool | readBlock (uint32_t block, uint8_t *dst) |
| bool | readCID (cid_t *cid) |
| bool | readCSD (csd_t *csd) |
| bool | readData (uint8_t *dst) |
| bool | readStart (uint32_t blockNumber) |
| bool | readStop () |
| bool | setSckRate (uint8_t sckRateID) |
| int | type () const |
| bool | writeBlock (uint32_t blockNumber, const uint8_t *src) |
| bool | writeData (const uint8_t *src) |
| bool | writeStart (uint32_t blockNumber, uint32_t eraseCount) |
| bool | writeStop () |
Private Member Functions | |
| uint8_t | cardAcmd (uint8_t cmd, uint32_t arg) |
| uint8_t | cardCommand (uint8_t cmd, uint32_t arg) |
| bool | readData (uint8_t *dst, uint16_t count) |
| bool | readRegister (uint8_t cmd, void *buf) |
| void | chipSelectHigh () |
| void | chipSelectLow () |
| void | type (uint8_t value) |
| bool | waitNotBusy (uint16_t timeoutMillis) |
| bool | writeData (uint8_t token, const uint8_t *src) |
Private Attributes | |
| uint8_t | chipSelectPin_ |
| uint8_t | errorCode_ |
| uint8_t | spiRate_ |
| uint8_t | status_ |
| uint8_t | type_ |
Raw access to SD and SDHC flash memory cards.
| uint8_t cardAcmd | ( | uint8_t | cmd, |
| uint32_t | arg | ||
| ) | [inline, private] |
| uint8_t cardCommand | ( | uint8_t | cmd, |
| uint32_t | arg | ||
| ) | [private] |
| uint32_t cardSize | ( | ) |
| void chipSelectHigh | ( | ) | [private] |
| void chipSelectLow | ( | ) | [private] |
| bool erase | ( | uint32_t | firstBlock, |
| uint32_t | lastBlock | ||
| ) |
| bool eraseSingleBlockEnable | ( | ) |
| void error | ( | uint8_t | code | ) | [inline] |
Set SD error code.
| [in] | code | value for error code. |
| int errorCode | ( | ) | const [inline] |
| int errorData | ( | ) | const [inline] |
| bool init | ( | uint8_t | sckRateID = SPI_FULL_SPEED, |
| uint8_t | chipSelectPin = SD_CHIP_SELECT_PIN |
||
| ) |
Initialize an SD flash memory card with default clock rate and chip select pin. See sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin).
| bool readBlock | ( | uint32_t | block, |
| uint8_t * | dst | ||
| ) |
Read a card's CSD register. The CSD contains Card-Specific Data that provides information regarding access to the card's contents.
| [out] | csd | pointer to area for returned data. |
| bool readData | ( | uint8_t * | dst | ) |
| bool readData | ( | uint8_t * | dst, |
| uint16_t | count | ||
| ) | [private] |
| bool readRegister | ( | uint8_t | cmd, |
| void * | buf | ||
| ) | [private] |
| bool readStart | ( | uint32_t | blockNumber | ) |
| bool readStop | ( | ) |
| bool setSckRate | ( | uint8_t | sckRateID | ) |
| int type | ( | ) | const [inline] |
Return the card type: SD V1, SD V2 or SDHC
| void type | ( | uint8_t | value | ) | [inline, private] |
| bool waitNotBusy | ( | uint16_t | timeoutMillis | ) | [private] |
| bool writeBlock | ( | uint32_t | blockNumber, |
| const uint8_t * | src | ||
| ) |
| bool writeData | ( | const uint8_t * | src | ) |
| bool writeData | ( | uint8_t | token, |
| const uint8_t * | src | ||
| ) | [private] |
| bool writeStart | ( | uint32_t | blockNumber, |
| uint32_t | eraseCount | ||
| ) |
| bool writeStop | ( | ) |
uint8_t chipSelectPin_ [private] |
uint8_t errorCode_ [private] |
uint8_t spiRate_ [private] |
uint8_t status_ [private] |
uint8_t type_ [private] |