summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/i2c.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2021-12-09 23:50:58 +0100
committerUros Majstorovic <majstor@majstor.org>2021-12-09 23:50:58 +0100
commit7d03a941be6e9226e71cb5f5b4f7949e06bbfb02 (patch)
treecde9218dbe97837f972c426552c463f5f2a6a256 /fw/fe310/eos/i2c.c
parent9c8f5a5e8f11e4a5012d55b96afae290242b8fdd (diff)
improved init process
Diffstat (limited to 'fw/fe310/eos/i2c.c')
-rw-r--r--fw/fe310/eos/i2c.c11
1 files changed, 4 insertions, 7 deletions
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) {