Skip to content
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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 ?= ""
Expand Down
31 changes: 21 additions & 10 deletions src/flight-software/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,6 +36,7 @@

rtc = MicrocontrollerManager()


logger: Logger = Logger(
error_counter=Counter(0),
colorized=False,
Expand Down Expand Up @@ -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 ##
Expand Down