caffeine-sal 0.1.17
Header-only polymorphic middleware services layer for the Caffeine Framework
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
cfn_sal_utl_fs.h File Reference

Abstract File System service interface. More...

#include "cfn_sal.h"

Go to the source code of this file.

Data Structures

struct  cfn_sal_utl_filesystem_config_t
 
struct  cfn_sal_utl_filesystem_api_s
 File System Virtual Method Table (VMT). More...
 

Macros

#define CFN_SAL_UTL_TYPE_FILESYSTEM   CFN_SAL_TYPE('F', 'S', 'S')
 

Typedefs

typedef void * cfn_sal_utl_filesystem_file_t
 
typedef struct cfn_sal_utl_filesystem_s cfn_sal_utl_filesystem_t
 
typedef struct cfn_sal_utl_filesystem_api_s cfn_sal_utl_filesystem_api_t
 
typedef void(* cfn_sal_utl_filesystem_callback_t) (cfn_sal_utl_filesystem_t *driver, uint32_t event, uint32_t error, void *user_arg)
 

Enumerations

enum  cfn_sal_utl_filesystem_mode_t { CFN_SAL_UTL_FILESYSTEM_MODE_READ = CFN_HAL_BIT(0) , CFN_SAL_UTL_FILESYSTEM_MODE_WRITE = CFN_HAL_BIT(1) , CFN_SAL_UTL_FILESYSTEM_MODE_APPEND = CFN_HAL_BIT(2) , CFN_SAL_UTL_FILESYSTEM_MODE_CREATE = CFN_HAL_BIT(3) }
 
enum  cfn_sal_utl_filesystem_seek_origin_t { CFN_SAL_UTL_FILESYSTEM_SEEK_SET , CFN_SAL_UTL_FILESYSTEM_SEEK_CUR , CFN_SAL_UTL_FILESYSTEM_SEEK_END }
 

Functions

 CFN_HAL_VMT_CHECK (struct cfn_sal_utl_filesystem_api_s)
 
 CFN_SAL_CREATE_DRIVER_TYPE (sal_utl_filesystem, cfn_sal_utl_filesystem_config_t, cfn_sal_utl_filesystem_api_t, cfn_sal_phy_t, cfn_sal_utl_filesystem_callback_t)
 
CFN_HAL_INLINE void cfn_sal_utl_filesystem_populate (cfn_sal_utl_filesystem_t *driver, uint32_t peripheral_id, void *dependency, const cfn_sal_utl_filesystem_api_t *api, const cfn_sal_phy_t *phy, const cfn_sal_utl_filesystem_config_t *config, cfn_sal_utl_filesystem_callback_t callback, void *user_arg)
 
cfn_hal_error_code_t cfn_sal_utl_filesystem_construct (cfn_sal_utl_filesystem_t *driver, const cfn_sal_utl_filesystem_config_t *config, const cfn_sal_phy_t *phy, void *dependency, cfn_sal_utl_filesystem_callback_t callback, void *user_arg)
 
cfn_hal_error_code_t cfn_sal_utl_filesystem_destruct (cfn_sal_utl_filesystem_t *driver)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_init (cfn_sal_utl_filesystem_t *driver)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_deinit (cfn_sal_utl_filesystem_t *driver)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_config_set (cfn_sal_utl_filesystem_t *driver, const cfn_sal_utl_filesystem_config_t *config)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_config_get (cfn_sal_utl_filesystem_t *driver, cfn_sal_utl_filesystem_config_t *config)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_callback_register (cfn_sal_utl_filesystem_t *driver, cfn_sal_utl_filesystem_callback_t callback, void *user_arg)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_power_state_set (cfn_sal_utl_filesystem_t *driver, cfn_hal_power_state_t state)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_event_enable (cfn_sal_utl_filesystem_t *driver, uint32_t event_mask)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_event_disable (cfn_sal_utl_filesystem_t *driver, uint32_t event_mask)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_event_get (cfn_sal_utl_filesystem_t *driver, uint32_t *event_mask)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_error_enable (cfn_sal_utl_filesystem_t *driver, uint32_t error_mask)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_error_disable (cfn_sal_utl_filesystem_t *driver, uint32_t error_mask)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_error_get (cfn_sal_utl_filesystem_t *driver, uint32_t *error_mask)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_mount (cfn_sal_utl_filesystem_t *driver)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_unmount (cfn_sal_utl_filesystem_t *driver)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_open (cfn_sal_utl_filesystem_t *driver, cfn_sal_utl_filesystem_file_t *file, const char *path, uint32_t mode)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_close (cfn_sal_utl_filesystem_t *driver, cfn_sal_utl_filesystem_file_t file)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_read (cfn_sal_utl_filesystem_t *driver, cfn_sal_utl_filesystem_file_t file, uint8_t *buffer, size_t len, size_t *read_len)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_write (cfn_sal_utl_filesystem_t *driver, cfn_sal_utl_filesystem_file_t file, const uint8_t *data, size_t len, size_t *written_len)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_format (cfn_sal_utl_filesystem_t *driver)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_seek (cfn_sal_utl_filesystem_t *driver, cfn_sal_utl_filesystem_file_t file, uint32_t offset, cfn_sal_utl_filesystem_seek_origin_t origin)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_tell (cfn_sal_utl_filesystem_t *driver, cfn_sal_utl_filesystem_file_t file, uint32_t *offset_out)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_eof (cfn_sal_utl_filesystem_t *driver, cfn_sal_utl_filesystem_file_t file, bool *is_eof)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_remove (cfn_sal_utl_filesystem_t *driver, const char *path)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_rename (cfn_sal_utl_filesystem_t *driver, const char *old_path, const char *new_path)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_mkdir (cfn_sal_utl_filesystem_t *driver, const char *path)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_rmdir (cfn_sal_utl_filesystem_t *driver, const char *path)
 
CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_stat (cfn_sal_utl_filesystem_t *driver, const char *path, void *stat_out)
 

Detailed Description

Abstract File System service interface.

Macro Definition Documentation

◆ CFN_SAL_UTL_TYPE_FILESYSTEM

#define CFN_SAL_UTL_TYPE_FILESYSTEM   CFN_SAL_TYPE('F', 'S', 'S')

Typedef Documentation

◆ cfn_sal_utl_filesystem_api_t

◆ cfn_sal_utl_filesystem_callback_t

typedef void(* cfn_sal_utl_filesystem_callback_t) (cfn_sal_utl_filesystem_t *driver, uint32_t event, uint32_t error, void *user_arg)

◆ cfn_sal_utl_filesystem_file_t

◆ cfn_sal_utl_filesystem_t

typedef struct cfn_sal_utl_filesystem_s cfn_sal_utl_filesystem_t

Enumeration Type Documentation

◆ cfn_sal_utl_filesystem_mode_t

Enumerator
CFN_SAL_UTL_FILESYSTEM_MODE_READ 
CFN_SAL_UTL_FILESYSTEM_MODE_WRITE 
CFN_SAL_UTL_FILESYSTEM_MODE_APPEND 
CFN_SAL_UTL_FILESYSTEM_MODE_CREATE 

◆ cfn_sal_utl_filesystem_seek_origin_t

Enumerator
CFN_SAL_UTL_FILESYSTEM_SEEK_SET 

Seek from the start of the file

CFN_SAL_UTL_FILESYSTEM_SEEK_CUR 

Seek from the current position

CFN_SAL_UTL_FILESYSTEM_SEEK_END 

Seek from the end of the file

Function Documentation

◆ CFN_HAL_VMT_CHECK()

CFN_HAL_VMT_CHECK ( struct cfn_sal_utl_filesystem_api_s  )

◆ CFN_SAL_CREATE_DRIVER_TYPE()

CFN_SAL_CREATE_DRIVER_TYPE ( sal_utl_filesystem  ,
cfn_sal_utl_filesystem_config_t  ,
cfn_sal_utl_filesystem_api_t  ,
cfn_sal_phy_t  ,
cfn_sal_utl_filesystem_callback_t   
)

◆ cfn_sal_utl_filesystem_callback_register()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_callback_register ( cfn_sal_utl_filesystem_t driver,
cfn_sal_utl_filesystem_callback_t  callback,
void *  user_arg 
)

◆ cfn_sal_utl_filesystem_close()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_close ( cfn_sal_utl_filesystem_t driver,
cfn_sal_utl_filesystem_file_t  file 
)

◆ cfn_sal_utl_filesystem_config_get()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_config_get ( cfn_sal_utl_filesystem_t driver,
cfn_sal_utl_filesystem_config_t config 
)

◆ cfn_sal_utl_filesystem_config_set()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_config_set ( cfn_sal_utl_filesystem_t driver,
const cfn_sal_utl_filesystem_config_t config 
)

◆ cfn_sal_utl_filesystem_construct()

cfn_hal_error_code_t cfn_sal_utl_filesystem_construct ( cfn_sal_utl_filesystem_t driver,
const cfn_sal_utl_filesystem_config_t config,
const cfn_sal_phy_t phy,
void *  dependency,
cfn_sal_utl_filesystem_callback_t  callback,
void *  user_arg 
)

