19 #include <ti/drivers/net/wifi/simplelink.h>
50 #define SL_FS_OPEN_MODE_BIT_MASK (0xF8000000)
51 #define SL_NUM_OF_MODE_BIT (5)
53 #define SL_FS_OPEN_FLAGS_BIT_MASK (0x07FE0000)
54 #define SL_NUM_OF_FLAGS_BIT (10)
56 #define SL_FS_OPEN_MAXSIZE_BIT_MASK (0x1FFFF)
57 #define SL_NUM_OF_MAXSIZE_BIT (17)
72 SL_FS_TOKEN_MASTER = 0,
73 SL_FS_TOKEN_WRITE_READ = 1,
74 SL_FS_TOKEN_WRITE_ONLY = 2,
75 SL_FS_TOKEN_READ_ONLY = 3
97 #define SL_FS_INFO_OPEN_WRITE 0x1000
98 #define SL_FS_INFO_OPEN_READ 0x800
100 #define SL_FS_INFO_MUST_COMMIT 0x1
101 #define SL_FS_INFO_BUNDLE_FILE 0x2
103 #define SL_FS_INFO_PENDING_COMMIT 0x4
104 #define SL_FS_INFO_PENDING_BUNDLE_COMMIT 0x8
106 #define SL_FS_INFO_NOT_FAILSAFE 0x20
107 #define SL_FS_INFO_NOT_VALID 0x100
108 #define SL_FS_INFO_SYS_FILE 0x40
109 #define SL_FS_INFO_SECURE 0x10
110 #define SL_FS_INFO_NOSIGNATURE 0x2000
111 #define SL_FS_INFO_PUBLIC_WRITE 0x200
112 #define SL_FS_INFO_PUBLIC_READ 0x400
122 #define SL_FS_CREATE ((_u32)0x1<<(SL_NUM_OF_MAXSIZE_BIT+SL_NUM_OF_FLAGS_BIT))
123 #define SL_FS_WRITE ((_u32)0x2<<(SL_NUM_OF_MAXSIZE_BIT+SL_NUM_OF_FLAGS_BIT))
124 #define SL_FS_OVERWRITE ((_u32)0x4<<(SL_NUM_OF_MAXSIZE_BIT+SL_NUM_OF_FLAGS_BIT))
125 #define SL_FS_READ ((_u32)0x8<<(SL_NUM_OF_MAXSIZE_BIT+SL_NUM_OF_FLAGS_BIT))
127 #define SL_FS_CREATE_FAILSAFE ((_u32)0x1<<SL_NUM_OF_MAXSIZE_BIT)
128 #define SL_FS_CREATE_SECURE ((_u32)0x2<<SL_NUM_OF_MAXSIZE_BIT)
129 #define SL_FS_CREATE_NOSIGNATURE ((_u32)0x4<<SL_NUM_OF_MAXSIZE_BIT)
130 #define SL_FS_CREATE_STATIC_TOKEN ((_u32)0x8<<SL_NUM_OF_MAXSIZE_BIT)
131 #define SL_FS_CREATE_VENDOR_TOKEN ((_u32)0x10<<SL_NUM_OF_MAXSIZE_BIT)
132 #define SL_FS_CREATE_PUBLIC_WRITE ((_u32)0x20<<SL_NUM_OF_MAXSIZE_BIT)
133 #define SL_FS_CREATE_PUBLIC_READ ((_u32)0x40<<SL_NUM_OF_MAXSIZE_BIT)
135 #define SL_FS_CREATE_MAX_SIZE( MaxFileSize ) ((((_u32)MaxFileSize + 255) / 256 ) & SL_FS_OPEN_MAXSIZE_BIT_MASK )
138 #define SL_FS_WRITE_MUST_COMMIT ((_u32)0x80<<SL_NUM_OF_MAXSIZE_BIT)
139 #define SL_FS_WRITE_BUNDLE_FILE ((_u32)0x100<<SL_NUM_OF_MAXSIZE_BIT)
140 #define SL_FS_WRITE_ENCRYPTED ((_u32)0x200<<SL_NUM_OF_MAXSIZE_BIT)
150 SL_FS_CTL_RESTORE = 0,
151 SL_FS_CTL_ROLLBACK = 1,
152 SL_FS_CTL_COMMIT = 2,
153 SL_FS_CTL_RENAME = 3,
154 SL_FS_CTL_GET_STORAGE_INFO = 5,
155 SL_FS_CTL_BUNDLE_ROLLBACK = 6,
156 SL_FS_CTL_BUNDLE_COMMIT = 7
163 SL_FS_BUNDLE_STATE_STOPPED = 0,
164 SL_FS_BUNDLE_STATE_STARTED = 1,
165 SL_FS_BUNDLE_STATE_PENDING_COMMIT = 3
195 SL_FS_FACTORY_RET_TO_IMAGE = 0,
196 SL_FS_FACTORY_RET_TO_DEFAULT = 2
197 }SlFsRetToFactoryOper_e;
222 _u16 DeviceBlockSize;
223 _u16 DeviceBlocksCapacity;
224 _u16 NumOfAllocatedBlocks;
225 _u16 NumOfReservedBlocks;
226 _u16 NumOfReservedBlocksForSystemfiles;
227 _u16 LargestAllocatedGapInBlocks;
228 _u16 NumOfAvailableBlocksForUserFiles;
235 _u8 IsDevlopmentFormatType;
238 _u8 MaxFsFilesReservedForSysFiles;
239 _u8 ActualNumOfUserFiles;
240 _u8 ActualNumOfSysFiles;
243 _u32 NumOfAlertsThreshold;
244 _u16 FATWriteCounter;
262 _u8 OpenedForWriteCnt;
265 _u8 OpenedForWriteCntWithValidFailSafeImage;
266 _u8 OpeneForReadCntWithValidFailSafeImage;
267 _u8 ClosedFilesCntWithValidFailSafeImage;
274 #define SL_FS_MAX_FILE_NAME_LENGTH 180
279 SL_FS_GET_FILE_ATTRIBUTES = 0x1
289 _u32 FileAllocatedBlocks;
373 #if _SL_INCLUDE_FUNC(sl_FsOpen)
374 _i32
sl_FsOpen(
const _u8 *pFileName,
const _u32 AccessModeAndMaxSize,_u32 *pToken);
410 #if _SL_INCLUDE_FUNC(sl_FsClose)
411 _i16
sl_FsClose(
const _i32 FileHdl,
const _u8* pCeritificateFileName,
const _u8* pSignature,
const _u32 SignatureLen);
434 #if _SL_INCLUDE_FUNC(sl_FsRead)
435 _i32
sl_FsRead(
const _i32 FileHdl,_u32 Offset ,_u8* pData,_u32 Len);
458 #if _SL_INCLUDE_FUNC(sl_FsWrite)
459 _i32
sl_FsWrite(
const _i32 FileHdl,_u32 Offset,_u8* pData,_u32 Len);
488 #if _SL_INCLUDE_FUNC(sl_FsGetInfo)
509 #if _SL_INCLUDE_FUNC(sl_FsDel)
510 _i16
sl_FsDel(
const _u8 *pFileName,
const _u32 Token);
632 #if _SL_INCLUDE_FUNC(sl_FsCtl)
633 _i32
sl_FsCtl( SlFsCtl_e Command, _u32 Token, _u8 *pFileName,
const _u8 *pData, _u16 DataLen, _u8 *pOutputData, _u16 OutputDataLen,_u32 *pNewToken );
768 #if _SL_INCLUDE_FUNC(sl_FsProgram)
769 _i32
sl_FsProgram(
const _u8* pData , _u16 Len ,
const _u8 * pKey , _u32 Flags );
855 #if _SL_INCLUDE_FUNC(sl_FsGetFileList)
856 _i32
sl_FsGetFileList(_i32* pIndex, _u8 Count, _u8 MaxEntryLen , _u8* pBuff, SlFileListFlags_t Flags );
_i32 sl_FsOpen(const _u8 *pFileName, const _u32 AccessModeAndMaxSize, _u32 *pToken)
open file for read or write from/to storage device
_i32 sl_FsCtl(SlFsCtl_e Command, _u32 Token, _u8 *pFileName, const _u8 *pData, _u16 DataLen, _u8 *pOutputData, _u16 OutputDataLen, _u32 *pNewToken)
Controls various file system operations.
_i16 sl_FsGetInfo(const _u8 *pFileName, const _u32 Token, SlFsFileInfo_t *pFsFileInfo)
Get information of a file.
_i16 sl_FsClose(const _i32 FileHdl, const _u8 *pCeritificateFileName, const _u8 *pSignature, const _u32 SignatureLen)
Close file in storage device.
_i32 sl_FsProgram(const _u8 *pData, _u16 Len, const _u8 *pKey, _u32 Flags)
Enables to format and configure the device with pre-prepared configuration.
_i16 sl_FsDel(const _u8 *pFileName, const _u32 Token)
Delete specific file from a storage or all files from a storage (format)
_i32 sl_FsGetFileList(_i32 *pIndex, _u8 Count, _u8 MaxEntryLen, _u8 *pBuff, SlFileListFlags_t Flags)
The list of file names, the files are retrieve in chunks.
_i32 sl_FsWrite(const _i32 FileHdl, _u32 Offset, _u8 *pData, _u32 Len)
Write block of data to a file in storage device.
_i32 sl_FsRead(const _i32 FileHdl, _u32 Offset, _u8 *pData, _u32 Len)
Read block of data from a file in storage device.