hw/bus/i2c: Set I2C pins to high state on startup
This is just to ensure they are in high state until controller is enabled.
#include <assert.h>
#include "defs/error.h"
+#include "hal/hal_gpio.h"
#include "hal/hal_i2c.h"
#include "bus/bus.h"
#include "bus/bus_debug.h"
@@ -161,6 +162,9 @@ bus_i2c_dev_init_func(struct os_dev *odev, void *arg)
BUS_DEBUG_POISON_DEV(dev);
+ hal_gpio_init_out(cfg->pin_scl, 1);
+ hal_gpio_init_out(cfg->pin_sda, 1);
+
hal_cfg.pin_scl = cfg->pin_scl;
hal_cfg.pin_sda = cfg->pin_sda;
rc = hal_i2c_init_hw(cfg->i2c_num, &hal_cfg);
