N4 Flight Software
N4
Flight software used for the N4 flight computers
Toggle main menu visibility
Loading...
Searching...
No Matches
logger.h
Go to the documentation of this file.
1
12
13
#ifndef LOGGER_H
14
#define LOGGER_H
15
16
#include <Arduino.h>
17
#include <SerialFlash.h>
18
#include "
data_types.h
"
19
20
class
DataLogger
{
21
private
:
22
uint8_t _cs_pin;
23
uint8_t _led_pin;
24
char
_filename[20];
25
SerialFlashFile _file;
26
uint32_t _file_size;
27
uint8_t _flash_delay = 100;
28
uint8_t _file_pointer = 0;
29
30
31
public
:
32
DataLogger
(uint8_t cs_pin, uint8_t led_pin,
char
* filename, SerialFlashFile
file
, uint32_t filesize);
// constructor
33
bool
loggerInit
();
34
void
loggerFormat
();
35
void
loggerInfo
();
36
void
loggerTest
();
37
void
loggerWrite
(
telemetry_type_t
);
38
void
loggerRead
(uint8_t file_pointer,
char
buffer);
39
void
loggerSpaces
();
40
void
loggerEquals
();
41
};
42
43
44
#endif
DataLogger::loggerInit
bool loggerInit()
Initialize the flash memory.
Definition
logger.cpp:76
DataLogger::loggerWrite
void loggerWrite(telemetry_type_t)
write the provided data to the file created
Definition
logger.cpp:159
DataLogger::loggerRead
void loggerRead(uint8_t file_pointer, char buffer)
Read data from the start of the file to the end of the file.
Definition
logger.cpp:225
DataLogger::loggerFormat
void loggerFormat()
format the flash memory
Definition
logger.cpp:37
DataLogger::loggerTest
void loggerTest()
test the flash memory write and read function by reading and writing a variable to it
Definition
logger.cpp:147
DataLogger::loggerInfo
void loggerInfo()
print the data about the flash memory
Definition
logger.cpp:236
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
Definition
logger.cpp:23
DataLogger::loggerSpaces
void loggerSpaces()
helper function to print spaces for data formatting
Definition
logger.cpp:250
DataLogger::loggerEquals
void loggerEquals()
helper function to print = for data formatting
Definition
logger.cpp:259
data_types.h
defines the data types, structs and typedefs used to store flight data
telemetry_type_t
struct Telemetry_Data telemetry_type_t
file
SerialFlashFile file
Definition
main.cpp:144
n4-flight-software
src
logger.h
Generated by
1.17.0