From 7d03a941be6e9226e71cb5f5b4f7949e06bbfb02 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 9 Dec 2021 23:50:58 +0100 Subject: improved init process --- fw/fe310/eos/i2c.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'fw/fe310/eos/i2c.c') diff --git a/fw/fe310/eos/i2c.c b/fw/fe310/eos/i2c.c index 63dd7e6..a507af1 100644 --- a/fw/fe310/eos/i2c.c +++ b/fw/fe310/eos/i2c.c @@ -10,19 +10,16 @@ #include "i2c.h" int eos_i2c_init(uint8_t wakeup_cause) { - eos_i2c_stop(); eos_i2c_speed(EOS_I2C_SPEED); + // eos_i2c_start(); return EOS_OK; } -int eos_i2c_start(void) { - if (eos_i2s_running()) return EOS_ERR_BUSY; - - GPIO_REG(GPIO_IOF_EN) |= IOF0_I2C0_MASK; +void eos_i2c_start(void) { I2C0_REGB(I2C_CONTROL) |= I2C_CONTROL_EN; - - return EOS_OK; + GPIO_REG(GPIO_IOF_SEL) &= ~IOF0_I2C0_MASK; + GPIO_REG(GPIO_IOF_EN) |= IOF0_I2C0_MASK; } void eos_i2c_stop(void) { -- cgit v1.2.3