Files
ESP32Marauder/esp32_marauder/SDInterface.h
Adam Benhassen 01af8484b1 feat: add M5Stack Cardputer ADV board support
Add support for the M5Stack Cardputer ADV hardware variant, which
replaces the original GPIO matrix keyboard with a TCA8418 I2C keypad
controller.

Changes:
- Vendor Adafruit_TCA8418 library for I2C keyboard communication
- Add MARAUDER_CARDPUTER_ADV board target with feature flags in configs.h
- Implement TCA8418 keyboard driver with interrupt-driven FIFO scanning,
  coordinate remapping (verified against M5Cardputer-UserDemo-ADV), and
  persistent key state tracking for compatibility with menu polling
- Extend all MARAUDER_CARDPUTER preprocessor guards to include ADV variant
- Add TFT_eSPI display configuration (same display as original Cardputer)
- Add CI build matrix entries for both parallel and nightly workflows
2026-03-07 21:48:37 +01:00

73 lines
1.4 KiB
C++

#pragma once
#ifndef SDInterface_h
#define SDInterface_h
#include "configs.h"
#include "settings.h"
#ifdef HAS_C5_SD
#include "FS.h"
#endif
#include "SD.h"
#ifdef HAS_C5_SD
#include "SPI.h"
#endif
#include "Buffer.h"
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include <Update.h>
#include "esp_ota_ops.h"
#include "esp_partition.h"
#include "esp_err.h"
extern Buffer buffer_obj;
extern Settings settings_obj;
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
#ifdef KIT
#define SD_DET 4
#endif
class SDInterface {
private:
#if (defined(MARAUDER_M5STICKC) || defined(HAS_CYD_TOUCH) || defined(MARAUDER_CARDPUTER) || defined(MARAUDER_CARDPUTER_ADV))
SPIClass *spiExt;
#elif defined(HAS_C5_SD)
SPIClass* _spi;
int _cs;
#endif
public:
#ifdef HAS_C5_SD
SDInterface(SPIClass* spi, int cs);
#endif
uint8_t cardType;
//uint64_t cardSizeBT;
//uint64_t cardSizeKB;
uint64_t cardSizeMB;
//uint64_t cardSizeGB;
bool supported = false;
String card_sz;
bool initSD();
LinkedList<String>* sd_files;
void listDir(String str_dir);
void listDirToLinkedList(LinkedList<String>* file_names, String str_dir = "/", String ext = "");
File getFile(String path);
void runUpdate(String file_name = "");
void performUpdate(Stream &updateSource, size_t updateSize);
bool removeFile(String file_path);
};
#endif