Src/main.c
/**
  * @brief I2C1 Initialization Function
  * @param None
  * @retval None
  */
@brief I2C1 Initialization Function
@param None
@retval None
@brief I2C1 Initialization Function @param None @retval None
static void MX_I2C1_Init(void)
{
  hi2c1.Instance = I2C1;
  hi2c1.Init.Timing = 0x10707DBC;
  hi2c1.Init.OwnAddress1 = 164;
  hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
  hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
  hi2c1.Init.OwnAddress2 = 0;
  hi2c1.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
  hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
  hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
  if (HAL_I2C_Init(&hi2c1) != HAL_OK)
  {
    Error_Handler();
  }
  if (HAL_I2CEx_ConfigAnalogFilter(&hi2c1, I2C_ANALOGFILTER_ENABLE) != HAL_OK)
  {
    Error_Handler();
  }
  if (HAL_I2CEx_ConfigDigitalFilter(&hi2c1, 0) != HAL_OK)
  {
    Error_Handler();
  }
}
static void MX_I2C1_Init ( void ) { hi2c1 . Instance = I2C1 ; hi2c1 . Init . Timing = 0x10707DBC ; hi2c1 . Init . OwnAddress1 = 164 ; hi2c1 . Init . AddressingMode = I2C_ADDRESSINGMODE_7BIT ; hi2c1 . Init . DualAddressMode = I2C_DUALADDRESS_DISABLE ; hi2c1 . Init . OwnAddress2 = 0 ; hi2c1 . Init . OwnAddress2Masks = I2C_OA2_NOMASK ; hi2c1 . Init . GeneralCallMode = I2C_GENERALCALL_DISABLE ; hi2c1 . Init . NoStretchMode = I2C_NOSTRETCH_DISABLE ; if ( HAL_I2C_Init ( & hi2c1 ) != HAL_OK ) { Error_Handler ( ) ; } if ( HAL_I2CEx_ConfigAnalogFilter ( & hi2c1 , I2C_ANALOGFILTER_ENABLE ) != HAL_OK ) { Error_Handler ( ) ; } if ( HAL_I2CEx_ConfigDigitalFilter ( & hi2c1 , 0 ) != HAL_OK ) { Error_Handler ( ) ; } }
@brief I2C1 Initialization Function
 @param None
 @retval None
@brief I2C1 Initialization Function @param None @retval None
/* USER CODE BEGIN I2C1_Init 0 */ /* USER CODE END I2C1_Init 0 */ /* USER CODE BEGIN I2C1_Init 1 */ /* USER CODE END I2C1_Init 1 */ /** Configure Analogue filter
  */ /** Configure Digital filter
  */ /* USER CODE BEGIN I2C1_Init 2 */ /* USER CODE END I2C1_Init 2 */