Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Macros | Typedefs | Functions
WSF_EFS_API

Data Structures

struct  wsfEsfAttributes_t
 File attributes data type. More...
 
struct  wsfEfsControl_t
 File control block data type. More...
 
struct  wsfEfsFileInfo_t
 File Listing Information. More...
 
struct  wsfEfsMedia_t
 Media Control data type. More...
 

Macros

#define WSF_EFS_MAX_FILES   6
 Max Number of Files and Media. More...
 
#define WSF_EFS_MAX_MEDIA   4
 Max Number of Media. More...
 
#define WSF_EFS_FILE_OFFSET_ANY   0xFFFFFFFF
 Offset to WsfEfsAddFile indicating any file offset can be used. More...
 
#define WSF_EFS_NAME_LEN   16
 File name length in bytes. More...
 
#define WSF_EFS_VERSION_LEN   16
 File version length in bytes. More...
 
#define WSF_EFS_USER_CMD   0x80
 Media Specific Command Identifiers reserved for applications begin at 0x80. More...
 

Typedefs

typedef uint16_t wsfEfsHandle_t
 File handle data type. More...
 
typedef uint8_t wsfMediaInitFunc_t(void)
 Media Init function, called when media is registered. More...
 
typedef uint8_t wsfMediaEraseFunc_t(uint8_t *pAddress, uint32_t size)
 Media Erase function. More...
 
typedef uint8_t wsfMediaReadFunc_t(uint8_t *pBuf, uint8_t *pAddress, uint32_t size)
 Media Read function. More...
 
typedef uint8_t wsfMediaWriteFunc_t(const uint8_t *pBuf, uint8_t *pAddress, uint32_t size)
 Media Write function. More...
 
typedef uint8_t wsfMediaHandleCmdFunc_t(uint8_t cmd, uint32_t param)
 Media Specific Command handler. More...
 
typedef const wsfEfsMedia_tpWsfEfsMedia_t
 Pointer to Media Control data type. More...
 

Functions

void WsfEfsInit (void)
 Initialise the embedded file system. More...
 
wsfEfsHandle_t WsfEfsAddFile (uint32_t maxSize, uint8_t media, wsfEsfAttributes_t *pAttr, uint32_t offset)
 Create a file in the embedded file system. More...
 
uint8_t WsfEfsRemoveFile (wsfEfsHandle_t handle)
 Deletes a file in the embedded file system. More...
 
uint8_t WsfEfsErase (wsfEfsHandle_t handle)
 Clears the contents of a file without deleting the file. More...
 
uint8_t WsfEfsGetAttributes (wsfEfsHandle_t handle, wsfEsfAttributes_t *pAttr)
 Gets the attributes of a file. More...
 
uint8_t WsfEfsSetAttributes (wsfEfsHandle_t handle, wsfEsfAttributes_t *pInfo)
 Updates the attributes of a file. More...
 
uint16_t WsfEfsGet (wsfEfsHandle_t handle, uint32_t offset, uint8_t *pBuffer, uint16_t len)
 Copies data from a file. More...
 
uint16_t WsfEfsPut (wsfEfsHandle_t handle, uint32_t offset, const uint8_t *pBuffer, uint16_t len)
 Writes data to a file. More...
 
uint8_t WsfEfsRegisterMedia (const wsfEfsMedia_t *pMediaCtrl, uint8_t mediaID)
 Registers a File Storage Medium with the Embedded File System. More...
 
wsfEfsControl_tWsfEfsGetFileByHandle (wsfEfsHandle_t handle)
 Returns the file control block for the given handle. More...
 
char * WsfEfsGetFileName (wsfEfsHandle_t handle)
 Get the name of a file. More...
 
char * WsfEfsGetFileVersion (wsfEfsHandle_t handle)
 Get the version of a file. More...
 
uint32_t WsfEfsGetFileSize (wsfEfsHandle_t handle)
 Get the size of a file. More...
 
uint32_t WsfEfsGetFileMaxSize (wsfEfsHandle_t handle)
 Get the number of bytes of memory reserved for use by a file. More...
 
uint8_t WsfEfsGetFileType (wsfEfsHandle_t handle)
 Get the type of a file. More...
 
uint16_t WsfEfsGetFilePermissions (wsfEfsHandle_t handle)
 Get the permissions of a file. More...
 
