STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
boot_report.h
Go to the documentation of this file.
1#ifndef STAR_BOOT_REPORT_H
2#define STAR_BOOT_REPORT_H
3
4/*
5 * The start-up self-test, summarised. Portable (no HAL), so the host tests
6 * check the exact verdict and text the board produces.
7 *
8 * verdict FAIL a required chip did not pass, or the battery is FAIL
9 * or unreadable
10 * WARN an optional chip did not pass, or the battery is low
11 * READY everything passed (on USB the battery is not judged)
12 * result_bits bit <device id> set when that chip passed: the
13 * SelfTest radio frame's result_bits (src/radio/frame.h)
14 * text one line per check, for a person (ST-Link, later radio
15 * or USB)
16 * Required vs optional comes from the self-test config (#137 section 7, a
17 * proposal: this decides LED2 and the verdict, not arming).
18 */
19
20#include <stddef.h>
21#include <stdint.h>
22
23#include "battery.h"
24#include "self_test_port.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
31
32#define BOOT_REPORT_TEXT_MAX 768U
33
41
42/* status: the coordinator's final status (NULL: self-test never ran). */
43void boot_report_build(boot_report_t* report, const self_test_status_t* status,
44 battery_t battery, uint32_t now_ms);
45
46const char* boot_verdict_name(boot_verdict_t verdict);
47
48#ifdef __cplusplus
49}
50#endif
51#endif
#define BOOT_REPORT_TEXT_MAX
Definition boot_report.h:32
boot_verdict_t
Definition boot_report.h:30
@ BOOT_WARN
Definition boot_report.h:30
@ BOOT_READY
Definition boot_report.h:30
@ BOOT_FAIL
Definition boot_report.h:30
void boot_report_build(boot_report_t *report, const self_test_status_t *status, battery_t battery, uint32_t now_ms)
Definition boot_report.c:81
const char * boot_verdict_name(boot_verdict_t verdict)
Definition boot_report.c:49
uint16_t result_bits
Definition boot_report.h:36
char text[BOOT_REPORT_TEXT_MAX]
Definition boot_report.h:39
battery_t battery
Definition boot_report.h:38
boot_verdict_t verdict
Definition boot_report.h:35
uint8_t required_failed
Definition boot_report.h:37
uint8_t optional_failed
Definition boot_report.h:37
static self_test_battery_t battery(void *context, uint32_t now_ms, uint32_t budget_ms)