aiie/teensy/teensy-filemanager.h

43 lines
979 B
C
Raw Normal View History

2017-02-20 18:55:16 +00:00
#ifndef __TEENSYFILEMANAGER_H
#define __TEENSYFILEMANAGER_H
#include "filemanager.h"
#include <stdint.h>
#include <SdFat.h>
2020-07-06 11:04:22 +00:00
#include <SPI.h>
2017-02-20 18:55:16 +00:00
class TeensyFileManager : public FileManager {
public:
TeensyFileManager();
virtual ~TeensyFileManager();
2017-12-30 20:20:34 +00:00
2017-02-20 18:55:16 +00:00
virtual int8_t openFile(const char *name);
virtual void closeFile(int8_t fd);
virtual const char *fileName(int8_t fd);
virtual int16_t readDir(const char *where, const char *suffix, char *outputFN, int16_t startIdx, uint16_t maxlen);
virtual void closeDir();
virtual void getRootPath(char *toWhere, int8_t maxLen);
virtual bool setSeekPosition(int8_t fd, uint32_t pos);
virtual void seekToEnd(int8_t fd);
2020-06-28 13:21:27 +00:00
virtual int write(int8_t fd, const void *buf, int nbyte);
virtual int read(int8_t fd, void *buf, int nbyte);
virtual int lseek(int8_t fd, int offset, int whence);
2022-01-07 17:50:13 +00:00
virtual void flush();
private:
bool _prepCache(int8_t fd);
2017-02-20 18:55:16 +00:00
private:
2020-07-06 11:04:22 +00:00
int8_t numCached;
2018-01-07 10:08:29 +00:00
2020-07-06 11:04:22 +00:00
int8_t cacheFd;
2017-02-20 18:55:16 +00:00
};
#endif