-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwaveshare_sd_card.h
More file actions
35 lines (30 loc) · 1.32 KB
/
waveshare_sd_card.h
File metadata and controls
35 lines (30 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __SD_CARD_H
#define __SD_CARD_H
#include "FS.h"
#include "SD.h"
#include "SPI.h"
#include <esp_io_expander.hpp>
// Extension IO pin definition
#define TP_RST 1 // Touch screen reset pin
#define LCD_BL 2 // LCD backlight pinout
#define LCD_RST 3 // LCD reset pin
#define SD_CS 4 // SD card select pin
#define USB_SEL 5 // USB select pin
// I2C pin definitions
#define EXAMPLE_I2C_ADDR (ESP_IO_EXPANDER_I2C_CH422G_ADDRESS)
#define EXAMPLE_I2C_SDA_PIN 8 // I2C data line pins
#define EXAMPLE_I2C_SCL_PIN 9 // I2C clock line pin
#define SD_MOSI 11 // SD card master output slave input pin
#define SD_CLK 12 // SD card clock pin
#define SD_MISO 13 // SD card master input slave output pin
#define SD_SS -1 // SD card select pin (not used)
void listDir(fs::FS &fs, const char * dirname, uint8_t levels);
void createDir(fs::FS &fs, const char * path);
void removeDir(fs::FS &fs, const char * path);
void writeFile(fs::FS &fs, const char * path, const char * message);
void appendFile(fs::FS &fs, const char * path, const char * message);
void readFile(fs::FS &fs, const char * path);
void deleteFile(fs::FS &fs, const char * path);
void renameFile(fs::FS &fs, const char * path1, const char * path2);
void testFileIO(fs::FS &fs, const char * path);
#endif