12#ifndef NRF_COMPRESS_IMPLEMENTATION_H_
13#define NRF_COMPRESS_IMPLEMENTATION_H_
17#include <zephyr/kernel.h>
18#include <zephyr/types.h>
19#include <zephyr/sys/iterable_sections.h>
37typedef int (*nrf_compress_init_deinit_func_t)(
void *inst);
38typedef int (*nrf_compress_reset_func_t)(
void *inst);
40typedef int (*nrf_compress_compress_func_t)(
void *inst);
41typedef size_t (*nrf_compress_decompress_bytes_needed_t)(
void *inst);
42typedef int (*nrf_compress_decompress_func_t)(
void *inst,
const uint8_t *input,
size_t input_size,
43 bool last_part, uint32_t *offset, uint8_t **output,
73 const nrf_compress_init_deinit_func_t
init;
83 const nrf_compress_init_deinit_func_t
deinit;
94 const nrf_compress_reset_func_t
reset;
96#if defined(CONFIG_NRF_COMPRESS_COMPRESSION) || defined(__DOXYGEN__)
101#if defined(CONFIG_NRF_COMPRESS_DECOMPRESSION) || defined(__DOXYGEN__)
164#define NRF_COMPRESS_IMPLEMENTATION_DEFINE(name, _id, _init, _deinit, _reset, _compress, \
165 _decompress_bytes_needed, _decompress) \
166 STRUCT_SECTION_ITERABLE(nrf_compress_implementation, name) = { \
171 COND_CODE_1(CONFIG_NRF_COMPRESS_COMPRESSION, ( \
172 .compress = _compress, \
174 COND_CODE_1(CONFIG_NRF_COMPRESS_DECOMPRESSION, ( \
175 .decompress_bytes_needed = _decompress_bytes_needed, \
176 .decompress = _decompress, \
nrf_compress_types
Supported compression types.
Definition: implementation.h:51
@ NRF_COMPRESS_TYPE_LZMA
Definition: implementation.h:53
@ NRF_COMPRESS_TYPE_ARM_THUMB
Definition: implementation.h:56
@ NRF_COMPRESS_TYPE_COUNT
Definition: implementation.h:58
struct nrf_compress_implementation * nrf_compress_implementation_find(uint16_t id)
Find a compression implementation.
const nrf_compress_decompress_func_t decompress
Decompress portion of compressed data. This function will need to be called one or more times with co...
Definition: implementation.h:141
const nrf_compress_init_deinit_func_t init
Initialize compression implementation.
Definition: implementation.h:73
const nrf_compress_init_deinit_func_t deinit
Deinitialize compression implementation.
Definition: implementation.h:83
const nrf_compress_reset_func_t reset
Reset compression state function. Used to abort current compression or decompression task before star...
Definition: implementation.h:94
const nrf_compress_decompress_bytes_needed_t decompress_bytes_needed
Return chunk size of data to provide to next call of nrf_compress_decompress_func_t function....
Definition: implementation.h:114
const nrf_compress_compress_func_t compress
Placeholder function for future use, do not use.
Definition: implementation.h:98
const uint16_t id
Definition: implementation.h:63
Definition: implementation.h:61