ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_ota_internal.h
Go to the documentation of this file.
1
15
16#pragma once
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#include <stdint.h>
23
24#include "ra8_attributes.h"
25#include "ra8_err.h"
26#include "ra8_ota.h"
27
60
93
125ra8_err_t priv_ota_json_u32(const char* json, const char* key, uint32_t* out_v);
126
158bool priv_ota_char_in_range(char c, char lo, char hi);
159
190bool priv_ota_download_state_invalid(uint32_t state_idle_val,
191 uint32_t state_downloading_val,
192 uint32_t state);
193
194/* =============================================================================
195 * Shared mutable module state.
196 *
197 * Defined exactly once in ra8_ota.c and reached by the verify cluster
198 * (ra8_ota_verify.c) through these extern declarations. Each carries the
199 * ``s_ra8_ota_`` module infix so the promoted (external-linkage) symbol is
200 * link-unique across the codebase (the file-size-split ``s_<module>_`` rule).
201 * ============================================================================= */
202
214
225
235extern bool g_ra8_ota_initialized;
236
249
273void priv_ota_set_state(ra8_ota_state_t new_state, ra8_err_t err);
274
275#ifdef __cplusplus
276}
277#endif
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
bool g_ra8_ota_initialized
True once ra8_ota_init succeeded (shared; contract in ra8_ota_internal.h).
Definition ra8_ota.c:57
ra8_ota_state_t g_ra8_ota_state
Current state-machine value (shared; contract in ra8_ota_internal.h).
Definition ra8_ota.c:51
uint8_t g_ra8_ota_buf[k_ra8_ota_chunk_bytes]
Streaming buffer (shared; contract in ra8_ota_internal.h).
Definition ra8_ota.c:72
ra8_ota_cfg_t g_ra8_ota_cfg
Configuration captured at init time (shared; contract in ra8_ota_internal.h).
Definition ra8_ota.c:54
Phase-5 OTA firmware-update orchestration for the RA8D2.
ra8_ota_state_t
Cooperative state-machine states.
Definition ra8_ota.h:91
@ k_ra8_ota_chunk_bytes
Download streaming chunk size in bytes.
Definition ra8_ota.h:73
bool priv_ota_char_in_range(char c, char lo, char hi)
Pure predicate: ASCII char is in inclusive range [lo, hi].
ra8_err_t priv_ota_manifest_decode(const char *json, ra8_ota_manifest_t *out)
Decode every field of a JSON manifest into an ra8_ota_manifest_t.
void priv_ota_set_state(ra8_ota_state_t new_state, ra8_err_t err)
Set the OTA state-machine value and fire the progress callback.
Definition ra8_ota.c:80
ra8_err_t priv_ota_validate_cfg(const ra8_ota_cfg_t *cfg)
Validate the entire OTA configuration descriptor.
ra8_err_t priv_ota_json_u32(const char *json, const char *key, uint32_t *out_v)
Parse a JSON-style "key": <decimal> field into a u32.
bool priv_ota_download_state_invalid(uint32_t state_idle_val, uint32_t state_downloading_val, uint32_t state)
Pure predicate: state is neither IDLE nor DOWNLOADING.
Initialisation descriptor for ra8_ota_init.
Definition ra8_ota.h:258
Decoded representation of the server manifest.
Definition ra8_ota.h:115