Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
stream_flash.h File Reference

Public API for stream writes to flash. More...

#include <stdbool.h>
#include <zephyr/drivers/flash.h>

Go to the source code of this file.

Data Structures

struct  stream_flash_ctx
 Structure for stream flash context. More...
 

Typedefs

typedef int(* stream_flash_callback_t) (uint8_t *buf, size_t len, size_t offset)
 Signature for callback invoked after flash write completes.
 

Functions

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.
 
size_t stream_flash_bytes_written (const struct stream_flash_ctx *ctx)
 Read number of bytes written to the flash.
 
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.
 
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_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_progress_clear (const struct stream_flash_ctx *ctx, const char *settings_key)
 Clear persistent stream write progress stored with key settings_key .
 

Detailed Description

Public API for stream writes to flash.