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