diff options
Diffstat (limited to 'stm32f091/setup.c')
-rw-r--r-- | stm32f091/setup.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/stm32f091/setup.c b/stm32f091/setup.c index 42f54b3..d10393c 100644 --- a/stm32f091/setup.c +++ b/stm32f091/setup.c @@ -49,18 +49,18 @@ void SystemClock_Config() { } void MX_I2C2_Init() { - hi2c2.Instance = I2C2; - hi2c2.Init.Timing = 0x20303E5D; - hi2c2.Init.OwnAddress1 = 0; - hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; - hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; - hi2c2.Init.OwnAddress2 = 0; - hi2c2.Init.OwnAddress2Masks = I2C_OA2_NOMASK; - hi2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; - hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; - if (HAL_I2C_Init(&hi2c2) != HAL_OK) return Error_Handler(); - if (HAL_I2CEx_ConfigAnalogFilter(&hi2c2, I2C_ANALOGFILTER_ENABLE) != HAL_OK) return Error_Handler(); - if (HAL_I2CEx_ConfigDigitalFilter(&hi2c2, 0) != HAL_OK) return Error_Handler(); + hi2c1.Instance = I2C1; + hi2c1.Init.Timing = 0x2000090E; + hi2c1.Init.OwnAddress1 = 0; + 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) return Error_Handler(); + if (HAL_I2CEx_ConfigAnalogFilter(&hi2c1, I2C_ANALOGFILTER_ENABLE) != HAL_OK) return Error_Handler(); + if (HAL_I2CEx_ConfigDigitalFilter(&hi2c1, 0) != HAL_OK) return Error_Handler(); } void MX_USART2_UART_Init() { |