diff --git a/Makefile b/Makefile index d547af6..ae96c7f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PYSQUARED_VERSION ?= v2.0.0-alpha-25w40 +PYSQUARED_VERSION ?= v2.0.0-alpha-25w40a PYSQUARED ?= git+https://github.com/proveskit/pysquared@$(PYSQUARED_VERSION)\#subdirectory=circuitpython-workspaces/flight-software BOARD_MOUNT_POINT ?= "" BOARD_TTY_PORT ?= "" diff --git a/src/flight-software/repl.py b/src/flight-software/repl.py index b97c533..e4b10b3 100644 --- a/src/flight-software/repl.py +++ b/src/flight-software/repl.py @@ -17,6 +17,9 @@ from lib.pysquared.hardware.digitalio import initialize_pin from lib.pysquared.hardware.imu.manager.lsm6dsox import LSM6DSOXManager from lib.pysquared.hardware.light_sensor.manager.veml7700 import VEML7700Manager +from lib.pysquared.hardware.load_switch.manager.loadswitch_manager import ( + LoadSwitchManager, +) from lib.pysquared.hardware.magnetometer.manager.lis2mdl import LIS2MDLManager from lib.pysquared.hardware.power_monitor.manager.ina219 import INA219Manager from lib.pysquared.hardware.radio.manager.rfm9x import RFM9xManager @@ -33,6 +36,7 @@ rtc = MicrocontrollerManager() + logger: Logger = Logger( error_counter=Counter(0), colorized=False, @@ -169,27 +173,34 @@ def get_temp(sensor): PAYLOAD_PWR_ENABLE.direction = digitalio.Direction.OUTPUT +load_switch_0 = LoadSwitchManager(FACE0_ENABLE, True) # type: ignore , upstream on mcp TODO +load_switch_1 = LoadSwitchManager(FACE1_ENABLE, True) # type: ignore , upstream on mcp TODO +load_switch_2 = LoadSwitchManager(FACE2_ENABLE, True) # type: ignore , upstream on mcp TODO +load_switch_3 = LoadSwitchManager(FACE3_ENABLE, True) # type: ignore , upstream on mcp TODO +load_switch_4 = LoadSwitchManager(FACE4_ENABLE, True) # type: ignore , upstream on mcp TODO + + # Face Control Helper Functions def all_faces_off(): """ This function turns off all of the faces. Note the load switches are disabled low. """ - FACE0_ENABLE.value = False - FACE1_ENABLE.value = False - FACE2_ENABLE.value = False - FACE3_ENABLE.value = False - FACE4_ENABLE.value = False + load_switch_0.disable_load() + load_switch_1.disable_load() + load_switch_2.disable_load() + load_switch_3.disable_load() + load_switch_4.disable_load() def all_faces_on(): """ This function turns on all of the faces. Note the load switches are enabled high. """ - FACE0_ENABLE.value = True - FACE1_ENABLE.value = True - FACE2_ENABLE.value = True - FACE3_ENABLE.value = True - FACE4_ENABLE.value = True + load_switch_0.enable_load() + load_switch_1.enable_load() + load_switch_2.enable_load() + load_switch_3.enable_load() + load_switch_4.enable_load() ## Face Sensor Stuff ##