31#ifndef RCBENCH_ART_STORE_H
32#define RCBENCH_ART_STORE_H
42#define ART_SLOT_BYTES (16u * 1024u)
53 bool (*read)(
void *ctx, uint32_t off,
void *dst, uint32_t len);
54 bool (*erase)(
void *ctx, uint32_t off, uint32_t len);
55 bool (*write)(
void *ctx, uint32_t off,
const void *src, uint32_t len);
149 uint8_t *dst, uint32_t cap);
188#define ART_KEEP_READ_BYTES 256u
217 const uint8_t *payload;
bool art_entry_same(const art_entry_t *a, const art_entry_t *b)
Whether two entries describe the same payload: every field equal.
Definition art_store.c:137
bool art_store_find(const art_flash_t *f, uint16_t board, art_entry_t *out)
What is kept for board, without reading the drawing itself.
Definition art_store.c:114
bool art_keep_busy(const art_keep_t *k)
Whether k has a keep under way, waiting or not.
Definition art_store.c:273
bool art_store_read(const art_flash_t *f, uint16_t board, uint8_t *dst, uint32_t cap)
Read the drawing for board into dst.
Definition art_store.c:145
uint32_t art_store_capacity(const art_flash_t *f)
The most bytes a drawing may be for this partition to hold it.
Definition art_store.c:75
bool art_keep_begin(art_keep_t *k, const art_flash_t *f, uint16_t board, const art_entry_t *entry, const uint8_t *payload)
Set k up to keep payload for board.
Definition art_store.c:250
uint32_t art_store_slots(const art_flash_t *f)
How many drawings this partition has room for.
Definition art_store.c:70
bool art_store_put(const art_flash_t *f, uint16_t board, const art_entry_t *entry, const uint8_t *payload)
Keep payload for board, replacing anything kept for it already.
Definition art_store.c:211
bool art_store_read_same(const art_flash_t *f, const art_entry_t *key, uint8_t *dst, uint32_t cap)
Read the drawing key describes into dst: only when the entry kept for key->board equals key in every ...
Definition art_store.c:165
art_keep_status_t art_keep_step(art_keep_t *k, bool may_write)
One step, when may_write is true: at most one sector erased, written or read back,...
Definition art_store.c:384
bool art_store_forget(const art_flash_t *f, uint16_t board)
Forget what is kept for board.
Definition art_store.c:415
art_keep_status_t
What a step of a keep did; see art_keep_step().
Definition art_store.h:191
@ ART_KEEP_IDLE
Definition art_store.h:192
@ ART_KEEP_WAITING
Definition art_store.h:193
@ ART_KEEP_RUNNING
Definition art_store.h:194
@ ART_KEEP_FAILED
Definition art_store.h:196
@ ART_KEEP_DONE
Definition art_store.h:195
#define ART_KEEP_READ_BYTES
Bytes read back per read while a keep checks what it wrote.
Definition art_store.h:188
#define k
Short name for kst_panel_k inside the overlay's seven files.
Definition kst_panel_int.h:238
What a slot says it holds: the board and the ARTWORK page it came from.
Definition art_store.h:65
uint32_t hash
Definition art_store.h:71
uint16_t crc
Definition art_store.h:70
uint32_t bytes
Definition art_store.h:72
uint16_t height
Definition art_store.h:69
uint16_t format
Definition art_store.h:67
uint16_t width
Definition art_store.h:68
The flash a store lives in.
Definition art_store.h:52
uint32_t sector
Definition art_store.h:58
uint32_t size
Definition art_store.h:57
The write art_store_put() does, cut into steps of at most one sector each, so a caller can stop betwe...
Definition art_store.h:215
uint32_t done
Definition art_store.h:223
uint8_t buf[ART_KEEP_READ_BYTES]
Definition art_store.h:226
uint16_t crc
Definition art_store.h:224
uint8_t phase
Definition art_store.h:220
uint32_t span
Definition art_store.h:222
uint32_t at
Definition art_store.h:221
uint32_t hash
Definition art_store.h:225