Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
stream_flash.h File Reference

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

#include <stdbool.h>
#include <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. More...
 

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. More...
 
size_t stream_flash_bytes_written (struct stream_flash_ctx *ctx)
 Read number of bytes written to the flash. More...
 
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. Will store remainder between calls. More...
 
int stream_flash_erase_page (struct stream_flash_ctx *ctx, off_t off)
 Erase the flash page to which a given offset belongs. More...
 
int stream_flash_progress_load (struct stream_flash_ctx *ctx, const char *settings_key)
 Load persistent stream write progress stored with key settings_key . More...
 
int stream_flash_progress_save (struct stream_flash_ctx *ctx, const char *settings_key)
 Save persistent stream write progress using key settings_key . More...
 
int stream_flash_progress_clear (struct stream_flash_ctx *ctx, const char *settings_key)
 Clear persistent stream write progress stored with key settings_key . More...
 

Detailed Description

Public API for stream writes to flash.