Zephyr API Documentation  2.7.0-rc2
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
8#ifndef ZEPHYR_INCLUDE_DFU_FLASH_IMG_H_
9#define ZEPHYR_INCLUDE_DFU_FLASH_IMG_H_
10
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
18 uint8_t buf[CONFIG_IMG_BLOCK_BUF_SIZE];
19 const struct flash_area *flash_area;
21};
22
30 const uint8_t *match;
31 size_t clen;
32};
33
43
52
61
80 size_t len, bool flush);
81
96 const struct flash_img_check *fic,
97 uint8_t area_id);
98
99#ifdef __cplusplus
100}
101#endif
102
103#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:58
Public API for stream writes to flash.
Flash partition.
Definition: flash_map.h:53
Structure for verify flash region integrity.
Definition: flash_img.h:29
const uint8_t * match
Definition: flash_img.h:30
size_t clen
Definition: flash_img.h:31
Definition: flash_img.h:17
uint8_t buf[CONFIG_IMG_BLOCK_BUF_SIZE]
Definition: flash_img.h:18
struct stream_flash_ctx stream
Definition: flash_img.h:20
const struct flash_area * flash_area
Definition: flash_img.h:19
Structure for stream flash context.
Definition: stream_flash.h:53
static fdata_t data[2]
Definition: test_fifo_contexts.c:15