N4 Flight Software N4
Flight software used for the N4 flight computers
Loading...
Searching...
No Matches
logger.h
Go to the documentation of this file.
1
13#ifndef LOGGER_H
14#define LOGGER_H
15
16#include <Arduino.h>
17#include <SerialFlash.h>
18#include "data_types.h"
19
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;
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 bool loggerTest();
38 void loggerRead(uint8_t file_pointer, char buffer);
39 void loggerSpaces();
40 void loggerEquals();
41};
42
43
44#endif
Definition logger.h:20
bool loggerInit()
Initialize the flash memory.
Definition logger.cpp:76
void loggerWrite(telemetry_type_t)
write the provided data to the file created
Definition logger.cpp:160
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:229
void loggerFormat()
format the flash memory
Definition logger.cpp:36
void loggerInfo()
print the data about the flash memory
Definition logger.cpp:240
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:22
void loggerSpaces()
helper function to print spaces for data formatting
Definition logger.cpp:253
void loggerEquals()
helper function to print = for data formatting
Definition logger.cpp:262
bool loggerTest()
test the flash memory write and read function by reading and writing a variable to it
Definition logger.cpp:143
defines the data types, structs and typedefs used to store flight data
char filename[]
Definition main.cpp:542
SerialFlashFile file
Definition main.cpp:546
Definition data_types.h:55