diff --git a/Core/Src/slave_monitoring.c b/Core/Src/slave_monitoring.c index 3ce9f11..c59012b 100644 --- a/Core/Src/slave_monitoring.c +++ b/Core/Src/slave_monitoring.c @@ -1,8 +1,11 @@ #include "slave_monitoring.h" -#include "stm32f3xx_hal.h" +#include "main.h" #include "ts_state_machine.h" +#include "stm32f3xx_hal.h" +#include "stm32f3xx_hal_gpio.h" + #include #include @@ -18,6 +21,14 @@ void slaves_init() { memset(&slaves[i].voltages, 0, sizeof(slaves[i].voltages)); memset(&slaves[i].temperatures, 0, sizeof(slaves[i].temperatures)); } + + HAL_GPIO_WritePin(SLAVE_POWER_0_GPIO_Port, SLAVE_POWER_0_Pin, GPIO_PIN_SET); + HAL_GPIO_WritePin(SLAVE_POWER_1_GPIO_Port, SLAVE_POWER_1_Pin, GPIO_PIN_RESET); + HAL_GPIO_WritePin(SLAVE_POWER_DSEL_GPIO_Port, SLAVE_POWER_DSEL_Pin, + GPIO_PIN_RESET); + // TODO: Enable & read out current + HAL_GPIO_WritePin(SLAVE_POWER_DEN_GPIO_Port, SLAVE_POWER_DEN_Pin, + GPIO_PIN_RESET); } void slaves_check() {