Wombat Environmental Node 1.0
An environmental node for SDI-12 and digital sensors.
Loading...
Searching...
No Matches
SDCardInterface Class Reference

#include <interface.h>

Collaboration diagram for SDCardInterface:

Public Member Functions

 SDCardInterface ()
 
 ~SDCardInterface ()
 
void list_directory (File dir, uint8_t num_tabs)
 

Static Public Member Functions

static bool begin (void)
 Enable the SD card and mount it. More...
 
static void add_file (const char *filepath, const char *contents)
 Create a file with the given content. More...
 
static void append_to_file (const char *filepath, const char *contents)
 Append contents to the file at filepath. More...
 
static void read_file (const char *filepath, Stream &stream)
 
static size_t read_file (const char *filepath, char *buffer, const size_t buffer_size, const size_t file_location)
 
static size_t get_file_size (const char *filepath)
 
static void delete_file (const char *filepath)
 Delete the file at filepath. More...
 
static bool is_ready (void)
 Returns true if an SD card was detected. More...
 

Static Private Attributes

static const uint8_t SD_CS = 4
 
static bool sd_ok = false
 

Constructor & Destructor Documentation

◆ SDCardInterface()

SDCardInterface::SDCardInterface ( )
default

◆ ~SDCardInterface()

SDCardInterface::~SDCardInterface ( )
default

Member Function Documentation

◆ add_file()

void SDCardInterface::add_file ( const char *  filepath,
const char *  contents 
)
static

Create a file with the given content.

◆ append_to_file()

void SDCardInterface::append_to_file ( const char *  filepath,
const char *  contents 
)
static

Append contents to the file at filepath.

◆ begin()

bool SDCardInterface::begin ( void  )
static

Enable the SD card and mount it.

◆ delete_file()

void SDCardInterface::delete_file ( const char *  filepath)
static

Delete the file at filepath.

◆ get_file_size()

size_t SDCardInterface::get_file_size ( const char *  filepath)
static

◆ is_ready()

bool SDCardInterface::is_ready ( void  )
static

Returns true if an SD card was detected.

◆ list_directory()

void SDCardInterface::list_directory ( File  dir,
uint8_t  num_tabs 
)

◆ read_file() [1/2]

size_t SDCardInterface::read_file ( const char *  filepath,
char *  buffer,
const size_t  buffer_size,
const size_t  file_location 
)
static

◆ read_file() [2/2]

void SDCardInterface::read_file ( const char *  filepath,
Stream &  stream 
)
static

Read and print the content file filepath. TODO: Fix this to write the content to a provided buffer.

Member Data Documentation

◆ SD_CS

const uint8_t SDCardInterface::SD_CS = 4
staticprivate

◆ sd_ok

bool SDCardInterface::sd_ok = false
staticprivate

The documentation for this class was generated from the following files: