rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
art_fetch.h
Go to the documentation of this file.
1
22
23#ifndef RCBENCH_ART_FETCH_H
24#define RCBENCH_ART_FETCH_H
25
26#include <stdbool.h>
27#include <stdint.h>
28
29#include "art_store.h"
30#include "link_artxfer.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
37typedef struct {
44 bool (*read_page)(void *ctx, uint8_t page, uint8_t count, uint16_t *regs);
50 bool (*write_reg)(void *ctx, uint8_t page, uint8_t reg, uint16_t value);
51 void *ctx;
53
61
63typedef struct {
66 const char *why;
68
89bool art_fetch_meta(const art_transport_t *t, uint16_t *meta_regs,
90 uint32_t *bytes, const char **why);
91
104bool art_fetch_key(const uint16_t *meta_regs, uint16_t board,
105 art_entry_t *out);
106
118bool art_fetch_begin(art_fetch_t *f, const uint16_t *meta_regs, uint8_t *buf,
119 uint32_t cap);
120
134 unsigned blocks);
135
142uint16_t art_fetch_format(const art_fetch_t *f);
149uint16_t art_fetch_width(const art_fetch_t *f);
156uint16_t art_fetch_height(const art_fetch_t *f);
163uint16_t art_fetch_crc(const art_fetch_t *f);
170uint32_t art_fetch_hash(const art_fetch_t *f);
177uint32_t art_fetch_bytes(const art_fetch_t *f);
178
187const char *art_fetch_why(const art_fetch_t *f);
188
189#ifdef __cplusplus
190}
191#endif
192
193#endif /* RCBENCH_ART_FETCH_H */
art_fetch_state_t art_fetch_step(art_fetch_t *f, const art_transport_t *t, unsigned blocks)
Ask for up to blocks of it.
Definition art_fetch.c:105
uint16_t art_fetch_crc(const art_fetch_t *f)
The CRC of the drawing.
Definition art_fetch.c:165
uint16_t art_fetch_width(const art_fetch_t *f)
The width of the drawing.
Definition art_fetch.c:155
bool art_fetch_begin(art_fetch_t *f, const uint16_t *meta_regs, uint8_t *buf, uint32_t cap)
Get ready to assemble into buf.
Definition art_fetch.c:89
bool art_fetch_key(const uint16_t *meta_regs, uint16_t board, art_entry_t *out)
The cache entry meta_regs describe for board: the content key a kept drawing has to match field for f...
Definition art_fetch.c:68
const char * art_fetch_why(const art_fetch_t *f)
Why it stopped, for a log line.
Definition art_fetch.c:180
uint32_t art_fetch_hash(const art_fetch_t *f)
The hash of the drawing.
Definition art_fetch.c:170
uint32_t art_fetch_bytes(const art_fetch_t *f)
The size of the drawing in bytes.
Definition art_fetch.c:175
uint16_t art_fetch_format(const art_fetch_t *f)
What the drawing is, once it is whole.
Definition art_fetch.c:150
bool art_fetch_meta(const art_transport_t *t, uint16_t *meta_regs, uint32_t *bytes, const char **why)
What the far end says its drawing is: LINK_AW_COUNT registers into meta_regs.
Definition art_fetch.c:31
uint16_t art_fetch_height(const art_fetch_t *f)
The height of the drawing.
Definition art_fetch.c:160
art_fetch_state_t
States of a fetch.
Definition art_fetch.h:55
@ ART_FETCH_FAILED
Definition art_fetch.h:59
@ ART_FETCH_IDLE
Definition art_fetch.h:56
@ ART_FETCH_RUNNING
Definition art_fetch.h:57
@ ART_FETCH_DONE
Definition art_fetch.h:58
Keeping a board's drawing, so it is fetched once and not every time the link comes up.
What a slot says it holds: the board and the ARTWORK page it came from.
Definition art_store.h:65
State of one fetch.
Definition art_fetch.h:63
How the sequence reaches the far end.
Definition art_fetch.h:37
bool(*) read_page(void *ctx, uint8_t page, uint8_t count, uint16_t *regs)
Read count registers of page.
Definition art_fetch.h:44
bool(*) write_reg(void *ctx, uint8_t page, uint8_t reg, uint16_t value)
Write one register.
Definition art_fetch.h:50