Avionics
Core avionics package for CURE flight computers
Loading...
Searching...
No Matches
DataSaverBigSD Class Reference

Buffered CSV writer targeting large SD cards via SdFat. More...

#include <DataSaverBigSD.h>

Inheritance diagram for DataSaverBigSD:
Inheritance graph
Collaboration diagram for DataSaverBigSD:
Collaboration graph

Public Member Functions

 DataSaverBigSD (uint8_t csPin=5)
bool begin ()
 Initialize the SD card and open a streaming file. Returns true on success.
int saveDataPoint (const DataPoint &dataPoint, uint8_t name) override
 Buffer a CSV line (timestamp,name,value) and flush in batches.
void end ()
 Flush pending bytes and close the file.
Public Member Functions inherited from IDataSaver
virtual int saveDataPoint (float data, uint32_t timestamp_ms, uint8_t name) final
 Convenience overload to construct and save a data point.
virtual void launchDetected (uint32_t launchTimestamp_ms)
 Notification that launch has been detected.

Detailed Description

Buffered CSV writer targeting large SD cards via SdFat.

Note
When to use: high-volume logging to removable media where batched writes and periodic syncs reduce wear and latency.

Definition at line 29 of file DataSaverBigSD.h.

Constructor & Destructor Documentation

◆ DataSaverBigSD()

DataSaverBigSD::DataSaverBigSD ( uint8_t csPin = 5)
explicit

Definition at line 8 of file DataSaverBigSD.cpp.

Member Function Documentation

◆ begin()

bool DataSaverBigSD::begin ( )
virtual

Initialize the SD card and open a streaming file. Returns true on success.

Note
When to use: during setup before any calls to saveDataPoint.

Reimplemented from IDataSaver.

Definition at line 11 of file DataSaverBigSD.cpp.

◆ end()

void DataSaverBigSD::end ( )

Flush pending bytes and close the file.

Note
When to use: before power-off or media removal to avoid loss.

Definition at line 96 of file DataSaverBigSD.cpp.

◆ saveDataPoint()

int DataSaverBigSD::saveDataPoint ( const DataPoint & dataPoint,
uint8_t name )
overridevirtual

Buffer a CSV line (timestamp,name,value) and flush in batches.

Parameters
dataPointTimestamped value to log.
name8-bit channel identifier written in the CSV line.
Note
When to use: routine logging path once begin() succeeds.

Implements IDataSaver.

Definition at line 39 of file DataSaverBigSD.cpp.


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