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
28
extern
"C"
{
29
#endif
30
31
typedef
struct
{
32
bool
finished
;
33
uint32_t
finished_at_ms
;
34
/* Copy of the coordinator's status: per device, result + diagnostic +
35
* attempts. Device IDs: self_test_devices.h. Diagnostics: board_*.h. */
36
self_test_status_t
self_test
;
37
/* Raw counts of every ADC input, taken after the checks. */
38
board_adc_snapshot_t
analog
;
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 */
42
boot_report_t
report
;
43
}
bringup_report_t
;
44
45
extern
bringup_report_t
g_bringup_report
;
46
47
/* The board context (ADC ready, chips powered), for the Idle battery read. */
48
board_bringup_t
*
bringup_task_board
(
void
);
49
50
/* Create the bring-up task. Call between osKernelInitialize/osKernelStart. */
51
void
bringup_task_start
(
void
);
52
53
#ifdef __cplusplus
54
}
55
#endif
56
#endif
board_adc.h
board_bringup.h
boot_report.h
g_bringup_report
bringup_report_t g_bringup_report
Definition
bringup_task.c:15
bringup_task_board
board_bringup_t * bringup_task_board(void)
Definition
bringup_task.c:121
bringup_task_start
void bringup_task_start(void)
Definition
bringup_task.c:125
self_test_port.h
board_adc_snapshot_t
Definition
board_adc.h:29
board_bringup_t
Definition
board_bringup.h:36
boot_report_t
Definition
boot_report.h:34
bringup_report_t
Definition
bringup_task.h:31
bringup_report_t::analog
board_adc_snapshot_t analog
Definition
bringup_task.h:38
bringup_report_t::self_test
self_test_status_t self_test
Definition
bringup_task.h:36
bringup_report_t::app_started
bool app_started
Definition
bringup_task.h:39
bringup_report_t::finished_at_ms
uint32_t finished_at_ms
Definition
bringup_task.h:33
bringup_report_t::report
boot_report_t report
Definition
bringup_task.h:42
bringup_report_t::finished
bool finished
Definition
bringup_task.h:32
self_test_status_t
Definition
self_test_port.h:47
firmware
Flight_Computer
src
board
bringup_task.h
Generated by
1.15.0