Skip to content

Commit

Permalink
(#4, #5, #13) Corrected ioc from main
Browse files Browse the repository at this point in the history
  • Loading branch information
benthacher committed Mar 25, 2024
1 parent 1b036f2 commit 80e57c5
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 108 deletions.
2 changes: 1 addition & 1 deletion CM4/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ static void MX_GPIO_Init(void)

/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOF_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOE_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
__HAL_RCC_GPIOG_CLK_ENABLE();
Expand Down
18 changes: 4 additions & 14 deletions CM4/Core/Src/stm32h7xx_hal_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,20 +340,12 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
/* Peripheral clock enable */
__HAL_RCC_UART4_CLK_ENABLE();

__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
/**UART4 GPIO Configuration
PA0 ------> UART4_TX
PB8 ------> UART4_RX
PB9 ------> UART4_TX
*/
GPIO_InitStruct.Pin = GPIO_PIN_0;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF8_UART4;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
Expand Down Expand Up @@ -384,12 +376,10 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
__HAL_RCC_UART4_CLK_DISABLE();

/**UART4 GPIO Configuration
PA0 ------> UART4_TX
PB8 ------> UART4_RX
PB9 ------> UART4_TX
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0);

HAL_GPIO_DeInit(GPIOB, GPIO_PIN_8);
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_8|GPIO_PIN_9);

/* USER CODE BEGIN UART4_MspDeInit 1 */

Expand Down
28 changes: 16 additions & 12 deletions CM7/Core/Src/stm32h7xx_hal_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
__HAL_RCC_SPI2_CLK_ENABLE();

__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
/**SPI2 GPIO Configuration
PC2_C ------> SPI2_MISO
PD3 ------> SPI2_SCK
PB10 ------> SPI2_SCK
*/
GPIO_InitStruct.Pin = GPIO_PIN_2;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
Expand All @@ -455,12 +455,12 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

GPIO_InitStruct.Pin = GPIO_PIN_3;
GPIO_InitStruct.Pin = GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF5_SPI2;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

/* USER CODE BEGIN SPI2_MspInit 1 */

Expand Down Expand Up @@ -592,11 +592,11 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)

/**SPI2 GPIO Configuration
PC2_C ------> SPI2_MISO
PD3 ------> SPI2_SCK
PB10 ------> SPI2_SCK
*/
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_2);

HAL_GPIO_DeInit(GPIOD, GPIO_PIN_3);
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_10);

/* USER CODE BEGIN SPI2_MspDeInit 1 */

Expand Down Expand Up @@ -696,10 +696,11 @@ void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef* htim_encoder)

__HAL_RCC_GPIOA_CLK_ENABLE();
/**TIM2 GPIO Configuration
PA0 ------> TIM2_CH1
PA1 ------> TIM2_CH2
PA15 (JTDI) ------> TIM2_CH1
PA2 ------> TIM2_CH3
*/
GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_15;
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
Expand All @@ -722,8 +723,9 @@ void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef* htim_encoder)
/**TIM4 GPIO Configuration
PD12 ------> TIM4_CH1
PD13 ------> TIM4_CH2
PD14 ------> TIM4_CH3
*/
GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13;
GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
Expand Down Expand Up @@ -900,10 +902,11 @@ void HAL_TIM_Encoder_MspDeInit(TIM_HandleTypeDef* htim_encoder)
__HAL_RCC_TIM2_CLK_DISABLE();

/**TIM2 GPIO Configuration
PA0 ------> TIM2_CH1
PA1 ------> TIM2_CH2
PA15 (JTDI) ------> TIM2_CH1
PA2 ------> TIM2_CH3
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_1|GPIO_PIN_15);
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2);

/* USER CODE BEGIN TIM2_MspDeInit 1 */

Expand All @@ -920,8 +923,9 @@ void HAL_TIM_Encoder_MspDeInit(TIM_HandleTypeDef* htim_encoder)
/**TIM4 GPIO Configuration
PD12 ------> TIM4_CH1
PD13 ------> TIM4_CH2
PD14 ------> TIM4_CH3
*/
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_12|GPIO_PIN_13);
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14);

/* USER CODE BEGIN TIM4_MspDeInit 1 */

Expand Down
2 changes: 1 addition & 1 deletion Makefile/CM4/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##########################################################################################################################
# File automatically-generated by tool: [projectgenerator] version: [4.2.0-B44] date: [Mon Mar 25 15:30:34 EDT 2024]
# File automatically-generated by tool: [projectgenerator] version: [4.2.0-B44] date: [Mon Mar 25 15:47:23 EDT 2024]
##########################################################################################################################

# ------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Makefile/CM7/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##########################################################################################################################
# File automatically-generated by tool: [projectgenerator] version: [4.2.0-B44] date: [Mon Mar 25 15:30:34 EDT 2024]
# File automatically-generated by tool: [projectgenerator] version: [4.2.0-B44] date: [Mon Mar 25 15:47:23 EDT 2024]
##########################################################################################################################

# ------------------------------------------------
Expand Down
Loading

0 comments on commit 80e57c5

Please sign in to comment.