|
13 | 13 | from lib.pysquared.hardware.digitalio import initialize_pin |
14 | 14 | from lib.pysquared.hardware.imu.manager.lsm6dsox import LSM6DSOXManager |
15 | 15 | from lib.pysquared.hardware.light_sensor.manager.veml7700 import VEML7700Manager |
| 16 | +from lib.pysquared.hardware.load_switch.manager.loadswitch_manager import ( |
| 17 | + LoadSwitchManager, |
| 18 | +) |
16 | 19 | from lib.pysquared.hardware.magnetometer.manager.lis2mdl import LIS2MDLManager |
17 | 20 | from lib.pysquared.hardware.power_monitor.manager.ina219 import INA219Manager |
18 | 21 | from lib.pysquared.hardware.radio.manager.rfm9x import RFM9xManager |
@@ -173,28 +176,34 @@ def get_temp(sensor): |
173 | 176 | sband_radio, |
174 | 177 | ) |
175 | 178 |
|
| 179 | +load_switch_0 = LoadSwitchManager(FACE0_ENABLE, True) |
| 180 | +load_switch_1 = LoadSwitchManager(FACE1_ENABLE, True) |
| 181 | +load_switch_2 = LoadSwitchManager(FACE2_ENABLE, True) |
| 182 | +load_switch_3 = LoadSwitchManager(FACE3_ENABLE, True) |
| 183 | +load_switch_4 = LoadSwitchManager(FACE4_ENABLE, True) |
| 184 | + |
176 | 185 |
|
177 | 186 | # Face Control Helper Functions |
178 | 187 | def all_faces_off(): |
179 | 188 | """ |
180 | 189 | This function turns off all of the faces. Note the load switches are disabled low. |
181 | 190 | """ |
182 | | - FACE0_ENABLE.value = False |
183 | | - FACE1_ENABLE.value = False |
184 | | - FACE2_ENABLE.value = False |
185 | | - FACE3_ENABLE.value = False |
186 | | - FACE4_ENABLE.value = False |
| 191 | + load_switch_0.disable_load() |
| 192 | + load_switch_1.disable_load() |
| 193 | + load_switch_2.disable_load() |
| 194 | + load_switch_3.disable_load() |
| 195 | + load_switch_4.disable_load() |
187 | 196 |
|
188 | 197 |
|
189 | 198 | def all_faces_on(): |
190 | 199 | """ |
191 | 200 | This function turns on all of the faces. Note the load switches are enabled high. |
192 | 201 | """ |
193 | | - FACE0_ENABLE.value = True |
194 | | - FACE1_ENABLE.value = True |
195 | | - FACE2_ENABLE.value = True |
196 | | - FACE3_ENABLE.value = True |
197 | | - FACE4_ENABLE.value = True |
| 202 | + load_switch_0.enable_load() |
| 203 | + load_switch_1.enable_load() |
| 204 | + load_switch_2.enable_load() |
| 205 | + load_switch_3.enable_load() |
| 206 | + load_switch_4.enable_load() |
198 | 207 |
|
199 | 208 |
|
200 | 209 | ## Face Sensor Stuff ## |
|
0 commit comments