|
18 | 18 | from lib.pysquared.hardware.digitalio import initialize_pin |
19 | 19 | from lib.pysquared.hardware.imu.manager.lsm6dsox import LSM6DSOXManager |
20 | 20 | from lib.pysquared.hardware.light_sensor.manager.veml7700 import VEML7700Manager |
| 21 | +from lib.pysquared.hardware.load_switch.manager.loadswitch_manager import ( |
| 22 | + LoadSwitchManager, |
| 23 | +) |
21 | 24 | from lib.pysquared.hardware.magnetometer.manager.lis2mdl import LIS2MDLManager |
22 | 25 | from lib.pysquared.hardware.power_monitor.manager.ina219 import INA219Manager |
23 | 26 | from lib.pysquared.hardware.radio.manager.rfm9x import RFM9xManager |
|
34 | 37 |
|
35 | 38 | rtc = MicrocontrollerManager() |
36 | 39 |
|
| 40 | + |
37 | 41 | logger: Logger = Logger( |
38 | 42 | error_counter=Counter(0), |
39 | 43 | colorized=False, |
@@ -170,27 +174,34 @@ def get_temp(sensor): |
170 | 174 | PAYLOAD_PWR_ENABLE.direction = digitalio.Direction.OUTPUT |
171 | 175 |
|
172 | 176 |
|
| 177 | +load_switch_0 = LoadSwitchManager(FACE0_ENABLE, True) # type: ignore , upstream on mcp TODO |
| 178 | +load_switch_1 = LoadSwitchManager(FACE1_ENABLE, True) # type: ignore , upstream on mcp TODO |
| 179 | +load_switch_2 = LoadSwitchManager(FACE2_ENABLE, True) # type: ignore , upstream on mcp TODO |
| 180 | +load_switch_3 = LoadSwitchManager(FACE3_ENABLE, True) # type: ignore , upstream on mcp TODO |
| 181 | +load_switch_4 = LoadSwitchManager(FACE4_ENABLE, True) # type: ignore , upstream on mcp TODO |
| 182 | + |
| 183 | + |
173 | 184 | # Face Control Helper Functions |
174 | 185 | def all_faces_off(): |
175 | 186 | """ |
176 | 187 | This function turns off all of the faces. Note the load switches are disabled low. |
177 | 188 | """ |
178 | | - FACE0_ENABLE.value = False |
179 | | - FACE1_ENABLE.value = False |
180 | | - FACE2_ENABLE.value = False |
181 | | - FACE3_ENABLE.value = False |
182 | | - FACE4_ENABLE.value = False |
| 189 | + load_switch_0.disable_load() |
| 190 | + load_switch_1.disable_load() |
| 191 | + load_switch_2.disable_load() |
| 192 | + load_switch_3.disable_load() |
| 193 | + load_switch_4.disable_load() |
183 | 194 |
|
184 | 195 |
|
185 | 196 | def all_faces_on(): |
186 | 197 | """ |
187 | 198 | This function turns on all of the faces. Note the load switches are enabled high. |
188 | 199 | """ |
189 | | - FACE0_ENABLE.value = True |
190 | | - FACE1_ENABLE.value = True |
191 | | - FACE2_ENABLE.value = True |
192 | | - FACE3_ENABLE.value = True |
193 | | - FACE4_ENABLE.value = True |
| 200 | + load_switch_0.enable_load() |
| 201 | + load_switch_1.enable_load() |
| 202 | + load_switch_2.enable_load() |
| 203 | + load_switch_3.enable_load() |
| 204 | + load_switch_4.enable_load() |
194 | 205 |
|
195 | 206 |
|
196 | 207 | file_validator = FileValidationManager(logger) |
|
0 commit comments