-
Notifications
You must be signed in to change notification settings - Fork 1
/
Ecoboard.h
66 lines (50 loc) · 1.59 KB
/
Ecoboard.h
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
60
61
62
63
64
65
66
/*
* EcoBoard © 2022 by Pierre Amey is licensed under CC BY-NC-SA 4.0
* That file is underdevelopment. Do not use it for now
*
* The follwing code can be used without garranty.
I will double check it later with EcoLora
*
*/
#ifndef Ecoboard_h
#define Ecoboard_h
#include <SdFat.h> // For SD Card
//#include <SdFatUtil.h> // For SD Card
#include "Arduino.h"
#define FILESIZE 12
#define SD_PATHSIZE 20
class Ecoboard{
protected:
private:
bool _debug;
/* RTC */
bool _isRTCEnable;
/*SD Card */
SdFat _sd;
bool _isSdEnable;
bool _isSdReady;
int _carddetect;
int _chipselect;
char _sd_pathLog[SD_PATHSIZE]; // store the path to the log file
char _logFile[SD_PATHSIZE+FILESIZE]; // store the logfile name
//void _sd_showCwd();
bool _sd_checkCard();
int _sd_writeln(char * fileName, char const * text);
int _sd_write(const char * fileName, char const * text);
int _sd_write(char * fileName, const __FlashStringHelper * text);
int _sd_writeln(char * fileName, const __FlashStringHelper * text);
int _sd_write(const char * fileName, const __FlashStringHelper * text, bool ln);
int _sd_write(const char * fileName, char const * text, bool ln);
public:
Ecoboard();
Ecoboard(bool isSdEnable, bool isRTCEnable, bool debug);
void begin();
bool sd_begin();
/* SD Card */
//void listFiles(const char * folder);
int sd_init_logFile(int16_t y, int16_t m, int16_t d, int16_t h, int16_t mn, int16_t s);
int sd_writeln(char const * text);
int sd_write(char const * text);
int sd_write(int16_t text);
};
#endif