◆ cfn_sal_utl_filesystem_deinit()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_deinit ( cfn_sal_utl_filesystem_t driver)

◆ cfn_sal_utl_filesystem_destruct()

cfn_hal_error_code_t cfn_sal_utl_filesystem_destruct ( cfn_sal_utl_filesystem_t driver)

◆ cfn_sal_utl_filesystem_eof()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_eof ( cfn_sal_utl_filesystem_t driver,
cfn_sal_utl_filesystem_file_t  file,
bool *  is_eof 
)

◆ cfn_sal_utl_filesystem_error_disable()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_error_disable ( cfn_sal_utl_filesystem_t driver,
uint32_t  error_mask 
)

◆ cfn_sal_utl_filesystem_error_enable()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_error_enable ( cfn_sal_utl_filesystem_t driver,
uint32_t  error_mask 
)

◆ cfn_sal_utl_filesystem_error_get()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_error_get ( cfn_sal_utl_filesystem_t driver,
uint32_t *  error_mask 
)

◆ cfn_sal_utl_filesystem_event_disable()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_event_disable ( cfn_sal_utl_filesystem_t driver,
uint32_t  event_mask 
)

◆ cfn_sal_utl_filesystem_event_enable()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_event_enable ( cfn_sal_utl_filesystem_t driver,
uint32_t  event_mask 
)

◆ cfn_sal_utl_filesystem_event_get()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_event_get ( cfn_sal_utl_filesystem_t driver,
uint32_t *  event_mask 
)

◆ cfn_sal_utl_filesystem_format()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_format ( cfn_sal_utl_filesystem_t driver)

◆ cfn_sal_utl_filesystem_init()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_init ( cfn_sal_utl_filesystem_t driver)

◆ cfn_sal_utl_filesystem_mkdir()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_mkdir ( cfn_sal_utl_filesystem_t driver,
const char *  path 
)

◆ cfn_sal_utl_filesystem_mount()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_mount ( cfn_sal_utl_filesystem_t driver)

◆ cfn_sal_utl_filesystem_open()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_open ( cfn_sal_utl_filesystem_t driver,
cfn_sal_utl_filesystem_file_t file,
const char *  path,
uint32_t  mode 
)

◆ cfn_sal_utl_filesystem_populate()

CFN_HAL_INLINE void cfn_sal_utl_filesystem_populate ( cfn_sal_utl_filesystem_t driver,
uint32_t  peripheral_id,
void *  dependency,
const cfn_sal_utl_filesystem_api_t api,
const cfn_sal_phy_t phy,
const cfn_sal_utl_filesystem_config_t config,
cfn_sal_utl_filesystem_callback_t  callback,
void *  user_arg 
)

◆ cfn_sal_utl_filesystem_power_state_set()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_power_state_set ( cfn_sal_utl_filesystem_t driver,
cfn_hal_power_state_t  state 
)

◆ cfn_sal_utl_filesystem_read()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_read ( cfn_sal_utl_filesystem_t driver,
cfn_sal_utl_filesystem_file_t  file,
uint8_t *  buffer,
size_t  len,
size_t *  read_len 
)

◆ cfn_sal_utl_filesystem_remove()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_remove ( cfn_sal_utl_filesystem_t driver,
const char *  path 
)

◆ cfn_sal_utl_filesystem_rename()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_rename ( cfn_sal_utl_filesystem_t driver,
const char *  old_path,
const char *  new_path 
)

◆ cfn_sal_utl_filesystem_rmdir()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_rmdir ( cfn_sal_utl_filesystem_t driver,
const char *  path 
)

◆ cfn_sal_utl_filesystem_seek()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_seek ( cfn_sal_utl_filesystem_t driver,
cfn_sal_utl_filesystem_file_t  file,
uint32_t  offset,
cfn_sal_utl_filesystem_seek_origin_t  origin 
)

◆ cfn_sal_utl_filesystem_stat()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_stat ( cfn_sal_utl_filesystem_t driver,
const char *  path,
void *  stat_out 
)

◆ cfn_sal_utl_filesystem_tell()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_tell ( cfn_sal_utl_filesystem_t driver,
cfn_sal_utl_filesystem_file_t  file,
uint32_t *  offset_out 
)

◆ cfn_sal_utl_filesystem_unmount()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_unmount ( cfn_sal_utl_filesystem_t driver)

◆ cfn_sal_utl_filesystem_write()

CFN_HAL_INLINE cfn_hal_error_code_t cfn_sal_utl_filesystem_write ( cfn_sal_utl_filesystem_t driver,
cfn_sal_utl_filesystem_file_t  file,
const uint8_t *  data,
size_t  len,
size_t *  written_len 
)