From 838c6195bb7be9e879c0ace990ecff8051b935a0 Mon Sep 17 00:00:00 2001 From: "Jasper v. Blanckenburg" Date: Sun, 12 Mar 2023 21:15:32 +0100 Subject: [PATCH] Configure PROFET --- Core/Src/slave_monitoring.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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() {