bp.h
1 /*
2  * EEZ PSU Firmware
3  * Copyright (C) 2015-present, Envox d.o.o.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14 
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 #if EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R1B9
22 
23 #define BP_LED_OUT1_PLUS 7
24 #define BP_LED_OUT1_PLUS_RED 6
25 #define BP_LED_SENSE1_PLUS 5
26 #define BP_LED_SENSE1_MINUS 4
27 #define BP_LED_OUT1_MINUS 3
28 #define BP_LED_OUT1_MINUS_RED 2
29 
30 #define BP_LED_OUT2_PLUS 13
31 #define BP_LED_SENSE2_PLUS 12
32 #define BP_LED_SENSE2_MINUS 11
33 #define BP_LED_OUT2_MINUS 10
34 
35 #define BP_RELAY_SENSE1 1
36 #define BP_RELAY_SENSE2 14
37 
38 #define BP_K_PAR 9
39 #define BP_K_SER 8
40 
41 #define BP_STANDBY 15
42 
43 #elif EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R3B4 || EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R5B12
44 
45 #define BP_LED_OUT1 2
46 #define BP_LED_OUT1_RED 3
47 #define BP_LED_SENSE1 5
48 
49 #define BP_LED_OUT2 13
50 #define BP_LED_SENSE2 12
51 
52 #define BP_RELAY_SENSE1 1
53 #define BP_RELAY_SENSE2 14
54 
55 #define BP_K_PAR 9
56 #define BP_K_SER 8
57 
58 #define BP_STANDBY 15
59 
60 #define BP_LED_CV1 7
61 #define BP_LED_CC1 6
62 
63 #define BP_LED_CV2 0
64 #define BP_LED_CC2 10
65 
66 #define BP_LED_PROG1 4
67 #define BP_LED_PROG2 11
68 
69 #endif
70 
71 #define CHANNELS_COUPLING_TYPE_NONE 0
72 #define CHANNELS_COUPLING_TYPE_PARALLEL 1
73 #define CHANNELS_COUPLING_TYPE_SERIES 2
74 #define CHANNELS_COUPLING_TYPE_TRACKED 3
75 
76 namespace eez {
77 namespace psu {
78 namespace bp {
79 
80 extern psu::TestResult g_testResult;
81 
82 void init();
83 
84 void switchStandby(bool on);
85 void switchOutput(Channel *channel, bool on);
86 void switchSense(Channel *channel, bool on);
87 
88 void switchProg(Channel *channel, bool on);
89 
90 void switchChannelCoupling(int channelCouplingType);
91 
92 #if EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R3B4 || EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R5B12
93 void cvLedSwitch(Channel *channel, bool on);
94 void ccLedSwitch(Channel *channel, bool on);
95 #endif
96 
97 }
98 }
99 } // namespace eez::psu::bp
Namespace for the everything from the EEZ.
Definition: actions.cpp:41