uint8_t WsfEfsMediaSpecificCommand (wsfEfsHandle_t handle, uint8_t cmd, uint32_t param)
 Execute a media specific command on a file. More...
 

Status Codes

#define WSF_EFS_SUCCESS   0
 Success. More...
 
#define WSF_EFS_FAILURE   1
 Failure. More...
 
#define WSF_EFS_GET_FAILED   0xFFFF
 Get operation failure. More...
 
#define WSF_EFS_PUT_FAILED   0xFFFF
 PUT operation failure. More...
 

Invalid Parameter Identifiers

#define WSF_EFS_INVALID_HANDLE   0xFFFF
 Invalid Handle. More...
 
#define WSF_EFS_INVALID_OFFSET   0xFFFFFFFF
 Invalid Offset. More...
 
#define WSF_EFS_INVALID_SIZE   0xFFFFFFFF
 Invalid Size. More...
 
#define WSF_EFS_INVALID_MEDIA   0xFF
 Invalid Media. More...
 

File Types

#define WSF_EFS_FILE_TYPE_BULK   0
 Bulk File Type. More...
 
#define WSF_EFS_FILE_TYPE_STREAM   1
 Stream File Type. More...
 

File Permissions

#define WSF_EFS_REMOTE_PERMISSIONS_MASK   0xFF
 Remote Permissions. More...
 
#define WSF_EFS_REMOTE_GET_PERMITTED   0x01
 Remote Get Permitted. More...
 
#define WSF_EFS_REMOTE_PUT_PERMITTED   0x02
 Remote Put Permitted. More...
 
#define WSF_EFS_REMOTE_ERASE_PERMITTED   0x04
 Remote Erase Permitted. More...
 
#define WSF_EFS_REMOTE_VERIFY_PERMITTED   0x08
 Remote Verify Permitted. More...
 
#define WSF_EFS_LOCAL_GET_PERMITTED   0x0100
 Local Get Permitted. More...
 
#define WSF_EFS_LOCAL_PUT_PERMITTED   0x0200
 Local Put Permitted. More...
 
#define WSF_EFS_LOCAL_ERASE_PERMITTED   0x0400
 Local Erase Permitted. More...
 
#define WSF_EFS_REMOTE_VISIBLE   0x0800
 File Visible via Remote WDXS. More...
 

Standard Media Specific Command Identifiers

#define WSF_EFS_WDXS_PUT_COMPLETE_CMD   0x00
 Put Complete. More...
 
#define WSF_EFS_VALIDATE_CMD   0x01
 Validate Req for the file. More...
 

Detailed Description

Macro Definition Documentation

#define WSF_EFS_FAILURE   1

Failure.

Definition at line 54 of file wsf_efs.h.

#define WSF_EFS_FILE_OFFSET_ANY   0xFFFFFFFF

Offset to WsfEfsAddFile indicating any file offset can be used.

Definition at line 79 of file wsf_efs.h.

#define WSF_EFS_FILE_TYPE_BULK   0

Bulk File Type.

Definition at line 74 of file wsf_efs.h.

#define WSF_EFS_FILE_TYPE_STREAM   1

Stream File Type.

Definition at line 75 of file wsf_efs.h.

#define WSF_EFS_GET_FAILED   0xFFFF

Get operation failure.

Definition at line 55 of file wsf_efs.h.

#define WSF_EFS_INVALID_HANDLE   0xFFFF

Invalid Handle.

Definition at line 64 of file wsf_efs.h.

#define WSF_EFS_INVALID_MEDIA   0xFF

Invalid Media.

Definition at line 67 of file wsf_efs.h.

#define WSF_EFS_INVALID_OFFSET   0xFFFFFFFF

Invalid Offset.

Definition at line 65 of file wsf_efs.h.

#define WSF_EFS_INVALID_SIZE   0xFFFFFFFF

Invalid Size.

Definition at line 66 of file wsf_efs.h.

#define WSF_EFS_LOCAL_ERASE_PERMITTED   0x0400

Local Erase Permitted.

Definition at line 92 of file wsf_efs.h.

#define WSF_EFS_LOCAL_GET_PERMITTED   0x0100

Local Get Permitted.

Definition at line 90 of file wsf_efs.h.

#define WSF_EFS_LOCAL_PUT_PERMITTED   0x0200

