PER Firmware
Loading...
Searching...
No Matches
switches.h
1#ifndef SWITCHES_H
2#define SWITCHES_H
3
4#include <stdbool.h>
5#include <stdint.h>
6
7typedef enum {
8 // High power switches
9 SW_PUMP_1 = 0,
10 SW_PUMP_2 = 1,
11 SW_SDC = 2,
12 SW_HXFAN = 3,
13
14 // High power switches (mux-sensed)
15 SW_FAN_1 = 4,
16 SW_FAN_2 = 5,
17 SW_FAN_3 = 6,
18 SW_FAN_4 = 7,
19 SW_AMK1 = 8,
20 SW_AMK2 = 9,
21
22 // Low power switches
23 SW_DASH = 10,
24 SW_ABOX = 11,
25 SW_MAIN = 12,
26 SW_DLFR = 13,
27 SW_DLBK = 14,
28
29 // Not switch outputs
30 CS_24V = 15,
31 CS_5V = 16,
32 CS_SWITCH_COUNT = 17,
33
34 // Low power switches (no current-sense)
35 SW_BLT = 18,
36 // 5V switches (no current-sense)
37 SW_CRIT_5V = 19,
38 SW_TV = 20,
39 SW_DAQ = 21,
40 SW_FAN_5V = 22
41} switches_t;
42
43void switches_init(void);
44void switches_periodic(void);
45void switches_enable_default_rails(void);
46void switches_set_state(switches_t switch_id, bool enabled);
47bool switches_is_enabled(switches_t switch_id);
48uint16_t switches_get_mux_adc_counts(uint8_t channel);
49
50#endif // SWITCHES_H