88 GPIO_InitTypeDef GPIO_InitStruct = {0};
89 if(hi2c->Instance==I2C1)
95 __HAL_RCC_GPIOB_CLK_ENABLE();
100 GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9;
101 GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
102 GPIO_InitStruct.Pull = GPIO_NOPULL;
103 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
104 GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;
105 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
108 __HAL_RCC_I2C1_CLK_ENABLE();
201 GPIO_InitTypeDef GPIO_InitStruct = {0};
202 if(huart->Instance==USART1)
208 __HAL_RCC_USART1_CLK_ENABLE();
210 __HAL_RCC_GPIOA_CLK_ENABLE();
215 GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10;
216 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
217 GPIO_InitStruct.Pull = GPIO_NOPULL;
218 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
219 GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
220 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
: Header for main.c file. This file contains the common defines of the application.