Local Put Permitted.

Definition at line 91 of file wsf_efs.h.

#define WSF_EFS_MAX_FILES   6

Max Number of Files and Media.

Definition at line 41 of file wsf_efs.h.

#define WSF_EFS_MAX_MEDIA   4

Max Number of Media.

Definition at line 46 of file wsf_efs.h.

#define WSF_EFS_NAME_LEN   16

File name length in bytes.

Definition at line 97 of file wsf_efs.h.

#define WSF_EFS_PUT_FAILED   0xFFFF

PUT operation failure.

Definition at line 56 of file wsf_efs.h.

#define WSF_EFS_REMOTE_ERASE_PERMITTED   0x04

Remote Erase Permitted.

Definition at line 88 of file wsf_efs.h.

#define WSF_EFS_REMOTE_GET_PERMITTED   0x01

Remote Get Permitted.

Definition at line 86 of file wsf_efs.h.

#define WSF_EFS_REMOTE_PERMISSIONS_MASK   0xFF

Remote Permissions.

Definition at line 85 of file wsf_efs.h.

#define WSF_EFS_REMOTE_PUT_PERMITTED   0x02

Remote Put Permitted.

Definition at line 87 of file wsf_efs.h.

#define WSF_EFS_REMOTE_VERIFY_PERMITTED   0x08

Remote Verify Permitted.

Definition at line 89 of file wsf_efs.h.

#define WSF_EFS_REMOTE_VISIBLE   0x0800

File Visible via Remote WDXS.

Definition at line 93 of file wsf_efs.h.

#define WSF_EFS_SUCCESS   0

Success.

Definition at line 53 of file wsf_efs.h.

#define WSF_EFS_USER_CMD   0x80

Media Specific Command Identifiers reserved for applications begin at 0x80.

Definition at line 111 of file wsf_efs.h.

#define WSF_EFS_VALIDATE_CMD   0x01

Validate Req for the file.

Definition at line 107 of file wsf_efs.h.

#define WSF_EFS_VERSION_LEN   16

File version length in bytes.

Definition at line 100 of file wsf_efs.h.

#define WSF_EFS_WDXS_PUT_COMPLETE_CMD   0x00

Put Complete.

Definition at line 106 of file wsf_efs.h.

Typedef Documentation

typedef const wsfEfsMedia_t* pWsfEfsMedia_t

Pointer to Media Control data type.

Definition at line 220 of file wsf_efs.h.

typedef uint16_t wsfEfsHandle_t

File handle data type.

Definition at line 118 of file wsf_efs.h.

typedef uint8_t wsfMediaEraseFunc_t(uint8_t *pAddress, uint32_t size)

Media Erase function.

Parameters
pAddressAddress in media to start erasing.
sizeNumber of bytes to erase.
Returns
Status of the operation.

Definition at line 166 of file wsf_efs.h.

typedef uint8_t wsfMediaHandleCmdFunc_t(uint8_t cmd, uint32_t param)

Media Specific Command handler.

Parameters
cmdIdentifier of the media specific command.
paramOptional Parameter to the command.
Returns
Status of the operation.

Definition at line 204 of file wsf_efs.h.

typedef uint8_t wsfMediaInitFunc_t(void)

Media Init function, called when media is registered.

Returns
Status of the operation.

Definition at line 154 of file wsf_efs.h.

typedef uint8_t wsfMediaReadFunc_t(uint8_t *pBuf, uint8_t *pAddress, uint32_t size)

Media Read function.

Parameters
pBufBuffer to hold data.
pAddressAddress in media to read from.
sizeSize of pBuf in bytes.
Returns
Status of the operation.

Definition at line 179 of file wsf_efs.h.

typedef uint8_t wsfMediaWriteFunc_t(const uint8_t *pBuf, uint8_t *pAddress, uint32_t size)

Media Write function.

Parameters
pBufBuffer with data to be written.
pAddressAddress in media to write to.
sizeSize of pBuf in bytes.
Returns
Status of the operation.

Definition at line 192 of file wsf_efs.h.

Function Documentation

wsfEfsHandle_t WsfEfsAddFile ( uint32_t  maxSize,
uint8_t  media,
wsfEsfAttributes_t pAttr,
uint32_t  offset 
)

Create a file in the embedded file system.

