ASCEND Flight Software
Loading...
Searching...
No Matches
SDStorage.h
Go to the documentation of this file.
1#ifndef SD_STORAGE_H
2#define SD_STORAGE_H
3
4#include "ErrorDisplay.h"
5#include "PayloadConfig.h"
6#include "SD.h"
7#include "Storage.h"
8
13class SDStorage : public Storage {
14 private:
15 String file_name;
16#if SD_SPI1
17 SPIClassRP2040 sd_spi_1 = SPIClassRP2040(spi1, SPI1_MISO_PIN, SD_CS_PIN,
19#endif
20
21 public:
22 SDStorage();
23 bool verify() override;
24 void store(String data) override;
25 void storePacket(uint8_t* packet) override;
26};
27
28#endif
Central location for pinout and config defines.
#define SD_CS_PIN
SD Card SPI CS Pin.
Definition PayloadConfig.h:62
#define SPI1_MOSI_PIN
SPI1 MOSI Pin.
Definition PayloadConfig.h:75
#define SPI1_SCK_PIN
SPI1 SCK Pin.
Definition PayloadConfig.h:73
#define SPI1_MISO_PIN
SPI1 MISO Pin.
Definition PayloadConfig.h:71
int attempt_number
Definition Device.h:19
Implementation of a Storage device to interface with an SD card.
Definition SDStorage.h:13
void storePacket(uint8_t *packet) override
Store data on the SD card.
Definition SDStorage.cpp:84
void store(String data) override
Store data on the SD card, ending with newline.
Definition SDStorage.cpp:60
String file_name
Definition SDStorage.h:15
SDStorage()
Construct a new SDStorage object.
Definition SDStorage.cpp:7
SPIClassRP2040 sd_spi_1
Definition SDStorage.h:17
bool verify() override
Verify SD card connection and create a new, unique file.
Definition SDStorage.cpp:15
Parent class for all data storage devices (sd card, radio, etc)
Definition Storage.h:13