Skip to content

Commit 5529188

Browse files
ficetoficeto
authored andcommitted
add info methods to SD class
1 parent b5b783e commit 5529188

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • libraries/SD/src

libraries/SD/src/SD.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ class SDClass {
106106

107107
boolean rmdir(char *filepath);
108108

109+
size_t type(){ return card.type(); }
110+
size_t fatType(){ return volume.fatType(); }
111+
size_t blocksPerCluster(){ return volume.blocksPerCluster(); }
112+
size_t totalClusters(){ return volume.clusterCount(); }
113+
size_t blockSize(){ return (size_t)0x200; }
114+
size_t totalBlocks(){ return (totalClusters() / blocksPerCluster()); }
115+
size_t clusterSize(){ return blocksPerCluster() * blockSize(); }
116+
size_t size(){ return (clusterSize() * totalClusters()); }
109117
private:
110118

111119
// This is used to determine the mode used to open a file

0 commit comments

Comments
 (0)