From a0db2986b59212c296a25f941c98ce42c51fd394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Thu, 25 Feb 2021 12:50:57 +0300 Subject: [PATCH] Adjust I2C pins configuration: disable pullup and set speed to low (#352) * Adjust I2C pins configuration: disable pullup and set speed to low * promote i2c owner Co-authored-by: aanper --- .github/CODEOWNERS | 3 +++ firmware/targets/f4/Src/i2c.c | 4 ++-- firmware/targets/f5/Src/i2c.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 91bd385a..bcb096b3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -50,6 +50,9 @@ firmware/targets/f4/api-hal/api-hal-vcp.c @skotopes firmware/targets/f4/api-hal/api-hal.c @DrZlo13 firmware/targets/f4/api-hal/api-interrupts.c @DrZlo13 +firmware/targets/f4/Src/i2c.c @skotopes +firmware/targets/f5/Src/i2c.c @skotopes + # BLE firmware/targets/f4/ble-glue/** @skotopes diff --git a/firmware/targets/f4/Src/i2c.c b/firmware/targets/f4/Src/i2c.c index 3f2b619e..badd682f 100644 --- a/firmware/targets/f4/Src/i2c.c +++ b/firmware/targets/f4/Src/i2c.c @@ -75,8 +75,8 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef* i2cHandle) */ GPIO_InitStruct.Pin = I2C_SCL_Pin|I2C_SDA_Pin; GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Alternate = GPIO_AF4_I2C1; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); diff --git a/firmware/targets/f5/Src/i2c.c b/firmware/targets/f5/Src/i2c.c index 3f2b619e..badd682f 100644 --- a/firmware/targets/f5/Src/i2c.c +++ b/firmware/targets/f5/Src/i2c.c @@ -75,8 +75,8 @@ void HAL_I2C_MspInit(I2C_HandleTypeDef* i2cHandle) */ GPIO_InitStruct.Pin = I2C_SCL_Pin|I2C_SDA_Pin; GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Alternate = GPIO_AF4_I2C1; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);