Wombat Environmental Node 1.0
An environmental node for SDI-12 and digital sensors.
Loading...
Searching...
No Matches
interface.h
Go to the documentation of this file.
1#ifndef NODE_SDCARD_H
2#define NODE_SDCARD_H
3
4#include "Arduino.h"
5#include "SD.h"
6#include "SPI.h"
7
8#define DEBUG
9
11private:
12 static const uint8_t SD_CS = 4;
13 static bool sd_ok;
14
15public:
18
20 static bool begin(void);
21
23 static void add_file(const char* filepath, const char* contents);
24
26 static void append_to_file(const char* filepath, const char* contents);
27
30 static void read_file(const char* filepath, Stream& stream);
31 static size_t read_file(const char* filepath, char * buffer, const size_t buffer_size, const size_t file_location);
32 static size_t get_file_size(const char* filepath);
33
35 static void delete_file(const char* filepath);
36
38 static bool is_ready(void);
39
40 #ifdef DEBUG
41 void list_directory(File dir, uint8_t num_tabs);
42 #endif
43
44};
45
46#endif //NODE_SDCARD_H
Definition: interface.h:10
static void read_file(const char *filepath, Stream &stream)
Definition: interface.cpp:120
static const uint8_t SD_CS
Definition: interface.h:12
static bool begin(void)
Enable the SD card and mount it.
Definition: interface.cpp:16
static bool sd_ok
Definition: interface.h:13
static void add_file(const char *filepath, const char *contents)
Create a file with the given content.
Definition: interface.cpp:74
static bool is_ready(void)
Returns true if an SD card was detected.
Definition: interface.cpp:12
void list_directory(File dir, uint8_t num_tabs)
static void append_to_file(const char *filepath, const char *contents)
Append contents to the file at filepath.
Definition: interface.cpp:102
static void delete_file(const char *filepath)
Delete the file at filepath.
Definition: interface.cpp:193
static size_t get_file_size(const char *filepath)
Definition: interface.cpp:176