diff --git a/firmware/quadruna/BMS/boot/cubemx/BMS_boot.ioc.md5 b/firmware/quadruna/BMS/boot/cubemx/BMS_boot.ioc.md5 index 6c719a5a62..96368edafb 100644 --- a/firmware/quadruna/BMS/boot/cubemx/BMS_boot.ioc.md5 +++ b/firmware/quadruna/BMS/boot/cubemx/BMS_boot.ioc.md5 @@ -1 +1 @@ -d8e20164eb3cb9792bfa189df427bdba \ No newline at end of file +9a4a0a62090e5de58aec23391bcfd148 \ No newline at end of file diff --git a/firmware/quadruna/BMS/boot/cubemx/Inc/main.h b/firmware/quadruna/BMS/boot/cubemx/Inc/main.h index 36f8d22ee6..c7f84f17e6 100644 --- a/firmware/quadruna/BMS/boot/cubemx/Inc/main.h +++ b/firmware/quadruna/BMS/boot/cubemx/Inc/main.h @@ -60,6 +60,20 @@ extern "C" /* Private defines -----------------------------------------------------------*/ #define nBOOT_EN_Pin GPIO_PIN_13 #define nBOOT_EN_GPIO_Port GPIOC +#define AIR_P_EN_Pin GPIO_PIN_2 +#define AIR_P_EN_GPIO_Port GPIOC +#define PRE_CHARGE_END_Pin GPIO_PIN_3 +#define PRE_CHARGE_END_GPIO_Port GPIOC +#define BSPD_TEST_EN_Pin GPIO_PIN_4 +#define BSPD_TEST_EN_GPIO_Port GPIOA +#define nCHIMERA_Pin GPIO_PIN_5 +#define nCHIMERA_GPIO_Port GPIOA +#define DEBUG_LED_Pin GPIO_PIN_7 +#define DEBUG_LED_GPIO_Port GPIOE +#define SPI_CS_Pin GPIO_PIN_12 +#define SPI_CS_GPIO_Port GPIOB +#define BMS_OK_Pin GPIO_PIN_9 +#define BMS_OK_GPIO_Port GPIOD /* USER CODE BEGIN Private defines */ diff --git a/firmware/quadruna/BMS/boot/cubemx/Src/main.c b/firmware/quadruna/BMS/boot/cubemx/Src/main.c index 5da23e77f4..c6d32a4614 100644 --- a/firmware/quadruna/BMS/boot/cubemx/Src/main.c +++ b/firmware/quadruna/BMS/boot/cubemx/Src/main.c @@ -348,7 +348,25 @@ static void MX_GPIO_Init(void) /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOC, AIR_P_EN_Pin | PRE_CHARGE_END_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(BSPD_TEST_EN_GPIO_Port, BSPD_TEST_EN_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(DEBUG_LED_GPIO_Port, DEBUG_LED_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(SPI_CS_GPIO_Port, SPI_CS_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(BMS_OK_GPIO_Port, BMS_OK_Pin, GPIO_PIN_SET); /*Configure GPIO pin : nBOOT_EN_Pin */ GPIO_InitStruct.Pin = nBOOT_EN_Pin; @@ -356,6 +374,47 @@ static void MX_GPIO_Init(void) GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(nBOOT_EN_GPIO_Port, &GPIO_InitStruct); + /*Configure GPIO pins : AIR_P_EN_Pin PRE_CHARGE_END_Pin */ + GPIO_InitStruct.Pin = AIR_P_EN_Pin | PRE_CHARGE_END_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + /*Configure GPIO pin : BSPD_TEST_EN_Pin */ + GPIO_InitStruct.Pin = BSPD_TEST_EN_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(BSPD_TEST_EN_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : nCHIMERA_Pin */ + GPIO_InitStruct.Pin = nCHIMERA_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_PULLUP; + HAL_GPIO_Init(nCHIMERA_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : DEBUG_LED_Pin */ + GPIO_InitStruct.Pin = DEBUG_LED_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(DEBUG_LED_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : SPI_CS_Pin */ + GPIO_InitStruct.Pin = SPI_CS_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_PULLDOWN; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(SPI_CS_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : BMS_OK_Pin */ + GPIO_InitStruct.Pin = BMS_OK_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(BMS_OK_GPIO_Port, &GPIO_InitStruct); + /* USER CODE BEGIN MX_GPIO_Init_2 */ /* USER CODE END MX_GPIO_Init_2 */ } diff --git a/firmware/quadruna/FSM/boot/cubemx/FSM_boot.ioc.md5 b/firmware/quadruna/FSM/boot/cubemx/FSM_boot.ioc.md5 index 1e60851738..ef73117948 100644 --- a/firmware/quadruna/FSM/boot/cubemx/FSM_boot.ioc.md5 +++ b/firmware/quadruna/FSM/boot/cubemx/FSM_boot.ioc.md5 @@ -1 +1 @@ -a782ba6b8ff8e7b48f622b3d0790a73b \ No newline at end of file +062b8c6254530dd03f43de74949f5ad9 \ No newline at end of file diff --git a/firmware/quadruna/FSM/boot/cubemx/Inc/main.h b/firmware/quadruna/FSM/boot/cubemx/Inc/main.h index 14dfdba1b4..c11738b8eb 100644 --- a/firmware/quadruna/FSM/boot/cubemx/Inc/main.h +++ b/firmware/quadruna/FSM/boot/cubemx/Inc/main.h @@ -58,6 +58,8 @@ extern "C" /* USER CODE END EFP */ /* Private defines -----------------------------------------------------------*/ +#define LED_Pin GPIO_PIN_13 +#define LED_GPIO_Port GPIOC #define nBOOT_EN_Pin GPIO_PIN_15 #define nBOOT_EN_GPIO_Port GPIOA diff --git a/firmware/quadruna/FSM/boot/cubemx/Src/main.c b/firmware/quadruna/FSM/boot/cubemx/Src/main.c index 4a639b054e..23f1372a45 100644 --- a/firmware/quadruna/FSM/boot/cubemx/Src/main.c +++ b/firmware/quadruna/FSM/boot/cubemx/Src/main.c @@ -311,10 +311,21 @@ static void MX_GPIO_Init(void) /* USER CODE END MX_GPIO_Init_1 */ /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin : LED_Pin */ + GPIO_InitStruct.Pin = LED_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); + /*Configure GPIO pin : nBOOT_EN_Pin */ GPIO_InitStruct.Pin = nBOOT_EN_Pin; GPIO_InitStruct.Mode = GPIO_MODE_INPUT;