rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Toggle main menu visibility
Loading...
Searching...
No Matches
fw_install.h
Go to the documentation of this file.
1
28
29
#ifndef RCBENCH_FW_INSTALL_H
30
#define RCBENCH_FW_INSTALL_H
31
32
#include <stdbool.h>
33
#include <stdint.h>
34
35
#include "
fw_image.h
"
36
37
#ifdef __cplusplus
38
extern
"C"
{
39
#endif
40
42
#define FW_WRITE_CHUNK (64u * 1024u)
43
44
/* ---------------------------------------------------------------- the gate */
45
47
typedef
enum
{
48
FW_GATE_OPEN = 0,
49
FW_GATE_ARMED
,
50
FW_GATE_SUPPLY
,
51
FW_GATE_RUN
,
52
FW_GATE_DRAWING
,
53
FW_GATE_COPROC
,
54
}
fw_gate_t
;
55
62
fw_gate_t
fw_gate(
bool
armed,
bool
supply,
bool
run_open,
bool
drawing,
63
bool
coproc);
64
71
bool
fw_coproc_may_start(
bool
radio_down,
bool
installing);
72
73
/* ----------------------------------------------------------- the installer */
74
76
typedef
struct
{
78
bool (*
begin
)(
void
*ctx, uint32_t bytes);
80
bool (*
write
)(
void
*ctx, uint32_t off,
const
uint8_t *src, uint32_t len);
82
bool (*
finish
)(
void
*ctx);
84
void (*
abort
)(
void
*ctx);
85
void
*ctx;
86
}
fw_flash_t
;
87
88
typedef
enum
{
89
FW_INSTALL_IDLE
= 0,
90
FW_INSTALL_WAITING
,
91
FW_INSTALL_RUNNING
,
92
FW_INSTALL_DONE
,
93
FW_INSTALL_FAILED
,
94
}
fw_install_status_t
;
95
96
typedef
struct
{
97
const
fw_flash_t
*f;
98
const
uint8_t *img;
99
uint32_t bytes;
100
uint32_t
done
;
101
bool
opened
;
102
bool
touched
;
103
bool
busy;
104
fw_err_t
err;
105
fw_offer_t
offer;
106
fw_image_info_t
info;
107
}
fw_install_t
;
108
115
fw_err_t
fw_install_begin(
fw_install_t
*in,
const
fw_flash_t
*f,
116
const
uint8_t *img, uint32_t bytes, uint32_t slot,
117
const
fw_image_info_t
*running);
118
124
fw_install_status_t
fw_install_step(
fw_install_t
*in,
bool
quiet);
125
127
bool
fw_install_finishing(
const
fw_install_t
*in);
128
129
#ifdef __cplusplus
130
}
131
#endif
132
133
#endif
/* RCBENCH_FW_INSTALL_H */
fw_image.h
The panel's application image, read from memory: what it is, whether it is whole, and whether it is o...
fw_err_t
fw_err_t
Definition
fw_image.h:61
fw_offer_t
fw_offer_t
What a checked image is to the panel running now.
Definition
fw_image.h:158
fw_gate_t
fw_gate_t
Definition
fw_install.h:47
FW_GATE_COPROC
@ FW_GATE_COPROC
Definition
fw_install.h:53
FW_GATE_ARMED
@ FW_GATE_ARMED
Definition
fw_install.h:49
FW_GATE_SUPPLY
@ FW_GATE_SUPPLY
Definition
fw_install.h:50
FW_GATE_DRAWING
@ FW_GATE_DRAWING
Definition
fw_install.h:52
FW_GATE_RUN
@ FW_GATE_RUN
Definition
fw_install.h:51
fw_install_status_t
fw_install_status_t
Definition
fw_install.h:88
FW_INSTALL_RUNNING
@ FW_INSTALL_RUNNING
Definition
fw_install.h:91
FW_INSTALL_WAITING
@ FW_INSTALL_WAITING
Definition
fw_install.h:90
FW_INSTALL_IDLE
@ FW_INSTALL_IDLE
Definition
fw_install.h:89
FW_INSTALL_DONE
@ FW_INSTALL_DONE
Definition
fw_install.h:92
FW_INSTALL_FAILED
@ FW_INSTALL_FAILED
Definition
fw_install.h:93
fw_flash_t
Definition
fw_install.h:76
fw_flash_t::finish
bool(*) finish(void *ctx)
Definition
fw_install.h:82
fw_flash_t::begin
bool(*) begin(void *ctx, uint32_t bytes)
Definition
fw_install.h:78
fw_flash_t::abort
void(*) abort(void *ctx)
Definition
fw_install.h:84
fw_flash_t::write
bool(*) write(void *ctx, uint32_t off, const uint8_t *src, uint32_t len)
Definition
fw_install.h:80
fw_image_info_t
Definition
fw_image.h:83
fw_install_t
Definition
fw_install.h:96
fw_install_t::touched
bool touched
Definition
fw_install.h:102
fw_install_t::done
uint32_t done
Definition
fw_install.h:100
fw_install_t::opened
bool opened
Definition
fw_install.h:101
shared
fwupdate
include
fw_install.h
Generated by
1.18.0