13#ifndef ZEPHYR_INCLUDE_STORAGE_STREAM_FLASH_H_
14#define ZEPHYR_INCLUDE_STORAGE_STREAM_FLASH_H_
64#ifdef CONFIG_STREAM_FLASH_POST_WRITE_CALLBACK
67#ifdef CONFIG_STREAM_FLASH_ERASE
68 off_t last_erased_page_start_offset;
93 uint8_t *buf,
size_t buf_len,
size_t offset,
size_t size,
128 size_t len,
bool flush);
160 const char *settings_key);
172 const char *settings_key);
184 const char *settings_key);
irp nz macro MOVR cc s mov cc s endm endr irp aw macro LDR aa off
Definition asm-macro-32-bit-gnu.h:17
Public API for FLASH drivers.
int(* stream_flash_callback_t)(uint8_t *buf, size_t len, size_t offset)
Signature for callback invoked after flash write completes.
Definition stream_flash.h:48
int stream_flash_progress_load(struct stream_flash_ctx *ctx, const char *settings_key)
Load persistent stream write progress stored with key settings_key .
int stream_flash_progress_save(const struct stream_flash_ctx *ctx, const char *settings_key)
Save persistent stream write progress using key settings_key .
int stream_flash_init(struct stream_flash_ctx *ctx, const struct device *fdev, uint8_t *buf, size_t buf_len, size_t offset, size_t size, stream_flash_callback_t cb)
Initialize context needed for stream writes to flash.
int stream_flash_erase_page(struct stream_flash_ctx *ctx, off_t off)
Erase the flash page to which a given offset belongs.
int stream_flash_progress_clear(const struct stream_flash_ctx *ctx, const char *settings_key)
Clear persistent stream write progress stored with key settings_key .
int stream_flash_buffered_write(struct stream_flash_ctx *ctx, const uint8_t *data, size_t len, bool flush)
Process input buffers to be written to flash device in single blocks.
size_t stream_flash_bytes_written(const struct stream_flash_ctx *ctx)
Read number of bytes written to the flash.
__INTPTR_TYPE__ off_t
Definition types.h:36
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:411
void * data
Address of the device instance private data.
Definition device.h:421
Structure for stream flash context.
Definition stream_flash.h:56
uint8_t * buf
Definition stream_flash.h:57
size_t offset
Definition stream_flash.h:62
size_t bytes_written
Definition stream_flash.h:61
size_t buf_bytes
Definition stream_flash.h:59
const struct device * fdev
Definition stream_flash.h:60
size_t write_block_size
Definition stream_flash.h:70
uint8_t erase_value
Definition stream_flash.h:71
size_t available
Definition stream_flash.h:63
size_t buf_len
Definition stream_flash.h:58