42 #include <ti/drivers/net/wifi/simplelink.h> 71 #define SL_FS_OPEN_MODE_BIT_MASK (0xF8000000) 72 #define SL_NUM_OF_MODE_BIT (5) 74 #define SL_FS_OPEN_FLAGS_BIT_MASK (0x07FE0000) 75 #define SL_NUM_OF_FLAGS_BIT (10) 77 #define SL_FS_OPEN_MAXSIZE_BIT_MASK (0x1FFFF) 78 #define SL_NUM_OF_MAXSIZE_BIT (17) 86 #define SL_FS_INFO_OPEN_WRITE 0x1000 87 #define SL_FS_INFO_OPEN_READ 0x800 89 #define SL_FS_INFO_MUST_COMMIT 0x1 90 #define SL_FS_INFO_BUNDLE_FILE 0x2 92 #define SL_FS_INFO_PENDING_COMMIT 0x4 93 #define SL_FS_INFO_PENDING_BUNDLE_COMMIT 0x8 95 #define SL_FS_INFO_NOT_FAILSAFE 0x20 96 #define SL_FS_INFO_NOT_VALID 0x100 97 #define SL_FS_INFO_SYS_FILE 0x40 98 #define SL_FS_INFO_SECURE 0x10 99 #define SL_FS_INFO_NOSIGNATURE 0x2000 100 #define SL_FS_INFO_PUBLIC_WRITE 0x200 101 #define SL_FS_INFO_PUBLIC_READ 0x400 110 #define SL_FS_CREATE ((_u32)0x1<<(SL_NUM_OF_MAXSIZE_BIT+SL_NUM_OF_FLAGS_BIT)) 111 #define SL_FS_WRITE ((_u32)0x2<<(SL_NUM_OF_MAXSIZE_BIT+SL_NUM_OF_FLAGS_BIT)) 112 #define SL_FS_OVERWRITE ((_u32)0x4<<(SL_NUM_OF_MAXSIZE_BIT+SL_NUM_OF_FLAGS_BIT)) 113 #define SL_FS_READ ((_u32)0x8<<(SL_NUM_OF_MAXSIZE_BIT+SL_NUM_OF_FLAGS_BIT)) 115 #define SL_FS_CREATE_FAILSAFE ((_u32)0x1<<SL_NUM_OF_MAXSIZE_BIT) 116 #define SL_FS_CREATE_SECURE ((_u32)0x2<<SL_NUM_OF_MAXSIZE_BIT) 117 #define SL_FS_CREATE_NOSIGNATURE ((_u32)0x4<<SL_NUM_OF_MAXSIZE_BIT) 118 #define SL_FS_CREATE_STATIC_TOKEN ((_u32)0x8<<SL_NUM_OF_MAXSIZE_BIT) 119 #define SL_FS_CREATE_VENDOR_TOKEN ((_u32)0x10<<SL_NUM_OF_MAXSIZE_BIT) 120 #define SL_FS_CREATE_PUBLIC_WRITE ((_u32)0x20<<SL_NUM_OF_MAXSIZE_BIT) 121 #define SL_FS_CREATE_PUBLIC_READ ((_u32)0x40<<SL_NUM_OF_MAXSIZE_BIT) 123 #define SL_FS_CREATE_MAX_SIZE( MaxFileSize ) ((((_u32)MaxFileSize + 255) / 256 ) & SL_FS_OPEN_MAXSIZE_BIT_MASK ) 126 #define SL_FS_WRITE_MUST_COMMIT ((_u32)0x80<<SL_NUM_OF_MAXSIZE_BIT) 127 #define SL_FS_WRITE_BUNDLE_FILE ((_u32)0x100<<SL_NUM_OF_MAXSIZE_BIT) 128 #define SL_FS_WRITE_ENCRYPTED ((_u32)0x200<<SL_NUM_OF_MAXSIZE_BIT) 136 SL_FS_TOKEN_MASTER = 0,
137 SL_FS_TOKEN_WRITE_READ = 1,
138 SL_FS_TOKEN_WRITE_ONLY = 2,
139 SL_FS_TOKEN_READ_ONLY = 3
159 SL_FS_CTL_RESTORE = 0,
160 SL_FS_CTL_ROLLBACK = 1,
161 SL_FS_CTL_COMMIT = 2,
162 SL_FS_CTL_RENAME = 3,
163 SL_FS_CTL_GET_STORAGE_INFO = 5,
164 SL_FS_CTL_BUNDLE_ROLLBACK = 6,
165 SL_FS_CTL_BUNDLE_COMMIT = 7
170 SL_FS_BUNDLE_STATE_STOPPED = 0,
171 SL_FS_BUNDLE_STATE_STARTED = 1,
172 SL_FS_BUNDLE_STATE_PENDING_COMMIT = 3
196 SL_FS_FACTORY_RET_TO_IMAGE = 0,
197 SL_FS_FACTORY_RET_TO_DEFAULT = 2
198 }SlFsRetToFactoryOper_e;
215 _u16 DeviceBlockSize;
216 _u16 DeviceBlocksCapacity;
217 _u16 NumOfAllocatedBlocks;
218 _u16 NumOfReservedBlocks;
219 _u16 NumOfReservedBlocksForSystemfiles;
220 _u16 LargestAllocatedGapInBlocks;
221 _u16 NumOfAvailableBlocksForUserFiles;
228 _u8 IsDevlopmentFormatType;
231 _u8 MaxFsFilesReservedForSysFiles;
232 _u8 ActualNumOfUserFiles;
233 _u8 ActualNumOfSysFiles;
236 _u32 NumOfAlertsThreshold;
237 _u16 FATWriteCounter;
251 _u8 OpenedForWriteCnt;
254 _u8 OpenedForWriteCntWithValidFailSafeImage;
255 _u8 OpeneForReadCntWithValidFailSafeImage;
256 _u8 ClosedFilesCntWithValidFailSafeImage;
261 #define SL_FS_MAX_FILE_NAME_LENGTH 180 265 SL_FS_GET_FILE_ATTRIBUTES = 0x1
275 _u32 FileAllocatedBlocks;
358 #if _SL_INCLUDE_FUNC(sl_FsOpen) 359 _i32
sl_FsOpen(
const _u8 *pFileName,
const _u32 AccessModeAndMaxSize,_u32 *pToken);
393 #if _SL_INCLUDE_FUNC(sl_FsClose) 394 _i16
sl_FsClose(
const _i32 FileHdl,
const _u8* pCeritificateFileName,
const _u8* pSignature,
const _u32 SignatureLen);
417 #if _SL_INCLUDE_FUNC(sl_FsRead) 418 _i32
sl_FsRead(
const _i32 FileHdl,_u32 Offset ,_u8* pData,_u32 Len);
441 #if _SL_INCLUDE_FUNC(sl_FsWrite) 442 _i32
sl_FsWrite(
const _i32 FileHdl,_u32 Offset,_u8* pData,_u32 Len);
471 #if _SL_INCLUDE_FUNC(sl_FsGetInfo) 492 #if _SL_INCLUDE_FUNC(sl_FsDel) 493 _i16
sl_FsDel(
const _u8 *pFileName,
const _u32 Token);
614 #if _SL_INCLUDE_FUNC(sl_FsCtl) 615 _i32
sl_FsCtl( SlFsCtl_e Command, _u32 Token, _u8 *pFileName,
const _u8 *pData, _u16 DataLen, _u8 *pOutputData, _u16 OutputDataLen,_u32 *pNewToken );
747 #if _SL_INCLUDE_FUNC(sl_FsProgram) 748 _i32
sl_FsProgram(
const _u8* pData , _u16 Len ,
const _u8 * pKey , _u32 Flags );
834 #if _SL_INCLUDE_FUNC(sl_FsGetFileList) 835 _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.