31 return block_meta.phy_id;
44 uint32_t scratch_id = 0;
64 dst_offset, block_meta.
phy_id,
92 block_meta.
phy_id = scratch_id;
124 phys_block = its_dblock_lo_to_phy(fs_ctx, file_meta->
lblock);
129 pos = (file_meta->
data_idx + offset);
180 block_meta->
phy_id, pos, num_bytes);
psa_status_t its_flash_fs_mblock_update_scratch_block_meta(struct its_flash_fs_ctx_t *fs_ctx, uint32_t lblock, struct its_block_meta_t *block_meta)
Puts logical block's metadata in scratch metadata block.
const struct its_flash_info_t * flash_info
#define ITS_LOGICAL_DBLOCK0
Defines logical data block 0 ID.
psa_status_t its_flash_fs_dblock_write_file(struct its_flash_fs_ctx_t *fs_ctx, const struct its_block_meta_t *block_meta, const struct its_file_meta_t *file_meta, size_t offset, size_t size, const uint8_t *data)
Writes scratch data block content with requested data and the rest of the data from the given logical...
psa_status_t its_flash_fs_mblock_read_block_metadata(struct its_flash_fs_ctx_t *fs_ctx, uint32_t lblock, struct its_block_meta_t *block_meta)
Reads specified logical block metadata.
psa_status_t its_flash_block_to_block_move(const struct its_flash_info_t *info, uint32_t dst_block, size_t dst_offset, uint32_t src_block, size_t src_offset, size_t size)
Moves data from source block ID to destination block ID.
uint32_t its_flash_fs_mblock_cur_data_scratch_id(struct its_flash_fs_ctx_t *fs_ctx, uint32_t lblock)
Gets current scratch datablock physical ID.
void its_flash_fs_mblock_set_data_scratch(struct its_flash_fs_ctx_t *fs_ctx, uint32_t phy_id, uint32_t lblock)
Sets current data scratch block.
psa_status_t(* read)(const struct its_flash_info_t *info, uint32_t block_id, uint8_t *buff, size_t offset, size_t size)
Reads block data from the position specified by block ID and offset.
#define PSA_ERROR_GENERIC_ERROR
psa_status_t(* flush)(const struct its_flash_info_t *info)
Flushes modifications to a block to flash. Must be called after a sequence of calls to write() (inclu...
psa_status_t its_flash_fs_dblock_read_file(struct its_flash_fs_ctx_t *fs_ctx, const struct its_file_meta_t *file_meta, size_t offset, size_t size, uint8_t *buf)
Reads the file content.
psa_status_t its_flash_fs_dblock_compact_block(struct its_flash_fs_ctx_t *fs_ctx, uint32_t lblock, size_t free_size, size_t src_offset, size_t dst_offset, size_t size)
Compacts block data for the given logical block.
Structure to store the ITS flash file system context.
#define ITS_BLOCK_INVALID_ID
int32_t psa_status_t
Function return status.
psa_status_t(* write)(const struct its_flash_info_t *info, uint32_t block_id, const uint8_t *buff, size_t offset, size_t size)
Writes block data to the position specified by block ID and offset.