STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
bringup_task.h
Go to the documentation of this file.
1#ifndef STAR_BRINGUP_TASK_H
2#define STAR_BRINGUP_TASK_H
3
4/*
5 * Boot-time bring-up: power/reset sequencing, then Pranay's self-test
6 * coordinator over every chip, then an analog snapshot.
7 *
8 * Results, with no console yet:
9 * LED1 (PB9) fast blink while checks run, then 1 Hz forever (alive)
10 * LED2 (PE0) after the checks: off = READY, blinking with LED1 = WARN
11 * (optional chip failed or battery low), solid = FAIL
12 * (required chip failed, battery FAIL or unreadable)
13 * (LED2 on + LED1 stopped = Error_Handler halted the chip)
14 * g_bringup_report watch it in the debugger (PlatformIO Debug, ST-Link)
15 *
16 * Nothing here enables a pyro output or transmits on the radio.
17 */
18
19#include <stdbool.h>
20#include <stdint.h>
21
22#include "board_adc.h"
23#include "board_bringup.h"
24#include "boot_report.h"
25#include "self_test_port.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31typedef struct {
34 /* Copy of the coordinator's status: per device, result + diagnostic +
35 * attempts. Device IDs: self_test_devices.h. Diagnostics: board_*.h. */
37 /* Raw counts of every ADC input, taken after the checks. */
39 bool app_started; /* app_start(): every application task created */
40 /* Verdict, battery (mV, OK/WARN/FAIL/USB), result_bits, and the same
41 * thing as text: in gdb, printf "%s", g_bringup_report.report.text */
44
46
47/* The board context (ADC ready, chips powered), for the Idle battery read. */
49
50/* Create the bring-up task. Call between osKernelInitialize/osKernelStart. */
51void bringup_task_start(void);
52
53#ifdef __cplusplus
54}
55#endif
56#endif
bringup_report_t g_bringup_report
board_bringup_t * bringup_task_board(void)
void bringup_task_start(void)
board_adc_snapshot_t analog
self_test_status_t self_test
uint32_t finished_at_ms
boot_report_t report