Parameters
maxSizeMax length in bytes of of the file.
mediaIdentifier of the media where the file is stored.
pAttrAttributes of the file
offsetOffset address of the file in the memory space.
Returns
File Handle, or WSF_EFS_INVALID_HANDLE.
uint8_t WsfEfsErase ( wsfEfsHandle_t  handle)

Clears the contents of a file without deleting the file.

Parameters
handleHandle identifying the file.
Returns
WSF_EFS_SUCCESS or WSF_EFS_FAILURE.
uint16_t WsfEfsGet ( wsfEfsHandle_t  handle,
uint32_t  offset,
uint8_t *  pBuffer,
uint16_t  len 
)

Copies data from a file.

Parameters
handleHandle identifying the file.
offsetOffset into the file to begin copying from.
pBufferLocation to copy the data to.
lenNumber of bytes to copy into pBuffer.
Returns
The number of bytes read from the file
uint8_t WsfEfsGetAttributes ( wsfEfsHandle_t  handle,
wsfEsfAttributes_t pAttr 
)

Gets the attributes of a file.

Parameters
handleHandle identifying the file.
pAttrPointer to memory to store the attributes.
Returns
WSF_EFS_SUCCESS or WSF_EFS_FAILURE.
wsfEfsControl_t* WsfEfsGetFileByHandle ( wsfEfsHandle_t  handle)

Returns the file control block for the given handle.

Parameters
handleHandle of the file
Returns
File control block, or NULL.
uint32_t WsfEfsGetFileMaxSize ( wsfEfsHandle_t  handle)

Get the number of bytes of memory reserved for use by a file.

Parameters
handleFile Handle.
Returns
Max size of the file.
char* WsfEfsGetFileName ( wsfEfsHandle_t  handle)

Get the name of a file.

Parameters
handleFile Handle.
Returns
Filename string of a file.
uint16_t WsfEfsGetFilePermissions ( wsfEfsHandle_t  handle)

Get the permissions of a file.

Parameters
handleFile Handle.
Returns
Permissions of the file.
uint32_t WsfEfsGetFileSize ( wsfEfsHandle_t  handle)

Get the size of a file.

Parameters
handleFile Handle.
Returns
Size of the file.
uint8_t WsfEfsGetFileType ( wsfEfsHandle_t  handle)

Get the type of a file.

Parameters
handleFile Handle.
Returns
Type of file (bulk or stream).
char* WsfEfsGetFileVersion ( wsfEfsHandle_t  handle)

Get the version of a file.

Parameters
handleFile Handle.
Returns
Version string of a file.
void WsfEfsInit ( void  )

Initialise the embedded file system.

Returns
none.
uint8_t WsfEfsMediaSpecificCommand ( wsfEfsHandle_t  handle,
uint8_t  cmd,
uint32_t  param 
)

Execute a media specific command on a file.

Parameters
handleFile Handle.
cmdMedia specific command identifier.
paramCommand specific parameter.
Returns
Status of the operation.
uint16_t WsfEfsPut ( wsfEfsHandle_t  handle,
uint32_t  offset,
const uint8_t *  pBuffer,
uint16_t  len 
)

Writes data to a file.

Parameters
handleHandle identifying the file.
offsetOffset into the file to begin writing to.
pBufferData to write to the file.
lenNumber of bytes to write to the file.
Returns
The number of bytes written to the file
uint8_t WsfEfsRegisterMedia ( const wsfEfsMedia_t pMediaCtrl,
uint8_t  mediaID 
)

Registers a File Storage Medium with the Embedded File System.

Parameters
pMediaCtrlPointer to the media control structure.
mediaIDUser specified identifier of the media.
Returns
WSF_EFS_SUCCESS or WSF_EFS_FAILURE.
uint8_t WsfEfsRemoveFile ( wsfEfsHandle_t  handle)

Deletes a file in the embedded file system.

Parameters
handleHandle identifying the file.
Returns
WSF_EFS_SUCCESS or WSF_EFS_FAILURE.
uint8_t WsfEfsSetAttributes ( wsfEfsHandle_t  handle,
wsfEsfAttributes_t pInfo 
)

Updates the attributes of a file.

Parameters
handleHandle identifying the file.
pInfoPointer to memory to with the updated attributes.
Returns
WSF_EFS_SUCCESS or WSF_EFS_FAILURE.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.