|
PER Firmware
|
#include "auto_switch.h"#include "common/can_library/faults_common.h"#include "common/can_library/generated/PDU.h"#include "common/phal/gpio.h"#include "led.h"#include "main.h"Functions | |
| uint16_t | getMuxReading (uint8_t channel) |
| void | setSwitch (switches_t auto_switch_enum, bool state) |
| Enable or disable a switch. | |
| bool | getSwitchStatus (switches_t auto_switch_enum) |
| Check if a switch is enabled. | |
| void | autoSwitchPeriodic () |
| Combined function that calls updateVoltage() and updateCurrent() | |
| void | checkSwitchFaults () |
| Checks the status of various auto switches to ensure rails are ok. Sets fault and activates blink indicator if not.. | |
Variables | |
| auto_switches_t | auto_switches |
| void autoSwitchPeriodic | ( | ) |
Combined function that calls updateVoltage() and updateCurrent()
Voltage on each rail is stored at: auto_switches.voltage.in_24v auto_switches.voltage.out_5v auto_switches.voltage.out_3v3
Current through each switch is stored at: auto_switches.current[auto_switch_enum]
| bool getSwitchStatus | ( | switches_t | auto_switch_enum | ) |
Check if a switch is enabled.
| auto_switch_enum | Switch to check |
| void setSwitch | ( | switches_t | auto_switch_enum, |
| bool | state ) |
Enable or disable a switch.
| auto_switch_enum | Switch to enable or disable |
| state | 1 to enable, 0 to disable |