-
Notifications
You must be signed in to change notification settings - Fork 1
/
health.h
85 lines (70 loc) · 1.61 KB
/
health.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef __HEALTH_H
#define __HEALTH_H
enum pll_status_t {
PLL_UNLOCK,
PLL_OK
};
#ifdef HEALTH_H_DEFINE_CONSTANTS
const char *pll_status_description[] = {
[PLL_UNLOCK] = "UNLOCK",
[PLL_OK] = "OK"
};
#endif
enum fll_status_t {
FLL_UNLOCK,
FLL_OK
};
#ifdef HEALTH_H_DEFINE_CONSTANTS
const char *fll_status_description[] = {
[FLL_UNLOCK] = "UNLOCK",
[FLL_OK] = "OK"
};
#endif
enum gps_status_t {
GPS_UNLOCK,
GPS_MINOR_ALARM,
GPS_OK
};
#ifdef HEALTH_H_DEFINE_CONSTANTS
const char *gps_status_description[] = {
[GPS_UNLOCK] = "UNLOCK",
[GPS_MINOR_ALARM] = "MINOR ALARM",
[GPS_OK] = "OK"
};
#endif
enum rb_status_t {
RB_UNLOCK,
RB_OK
};
#ifdef HEALTH_H_DEFINE_CONSTANTS
const char *rb_status_description[] = {
[RB_UNLOCK] = "UNLOCK",
[RB_OK] = "OK"
};
#endif
enum health_status_t {
HEALTH_UNLOCK,
HEALTH_HOLDOVER,
HEALTH_OK
};
#ifdef HEALTH_H_DEFINE_CONSTANTS
const char *health_status_description[] = {
[HEALTH_UNLOCK] = "UNLOCK",
[HEALTH_HOLDOVER] = "HOLDOVER",
[HEALTH_OK] = "OK"
};
#endif
void health_set_pll_status(enum pll_status_t status);
void health_set_fll_status(enum fll_status_t status);
void health_set_gps_status(enum gps_status_t status);
void health_set_rb_status(enum rb_status_t status);
void health_watchdog_tick();
void health_reset_gps_watchdog();
void health_reset_fll_watchdog();
void health_print_status();
enum health_status_t health_get_status();
char health_should_run_pll();
void health_set_reftime(uint32_t upper, uint32_t lower);
void health_get_reftime(uint32_t *upper, uint32_t *lower);
uint32_t health_get_ref_age();
#endif