Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions libraries/SD/src/SD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,22 @@ uint64_t SDFS::cardSize()
return (uint64_t)sectors * sectorSize;
}

size_t SDFS::numSectors()
{
if(_pdrv == 0xFF) {
return 0;
}
return sdcard_num_sectors(_pdrv);
}

size_t SDFS::sectorSize()
{
if(_pdrv == 0xFF) {
return 0;
}
return sdcard_sector_size(_pdrv);
}

uint64_t SDFS::totalBytes()
{
FATFS* fsinfo;
Expand Down
2 changes: 2 additions & 0 deletions libraries/SD/src/SD.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class SDFS : public FS
void end();
sdcard_type_t cardType();
uint64_t cardSize();
size_t numSectors();
size_t sectorSize();
uint64_t totalBytes();
uint64_t usedBytes();
bool readRAW(uint8_t* buffer, uint32_t sector);
Expand Down