Virgil IoT KIT
|
Storage HAL interface. More...
Go to the source code of this file.
Data Structures | |
struct | vs_storage_impl_func_t |
Storage implementation. More... | |
struct | vs_storage_op_ctx_t |
Storage element context. More... | |
Macros | |
#define | VS_STORAGE_ELEMENT_ID_MAX (32) |
Functions | |
vs_status_e | vs_impl_own_firmware_descriptor (void *descriptor) |
Load currently executed firmware descriptor. More... | |
Storage HAL interface.
Storage is the base helper for communication with file system. Cache mechanism can be used.
Storage context vs_storage_op_ctx_t has storage specific data and calls implementation.
Implementation has members listed below :
#define VS_STORAGE_ELEMENT_ID_MAX (32) |
typedef vs_status_e(* vs_rpi_storage_sync_t) (const vs_storage_impl_data_ctx_t storage_ctx, const vs_storage_file_t file) |
Synchronise storage element.
Synchronizes storage element cache with storage.
[in] | storage_ctx | Storage context. Cannot be NULL. |
[in] | file | Storage file context. |
typedef vs_status_e(* vs_storage_close_hal_t) (const vs_storage_impl_data_ctx_t storage_ctx, vs_storage_file_t file) |
Close storage element.
[in] | storage_ctx | Storage context. Cannot be NULL. |
[in] | file | Storage file context. |
typedef vs_status_e(* vs_storage_deinit_hal_t) (vs_storage_impl_data_ctx_t storage_ctx) |
Destroy storage context.
This function is called during current storage context destruction. After this call storage_ctx is rendered unavailable and must be zeroed.
[in] | storage_ctx | Storage context. Cannot be NULL. |
typedef vs_status_e(* vs_storage_del_hal_t) (const vs_storage_impl_data_ctx_t storage_ctx, const vs_storage_element_id_t id) |
Delete storage element.
[in] | storage_ctx | Storage context. Cannot be NULL. |
[in] | id | Storage element identifier. |
typedef uint8_t vs_storage_element_id_t[VS_STORAGE_ELEMENT_ID_MAX] |
typedef ssize_t(* vs_storage_file_size_hal_t) (const vs_storage_impl_data_ctx_t storage_ctx, const vs_storage_element_id_t id) |
Get storage element size.
[in] | storage_ctx | Storage context. Cannot be NULL. |
[in] | id | Storage element identifier. |
typedef void* vs_storage_file_t |
File descriptor.
File descriptor depends on storage implementation
typedef void* vs_storage_impl_data_ctx_t |
File context.
This context is generated by user call of vs_storage_hal_ctx_t vs_storage_xxx_init.
typedef vs_status_e(* vs_storage_load_hal_t) (const vs_storage_impl_data_ctx_t storage_ctx, const vs_storage_file_t file, size_t offset, uint8_t *out_data, size_t data_sz) |
Load storage element.
[in] | storage_ctx | Storage context. Cannot be NULL. |
[in] | file | Storage file context. |
[in] | offset | Data offset. |
[out] | out_data | Output storage for loaded data. Cannot be NULL. |
[in] | data_sz | Data size to be loaded. Cannot be zero. |
typedef vs_storage_file_t(* vs_storage_open_hal_t) (const vs_storage_impl_data_ctx_t storage_ctx, const vs_storage_element_id_t id) |
Open storage element.
[in] | storage_ctx | Storage context. Cannot be NULL. |
[in] | id |
typedef vs_status_e(* vs_storage_save_hal_t) (const vs_storage_impl_data_ctx_t storage_ctx, const vs_storage_file_t file, size_t offset, const uint8_t *in_data, size_t data_sz) |
Save storage element.
[in] | storage_ctx | Storage context. Cannot be NULL. |
[in] | file | Storage file context. |
[in] | offset | Save data offset. |
[in] | in_data | Data to be saved. Cannot be NULL. |
[in] | data_sz | Data size. |
vs_status_e vs_impl_own_firmware_descriptor | ( | void * | descriptor | ) |
Load currently executed firmware descriptor.
[out] | descriptor | Output buffer to store firmware descriptor. Cannot be NULL. |