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
27
extern
"C"
{
28
#endif
29
30
typedef
enum
{
BOOT_READY
= 0,
BOOT_WARN
,
BOOT_FAIL
}
boot_verdict_t
;
31
32
#define BOOT_REPORT_TEXT_MAX 768U
33
34
typedef
struct
{
35
boot_verdict_t
verdict
;
36
uint16_t
result_bits
;
37
uint8_t
required_failed
,
optional_failed
;
38
battery_t
battery
;
39
char
text
[
BOOT_REPORT_TEXT_MAX
];
40
}
boot_report_t
;
41
42
/* status: the coordinator's final status (NULL: self-test never ran). */
43
void
boot_report_build
(
boot_report_t
* report,
const
self_test_status_t
* status,
44
battery_t
battery
, uint32_t now_ms);
45
46
const
char
*
boot_verdict_name
(
boot_verdict_t
verdict);
47
48
#ifdef __cplusplus
49
}
50
#endif
51
#endif
battery.h
BOOT_REPORT_TEXT_MAX
#define BOOT_REPORT_TEXT_MAX
Definition
boot_report.h:32
boot_verdict_t
boot_verdict_t
Definition
boot_report.h:30
BOOT_WARN
@ BOOT_WARN
Definition
boot_report.h:30
BOOT_READY
@ BOOT_READY
Definition
boot_report.h:30
BOOT_FAIL
@ BOOT_FAIL
Definition
boot_report.h:30
boot_report_build
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
boot_verdict_name
const char * boot_verdict_name(boot_verdict_t verdict)
Definition
boot_report.c:49
self_test_port.h
battery_t
Definition
battery.h:47
boot_report_t
Definition
boot_report.h:34
boot_report_t::result_bits
uint16_t result_bits
Definition
boot_report.h:36
boot_report_t::text
char text[BOOT_REPORT_TEXT_MAX]
Definition
boot_report.h:39
boot_report_t::battery
battery_t battery
Definition
boot_report.h:38
boot_report_t::verdict
boot_verdict_t verdict
Definition
boot_report.h:35
boot_report_t::required_failed
uint8_t required_failed
Definition
boot_report.h:37
boot_report_t::optional_failed
uint8_t optional_failed
Definition
boot_report.h:37
self_test_status_t
Definition
self_test_port.h:47
battery
static self_test_battery_t battery(void *context, uint32_t now_ms, uint32_t budget_ms)
Definition
test_self_test.c:45
firmware
Flight_Computer
src
app
boot_report.h
Generated by
1.15.0