summaryrefslogtreecommitdiff
path: root/library/ADK2/SD.h
diff options
context:
space:
mode:
Diffstat (limited to 'library/ADK2/SD.h')
-rw-r--r--library/ADK2/SD.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/library/ADK2/SD.h b/library/ADK2/SD.h
new file mode 100644
index 0000000..341ce39
--- /dev/null
+++ b/library/ADK2/SD.h
@@ -0,0 +1,29 @@
+#ifdef ADK_INTERNAL
+#ifndef _SD_H_
+#define _SD_H_
+
+
+#define SD_BLOCK_SIZE 512
+
+typedef struct{
+
+ uint32_t numSec;
+ uint8_t HC : 1;
+ uint8_t inited : 1;
+ uint8_t SD : 1;
+
+}SD;
+
+char sdInit(SD* sd);
+uint32_t sdGetNumSec(SD* sd);
+char sdSecRead(SD* sd, uint32_t sec, void* buf);
+char sdSecWrite(SD* sd, uint32_t sec, const void* buf);
+
+//stream mode
+char sdReadStart(SD* sd, uint32_t sec);
+void sdNextSec(SD* sd);
+void sdSecReadStop(SD* sd);
+uint8_t* sdStreamSec(uint8_t* buf); //returns ptr to end of buffer...
+
+#endif
+#endif