N4 Flight Software N4
Flight software used for the N4 flight computers
Loading...
Searching...
No Matches
DataLogger Class Reference

Public Member Functions

 DataLogger (uint8_t cs_pin, uint8_t led_pin, char *filename, SerialFlashFile file, uint32_t filesize)
 class constructor pass the chip select pin as a parameter for that class instance
 
bool loggerInit ()
 Initialize the flash memory.
 
void loggerFormat ()
 format the flash memory
 
void loggerInfo ()
 print the data about the flash memory
 
bool loggerTest ()
 test the flash memory write and read function by reading and writing a variable to it
 
void loggerWrite (telemetry_type_t)
 write the provided data to the file created
 
void loggerRead (uint8_t file_pointer, char buffer)
 Read data from the start of the file to the end of the file.
 
void loggerSpaces ()
 helper function to print spaces for data formatting
 
void loggerEquals ()
 helper function to print = for data formatting
 

Constructor & Destructor Documentation

◆ DataLogger()

DataLogger::DataLogger ( uint8_t cs_pin,
uint8_t led_pin,
char * filename,
SerialFlashFile file,
uint32_t filesize )

class constructor pass the chip select pin as a parameter for that class instance

Parameters
cs_pinchip select pin
flas_ledLED to show formatting status
filenamethe filename of the file being created
file_sizethe size of the file being created

Member Function Documentation

◆ loggerFormat()

void DataLogger::loggerFormat ( )

format the flash memory

Parameters
none

◆ loggerInit()

bool DataLogger::loggerInit ( )

Initialize the flash memory.

Returns
true on success and false on fail

◆ loggerRead()

void DataLogger::loggerRead ( uint8_t file_pointer,
char buffer )

Read data from the start of the file to the end of the file.

Parameters
_file_pointerpointer to where we want to start reading the file. By default, this value os 0
bufferchar array to read the data into

◆ loggerTest()

bool DataLogger::loggerTest ( )

test the flash memory write and read function by reading and writing a variable to it

Parameters
none
Returns
true if R/W OK, false otherwise

◆ loggerWrite()

void DataLogger::loggerWrite ( telemetry_type_t packet)

write the provided data to the file created

Parameters
datathis is a struct pointer to the struct that contains the data that needs to be written to the memory

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