-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSDCard.h
More file actions
59 lines (44 loc) · 1.21 KB
/
SDCard.h
File metadata and controls
59 lines (44 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef _____OpenEOG_32bit__SDCard
#define _____OpenEOG_32bit__SDCard
#include <Arduino.h>
#include <OBCI32_SD.h>
#include "Definitions.h"
class SDCard {
public:
bool fileIsOpen;
SDCard();
bool open();
bool close();
void resetFileNumber();
void writeTestStarts();
void writeTestEnds();
void writeSampleToSD(
unsigned long timestamp,
unsigned long sampleNumber,
int horizontalChannel,
int verticalChannel,
unsigned short label
);
private:
const unsigned long BLOCK_COUNT = 32768;
int blockCounter = 0;
int byteCounter = 0;
SdFile openfile;
Sd2Card card;
SdVolume volume;
SdFile root;
unsigned char* pCache;
unsigned long bgnBlock, endBlock;
bool openvol;
bool cardInit;
char currentFileName[11];
unsigned long fileNumber;
void activate();
void deactivate();
void setFileName();
void writeTimestamp(unsigned long timestamp);
void writePart(unsigned char header, bool fillCache);
void writeFooter();
void writeCache();
};
#endif