C API for BALTECH SDK
flashfs.h
Go to the documentation of this file.
1 
18 #ifndef __BRP_BALTECH_API_CMDS_FLASHFS_H__
19 #define __BRP_BALTECH_API_CMDS_FLASHFS_H__
20 #include "../typedefs.h"
24 #define BRP_FlashFS_ErrFsCorrupt BRP_ERR_STATUS(0x4900, 0x01)
25 
28 #define BRP_FlashFS_ErrRecordCorrupt BRP_ERR_STATUS(0x4900, 0x02)
29 
32 #define BRP_FlashFS_ErrFlashAccess BRP_ERR_STATUS(0x4900, 0x03)
33 
36 #define BRP_FlashFS_ErrDirectoryFull BRP_ERR_STATUS(0x4900, 0x04)
37 
40 #define BRP_FlashFS_ErrFileNotFound BRP_ERR_STATUS(0x4900, 0x05)
41 
44 #define BRP_FlashFS_ErrEndOfFile BRP_ERR_STATUS(0x4900, 0x06)
45 
48 #define BRP_FlashFS_ErrFull BRP_ERR_STATUS(0x4900, 0x07)
49 
52 #define BRP_FlashFS_ErrFileExist BRP_ERR_STATUS(0x4900, 0x08)
53 
61 brp_errcode brp_FlashFS_GetMemoryInfo(brp_protocol protocol, unsigned* TotalMem, unsigned* FreeMem);
71 brp_errcode brp_FlashFS_Format(brp_protocol protocol, bool QuickFormat);
82 brp_errcode brp_FlashFS_CreateFile(brp_protocol protocol, unsigned FileId, unsigned RecordSize);
91 brp_errcode brp_FlashFS_DeleteFile(brp_protocol protocol, unsigned FileId);
101 brp_errcode brp_FlashFS_RenameFile(brp_protocol protocol, unsigned FileId, unsigned NewFileId);
110 brp_errcode brp_FlashFS_GetRecordSize(brp_protocol protocol, unsigned FileId, unsigned* RecordSize);
118 brp_errcode brp_FlashFS_GetFileSize(brp_protocol protocol, unsigned FileId, unsigned* FileSize);
132 brp_errcode brp_FlashFS_ReadRecords(brp_protocol protocol, unsigned FileId, unsigned StartRecord, unsigned RecordCount, brp_FlashFS_ReadRecords_RecordList_Entry** RecordList, size_t* RecordList_len, brp_mempool *mempool);
144 brp_errcode brp_FlashFS_WriteRecords(brp_protocol protocol, unsigned FileId, unsigned StartRecord, brp_FlashFS_WriteRecords_RecordList_Entry* RecordList, size_t RecordList_len);
145 #endif
146 
brp_errcode brp_FlashFS_CreateFile(brp_protocol protocol, unsigned FileId, unsigned RecordSize)
This command creates a new empty file, if the file doesn't exist yet.
unsigned int brp_errcode
This type is used library-wide for passing error codes in the return value of functions.
Definition: errorcodes.h:23
brp_errcode brp_FlashFS_GetMemoryInfo(brp_protocol protocol, unsigned *TotalMem, unsigned *FreeMem)
This command checks the consistency of the file system and retrieves information about the available ...
struct brp_protocol_t * brp_protocol
This is a generic handle of a protocol.
Definition: protocol.h:34
brp_errcode brp_FlashFS_GetRecordSize(brp_protocol protocol, unsigned FileId, unsigned *RecordSize)
This command retrieves the size of a single record of a certain file.
struct brp_mempool_object_t * brp_mempool
mempool handle.
Definition: mempool.h:27
Definition: typedefs.h:1042
brp_errcode brp_FlashFS_WriteRecords(brp_protocol protocol, unsigned FileId, unsigned StartRecord, brp_FlashFS_WriteRecords_RecordList_Entry *RecordList, size_t RecordList_len)
This command writes one or more records to a file.
brp_errcode brp_FlashFS_DeleteFile(brp_protocol protocol, unsigned FileId)
This command deletes a file and all its contained records.
brp_errcode brp_FlashFS_GetFileSize(brp_protocol protocol, unsigned FileId, unsigned *FileSize)
This command retrieves the number of records a certain file contains.
brp_errcode brp_FlashFS_RenameFile(brp_protocol protocol, unsigned FileId, unsigned NewFileId)
This command changes the File ID of a file from FileId to NewFileId , provided the file with ID FileI...
Definition: typedefs.h:1056
brp_errcode brp_FlashFS_ReadRecords(brp_protocol protocol, unsigned FileId, unsigned StartRecord, unsigned RecordCount, brp_FlashFS_ReadRecords_RecordList_Entry **RecordList, size_t *RecordList_len, brp_mempool *mempool)
This command reads one or more records from a file.
brp_errcode brp_FlashFS_Format(brp_protocol protocol, bool QuickFormat)
This command resets the complete file system.