text: /* USER CODE BEGIN Header */
  /**
    ******************************************************************************
    * @file    I2C/I2C_TwoBoards_ComPolling/Src/stm32wlxx_hal_msp.c
    * @author  MCD Application Team
    * @brief   HAL MSP module.
    ******************************************************************************
    * @attention
    *
    * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
    * All rights reserved.</center></h2>
    *
    * This software component is licensed by ST under BSD 3-Clause license,
    * the "License"; You may not use this file except in compliance with the
    * License. You may obtain a copy of the License at:
    *                        opensource.org/licenses/BSD-3-Clause
    *
    ******************************************************************************
    */
  /* USER CODE END Header */
  
  /* Includes ------------------------------------------------------------------*/
  #include "main.h"
  /* USER CODE BEGIN Includes */
  
  /* USER CODE END Includes */
  
  /* Private typedef -----------------------------------------------------------*/
  /* USER CODE BEGIN TD */
  
  /* USER CODE END TD */
  
  /* Private define ------------------------------------------------------------*/
  /* USER CODE BEGIN Define */
  
  /* USER CODE END Define */
  
  /* Private macro -------------------------------------------------------------*/
  /* USER CODE BEGIN Macro */
  
  /* USER CODE END Macro */
  
  /* Private variables ---------------------------------------------------------*/
  /* USER CODE BEGIN PV */
  
  /* USER CODE END PV */
  
  /* Private function prototypes -----------------------------------------------*/
  /* USER CODE BEGIN PFP */
  
  /* USER CODE END PFP */
  
  /* External functions --------------------------------------------------------*/
  /* USER CODE BEGIN ExternalFunctions */
  
  /* USER CODE END ExternalFunctions */
  
  /* USER CODE BEGIN 0 */
  
  /* USER CODE END 0 */
  /**
    * Initializes the Global MSP.
    */
  void HAL_MspInit(void)
  {
    /* USER CODE BEGIN MspInit 0 */
  
    /* USER CODE END MspInit 0 */
  
    /* System interrupt init*/
  
    /* USER CODE BEGIN MspInit 1 */
  
    /* USER CODE END MspInit 1 */
  }
  
  /**
  * @brief I2C MSP Initialization
  * This function configures the hardware resources used in this example
  * @param hi2c: I2C handle pointer
  * @retval None
  */
  void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c)
  {
    GPIO_InitTypeDef GPIO_InitStruct = {0};
    RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
    if(hi2c->Instance==I2C1)
    {
    /* USER CODE BEGIN I2C1_MspInit 0 */
      
    /* USER CODE END I2C1_MspInit 0 */
    /** Initializes the peripherals clocks
    */
      PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2C1;
      PeriphClkInitStruct.I2c1ClockSelection = RCC_I2C1CLKSOURCE_PCLK1;
      if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
      {
        Error_Handler();
      }
  
      __HAL_RCC_GPIOB_CLK_ENABLE();
      /**I2C1 GPIO Configuration
      PB7     ------> I2C1_SDA
      PB8     ------> I2C1_SCL
      */
      GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8;
      GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
      GPIO_InitStruct.Pull = GPIO_PULLUP;
      GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
      GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;
      HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
  
      /* Peripheral clock enable */
      __HAL_RCC_I2C1_CLK_ENABLE();
    /* USER CODE BEGIN I2C1_MspInit 1 */
  
    /* USER CODE END I2C1_MspInit 1 */
    }
  
  }
  
  /**
  * @brief I2C MSP De-Initialization
  * This function freeze the hardware resources used in this example
  * @param hi2c: I2C handle pointer
  * @retval None
  */
  void HAL_I2C_MspDeInit(I2C_HandleTypeDef* hi2c)
  {
    if(hi2c->Instance==I2C1)
    {
    /* USER CODE BEGIN I2C1_MspDeInit 0 */
  
    /* USER CODE END I2C1_MspDeInit 0 */
      /* Peripheral clock disable */
      __HAL_RCC_I2C1_CLK_DISABLE();
  
      /**I2C1 GPIO Configuration
      PB7     ------> I2C1_SDA
      PB8     ------> I2C1_SCL
      */
      HAL_GPIO_DeInit(GPIOB, GPIO_PIN_7);
  
      HAL_GPIO_DeInit(GPIOB, GPIO_PIN_8);
  
    /* USER CODE BEGIN I2C1_MspDeInit 1 */
  
    /* USER CODE END I2C1_MspDeInit 1 */
    }
  
  }
  
  /* USER CODE BEGIN 1 */
  
  /* USER CODE END 1 */
  
  /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
  