esp8266 SD

This commit is contained in:
Stephen Crane 2018-11-29 18:11:29 +00:00
parent 6f243f07c5
commit d22a61368e
2 changed files with 37 additions and 7 deletions

View File

@ -4,13 +4,9 @@
#if defined(USE_SD)
#include <SD.h>
#endif
#if defined(USE_SPIFFS)
#elif defined(USE_SPIFFS)
#include <SPIFFS.h>
#endif
#if defined(ESP8266)
#elif defined(USE_FS)
#include <FS.h>
#endif
@ -41,13 +37,17 @@ bool hardware_reset() {
#endif
#if defined(USE_SD)
#if defined(SD_SPI)
success = SD.begin(SD_CS, 2, SD_SPI);
pinMode(SPI_CS, OUTPUT); // without this, the SPI-RAM isn't seen
#else
success = SD.begin(SD_CS);
#endif
#elif defined(USE_SPIFFS)
success = SPIFFS.begin(true);
#elif defined(ESP8266)
#elif defined(USE_FS)
success = SPIFFS.begin();
#endif

30
hw/esp8266-pwm-sd.h Normal file
View File

@ -0,0 +1,30 @@
// TFT display...
#define USE_ESPI
//must define these in Makefile (or platformio)
//#define USER_SETUP_LOADED
//#define ILI9341_DRIVER
//#define TFT_CS PIN_D6
//#define TFT_DC PIN_D8
//#define TFT_WIDTH 240
//#define TFT_HEIGHT 320
//#define TFT_RST -1
//#define SPI_FREQUENCY 40000000
//#define LOAD_GLCD
// PS/2 keyboard
#define KBD_DATA D3
#define KBD_IRQ D4
// SPI-RAM
#undef USE_SPIRAM
// "tape" storage...
#define USE_SD
#define SD_CS D0
#undef USE_SPIFFS
#undef USE_FS
// sound
#define PWM_SOUND D2
#define PWM_DUTY 20 // 20/1024 -> volume
#define PWM_TOP 1024