69 lines
1.8 KiB
C
69 lines
1.8 KiB
C
|
#ifndef __FILE__SYSTEM___H
|
|||
|
#define __FILE__SYSTEM___H
|
|||
|
#include "ff.h"
|
|||
|
#include "diskio.h"
|
|||
|
#include "stdint.h"
|
|||
|
|
|||
|
|
|||
|
#define SF__DF__SECTOR__SIZE (_MAX_SS) //
|
|||
|
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
#define FILE__APD (0x01)
|
|||
|
#define FILE__NEW (0x02)
|
|||
|
|
|||
|
//<2F>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
#define FERROR__SUCC (0x00) //<2F><>ȷ
|
|||
|
#define FERROR__OPEN (0x01) //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
#define FERROR__WRITE (0x02) //д<><D0B4><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
#define FERROR__CLOSE (0x04) //<2F>ر<EFBFBD><D8B1>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
#define FILESYS__SEARCHANY (0x01) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ļ<EFBFBD>(ָ<><D6B8>·<EFBFBD><C2B7><EFBFBD><EFBFBD>)
|
|||
|
#define FILESYS__DELETEALL (0x02) //ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>(ָ<><D6B8>·<EFBFBD><C2B7><EFBFBD><EFBFBD>)
|
|||
|
#define FILESYS__SCANALL (0x03) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>е<EFBFBD><D0B5>ļ<EFBFBD>(ָ<><D6B8>·<EFBFBD><C2B7><EFBFBD><EFBFBD>)
|
|||
|
|
|||
|
|
|||
|
int filesys_init(void); //<2F>ļ<EFBFBD>ϵͳ<CFB5><CDB3>ʼ<EFBFBD><CABC>
|
|||
|
uint8_t fileSys__remove (char* path); //<2F>Ƴ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>ļ<EFBFBD>
|
|||
|
uint8_t fileSys__mkfs(void); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
uint8_t fileSys__freeSpace(char* fileName, uint32_t* totalkB, uint32_t* freekB); //<2F><><EFBFBD>ÿ<EFBFBD><C3BF>пռ<D0BF>
|
|||
|
uint8_t fileSys__append(char* fileName, uint8_t apdType, uint8_t* data, uint16_t dataLength); //<2F><><EFBFBD>ӻ<EFBFBD><EFBFBD><D7B7><EFBFBD>ļ<EFBFBD>
|
|||
|
uint8_t fileSys__read(char* fileName, uint8_t* data, uint16_t* dataLength, uint32_t cacheSize); //
|
|||
|
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
|||
|
typedef enum __OPS_RESULTS
|
|||
|
{
|
|||
|
OPS_SUCC = 0,
|
|||
|
OPS__SUCC = 0,
|
|||
|
OPS_FAIL = 1,
|
|||
|
OPS__FAIL = 1,
|
|||
|
|
|||
|
//x. <20>ļ<EFBFBD>ϵͳ<CFB5>Ĵ<EFBFBD><C4B4><EFBFBD>
|
|||
|
OPS__DISK__FULL, //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (2)
|
|||
|
|
|||
|
//x. <20><><EFBFBD><EFBFBD>Ŀ¼<C4BF>ļ<EFBFBD>
|
|||
|
OPS__DIR__ERROR, //(3)
|
|||
|
OPS__DIR__OVER,
|
|||
|
OPS__DIR__OVERFLOW,
|
|||
|
OPS__DIR__SUCC,
|
|||
|
|
|||
|
//x. ɾ<><C9BE><EFBFBD>ļ<EFBFBD>
|
|||
|
OPS__RM__ERROR, //ɾ<><C9BE><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
OPS__RM__SUCC,
|
|||
|
|
|||
|
//x. <20><>д<EFBFBD>ļ<EFBFBD>
|
|||
|
OPS__RW__NOEXIST, //<2F>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
OPS__RW__OVERSIZE, //<2F>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB6A8>С
|
|||
|
OPS__RW__SUCC,
|
|||
|
|
|||
|
//x. Э<><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
OPS__PTC__DATA__OVERFLOW, //<2F><><EFBFBD>ݹ<EFBFBD><DDB9><EFBFBD>
|
|||
|
|
|||
|
//x. sysact<63>еĴ<D0B5><C4B4><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
OPS__ACKDATA__EMPTY, //Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
|
|||
|
|
|||
|
} OPS_RESULTS;
|
|||
|
|
|||
|
|
|||
|
#endif
|
|||
|
|