Zephyr Project API  3.3.0
A Scalable Open Source RTOS
flash_img.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Nordic Semiconductor ASA
3 * Copyright (c) 2017 Linaro Limited
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
15#ifndef ZEPHYR_INCLUDE_DFU_FLASH_IMG_H_
16#define ZEPHYR_INCLUDE_DFU_FLASH_IMG_H_
17
19
27#ifdef __cplusplus
28extern "C" {
29#endif
30
32 uint8_t buf[CONFIG_IMG_BLOCK_BUF_SIZE];
33 const struct flash_area *flash_area;
35};
36
44 const uint8_t *match;
45 size_t clen;
46};
47
57
66
75
94 size_t len, bool flush);
95
110 const struct flash_img_check *fic,
111 uint8_t area_id);
112
113#ifdef __cplusplus
114}
115#endif
116
121#endif /* ZEPHYR_INCLUDE_DFU_FLASH_IMG_H_ */
int flash_img_init_id(struct flash_img_context *ctx, uint8_t area_id)
Initialize context needed for writing the image to the flash.
int flash_img_check(struct flash_img_context *ctx, const struct flash_img_check *fic, uint8_t area_id)
Verify flash memory length bytes integrity from a flash area. The start point is indicated by an offs...
size_t flash_img_bytes_written(struct flash_img_context *ctx)
Read number of bytes of the image written to the flash.
int flash_img_init(struct flash_img_context *ctx)
Initialize context needed for writing the image to the flash.
int flash_img_buffered_write(struct flash_img_context *ctx, const uint8_t *data, size_t len, bool flush)
Process input buffers to be written to the image slot 1. flash memory in single blocks....
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
Public API for stream writes to flash.
Flash partition.
Definition: flash_map.h:56
Structure for verify flash region integrity.
Definition: flash_img.h:43
const uint8_t * match
Definition: flash_img.h:44
size_t clen
Definition: flash_img.h:45
Definition: flash_img.h:31
uint8_t buf[CONFIG_IMG_BLOCK_BUF_SIZE]
Definition: flash_img.h:32
struct stream_flash_ctx stream
Definition: flash_img.h:34
const struct flash_area * flash_area
Definition: flash_img.h:33
Structure for stream flash context.
Definition: stream_flash.h:54
static fdata_t data[2]
Definition: test_fifo_contexts.c:15