PER Firmware
Loading...
Searching...
No Matches
switches.h
Go to the documentation of this file.
1#ifndef SWITCHES_H
2#define SWITCHES_H
3
4#include <stdbool.h>
5#include <stdint.h>
6
7typedef enum {
8 // High power switches
11 SW_SDC = 2,
13
14 // High power switches (mux-sensed)
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,
33
34 // Low power switches (no current-sense)
35 SW_BLT = 18,
36 // 5V switches (no current-sense)
38 SW_TV = 20,
39 SW_DAQ = 21,
40 SW_FAN_5V = 22
42
43void switches_init(void);
44void switches_periodic(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
void switches_periodic(void)
Definition switches.c:144
void switches_init(void)
Definition switches.c:138
bool switches_is_enabled(switches_t switch_id)
Definition switches.c:169
void switches_enable_default_rails(void)
Definition switches.c:186
void switches_set_state(switches_t switch_id, bool enabled)
Definition switches.c:150
uint16_t switches_get_mux_adc_counts(uint8_t channel)
Definition switches.c:178
switches_t
Definition switches.h:7
@ SW_FAN_2
Definition switches.h:16
@ SW_DAQ
Definition switches.h:39
@ SW_FAN_4
Definition switches.h:18
@ SW_TV
Definition switches.h:38
@ SW_HXFAN
Definition switches.h:12
@ SW_ABOX
Definition switches.h:24
@ CS_5V
Definition switches.h:31
@ SW_MAIN
Definition switches.h:25
@ SW_SDC
Definition switches.h:11
@ SW_DLBK
Definition switches.h:27
@ CS_SWITCH_COUNT
Definition switches.h:32
@ SW_PUMP_1
Definition switches.h:9
@ SW_BLT
Definition switches.h:35
@ SW_FAN_5V
Definition switches.h:40
@ SW_DLFR
Definition switches.h:26
@ SW_FAN_1
Definition switches.h:15
@ SW_AMK1
Definition switches.h:19
@ SW_DASH
Definition switches.h:23
@ CS_24V
Definition switches.h:30
@ SW_FAN_3
Definition switches.h:17
@ SW_PUMP_2
Definition switches.h:10
@ SW_AMK2
Definition switches.h:20
@ SW_CRIT_5V
Definition switches.h:37