summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/i2c.h
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2021-12-01 01:20:10 +0100
committerUros Majstorovic <majstor@majstor.org>2021-12-01 01:20:10 +0100
commit7ded8116d90081851e0ddb1b4bdd77b645f6535c (patch)
treedc89dbc4269fc0d2e3ac0e43ca8a533371d21531 /fw/fe310/eos/i2c.h
parent5506d89d97db87f78ab2ba4715c4248a3d49f98f (diff)
i2c added 16 bit register read/write
Diffstat (limited to 'fw/fe310/eos/i2c.h')
-rw-r--r--fw/fe310/eos/i2c.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/fw/fe310/eos/i2c.h b/fw/fe310/eos/i2c.h
index 2da0517..b407f8d 100644
--- a/fw/fe310/eos/i2c.h
+++ b/fw/fe310/eos/i2c.h
@@ -1,10 +1,12 @@
#include <stdint.h>
+#define EOS_I2C_SPEED 100000
+
int eos_i2c_init(uint8_t wakeup_cause);
-int eos_i2c_start(uint32_t baud_rate);
+int eos_i2c_start(void);
void eos_i2c_stop(void);
-void eos_i2c_set_baud_rate(uint32_t baud_rate);
-int eos_i2c_read(uint8_t addr, uint8_t reg, uint8_t *buffer, uint16_t len);
-int eos_i2c_write(uint8_t addr, uint8_t reg, uint8_t *buffer, uint16_t len);
-int eos_i2c_read8(uint8_t addr, uint8_t reg, uint8_t *data);
-int eos_i2c_write8(uint8_t addr, uint8_t reg, uint8_t data);
+void eos_i2c_speed(uint32_t baud_rate);
+int eos_i2c_read8(uint8_t addr, uint8_t reg, uint8_t *buffer, uint16_t len);
+int eos_i2c_read16(uint8_t addr, uint16_t reg, uint8_t *buffer, uint16_t len);
+int eos_i2c_write8(uint8_t addr, uint8_t reg, uint8_t *buffer, uint16_t len);
+int eos_i2c_write16(uint8_t addr, uint16_t reg, uint8_t *buffer, uint16_t len);