Raw SDIO access to SD and SDHC flash memory cards.
More...
#include <SdioCard.h>
Raw SDIO access to SD and SDHC flash memory cards.
Initialize the SD card.
- Parameters
-
[in] | sdioConfig | SDIO card configuration. |
- Returns
- true for success else false.
Disable an SDIO card.
- Returns
- false - not implemented.
bool SdioCard::erase |
( |
uint32_t |
firstSector, |
|
|
uint32_t |
lastSector |
|
) |
| |
|
virtual |
Erase a range of sectors.
- Parameters
-
[in] | firstSector | The address of the first sector in the range. |
[in] | lastSector | The address of the last sector in the range. |
- Note
- This function requests the SD card to do a flash erase for a range of sectors. The data on the card after an erase operation is either 0 or 1, depends on the card vendor. The card must support single sector erase.
- Returns
- The value true is returned for success and the value false is returned for failure.
Implements SdCardInterface.
uint8_t SdioCard::errorCode |
( |
| ) |
const |
|
virtual |
- Returns
- code for the last error. See SdCardInfo.h for a list of error codes.
Implements SdCardInterface.
uint32_t SdioCard::errorData |
( |
| ) |
const |
|
virtual |
uint32_t SdioCard::errorLine |
( |
| ) |
const |
- Returns
- error line for last error. Tmp function for debug.
bool SdioCard::isBusy |
( |
| ) |
|
|
virtual |
Check for busy with CMD13.
- Returns
- true if busy else false.
Implements SdCardInterface.
uint32_t SdioCard::kHzSdClk |
( |
| ) |
|
- Returns
- the SD clock frequency in kHz.
bool SdioCard::readCID |
( |
cid_t * |
cid | ) |
|
|
virtual |
Read a card's CID register. The CID contains card identification information such as Manufacturer ID, Product name, Product serial number and Manufacturing date.
- Parameters
-
[out] | cid | pointer to area for returned data. |
- Returns
- true for success or false for failure.
Implements SdCardInterface.
bool SdioCard::readCSD |
( |
csd_t * |
csd | ) |
|
|
virtual |
Read a card's CSD register. The CSD contains Card-Specific Data that provides information regarding access to the card's contents.
- Parameters
-
[out] | csd | pointer to area for returned data. |
- Returns
- true for success or false for failure.
Implements SdCardInterface.
bool SdioCard::readData |
( |
uint8_t * |
dst | ) |
|
Read one data sector in a multiple sector read sequence
- Parameters
-
[out] | dst | Pointer to the location for the data to be read. |
- Returns
- The value true is returned for success and the value false is returned for failure.
bool SdioCard::readOCR |
( |
uint32_t * |
ocr | ) |
|
|
virtual |
Read OCR register.
- Parameters
-
[out] | ocr | Value of OCR register. |
- Returns
- true for success else false.
Implements SdCardInterface.
bool SdioCard::readSector |
( |
uint32_t |
sector, |
|
|
uint8_t * |
dst |
|
) |
| |
|
virtual |
Read a 512 byte sector from an SD card.
- Parameters
-
[in] | sector | Logical sector to be read. |
[out] | dst | Pointer to the location that will receive the data. |
- Returns
- The value true is returned for success and the value false is returned for failure.
Implements BlockDeviceInterface.
bool SdioCard::readSectors |
( |
uint32_t |
sector, |
|
|
uint8_t * |
dst, |
|
|
size_t |
ns |
|
) |
| |
|
virtual |
Read multiple 512 byte sectors from an SD card.
- Parameters
-
[in] | sector | Logical sector to be read. |
[in] | ns | Number of sectors to be read. |
[out] | dst | Pointer to the location that will receive the data. |
- Returns
- The value true is returned for success and the value false is returned for failure.
Implements BlockDeviceInterface.
bool SdioCard::readStart |
( |
uint32_t |
sector | ) |
|
Start a read multiple sectors sequence.
- Parameters
-
[in] | sector | Address of first sector in sequence. |
- Note
- This function is used with readData() and readStop() for optimized multiple sector reads. SPI chipSelect must be low for the entire sequence.
- Returns
- The value true is returned for success and the value false is returned for failure.
bool SdioCard::readStart |
( |
uint32_t |
sector, |
|
|
uint32_t |
count |
|
) |
| |
Start a read multiple sectors sequence.
- Parameters
-
[in] | sector | Address of first sector in sequence. |
[in] | count | Maximum sector count. |
- Note
- This function is used with readData() and readStop() for optimized multiple sector reads. SPI chipSelect must be low for the entire sequence.
- Returns
- The value true is returned for success and the value false is returned for failure.
bool SdioCard::readStop |
( |
| ) |
|
End a read multiple sectors sequence.
- Returns
- The value true is returned for success and the value false is returned for failure.
uint32_t SdioCard::sectorCount |
( |
| ) |
|
|
virtual |
Determine the size of an SD flash memory card.
- Returns
- The number of 512 byte data sectors in the card or zero if an error occurs.
Implements SdCardInterface.
uint32_t SdioCard::status |
( |
| ) |
|
|
virtual |
bool SdioCard::syncDevice |
( |
| ) |
|
|
virtual |
uint8_t SdioCard::type |
( |
| ) |
const |
|
virtual |
Return the card type: SD V1, SD V2 or SDHC
- Returns
- 0 - SD V1, 1 - SD V2, or 3 - SDHC.
Implements SdCardInterface.
bool SdioCard::writeData |
( |
const uint8_t * |
src | ) |
|
|
virtual |
Write one data sector in a multiple sector write sequence.
- Parameters
-
[in] | src | Pointer to the location of the data to be written. |
- Returns
- The value true is returned for success and the value false is returned for failure.
Implements SdCardInterface.
bool SdioCard::writeSector |
( |
uint32_t |
sector, |
|
|
const uint8_t * |
src |
|
) |
| |
|
virtual |
Writes a 512 byte sector to an SD card.
- Parameters
-
[in] | sector | Logical sector to be written. |
[in] | src | Pointer to the location of the data to be written. |
- Returns
- The value true is returned for success and the value false is returned for failure.
Implements BlockDeviceInterface.
bool SdioCard::writeSectors |
( |
uint32_t |
sector, |
|
|
const uint8_t * |
src, |
|
|
size_t |
ns |
|
) |
| |
|
virtual |
Write multiple 512 byte sectors to an SD card.
- Parameters
-
[in] | sector | Logical sector to be written. |
[in] | ns | Number of sectors to be written. |
[in] | src | Pointer to the location of the data to be written. |
- Returns
- The value true is returned for success and the value false is returned for failure.
Implements BlockDeviceInterface.
bool SdioCard::writeStart |
( |
uint32_t |
sector | ) |
|
|
virtual |
Start a write multiple sectors sequence.
- Parameters
-
[in] | sector | Address of first sector in sequence. |
- Note
- This function is used with writeData() and writeStop() for optimized multiple sector writes.
- Returns
- The value true is returned for success and the value false is returned for failure.
Implements SdCardInterface.
bool SdioCard::writeStart |
( |
uint32_t |
sector, |
|
|
uint32_t |
count |
|
) |
| |
Start a write multiple sectors sequence.
- Parameters
-
[in] | sector | Address of first sector in sequence. |
[in] | count | Maximum sector count. |
- Note
- This function is used with writeData() and writeStop() for optimized multiple sector writes.
- Returns
- The value true is returned for success and the value false is returned for failure.
bool SdioCard::writeStop |
( |
| ) |
|
|
virtual |
End a write multiple sectors sequence.
- Returns
- The value true is returned for success and the value false is returned for failure.
Implements SdCardInterface.
The documentation for this class was generated from the following file:
- ArduinoSdFs/libraries/SdFs/src/SdCard/SdioCard.h