aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/e300/rev_b/i2c.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/e300/rev_b/i2c.h')
-rw-r--r--firmware/e300/rev_b/i2c.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/firmware/e300/rev_b/i2c.h b/firmware/e300/rev_b/i2c.h
new file mode 100644
index 000000000..5898e7e43
--- /dev/null
+++ b/firmware/e300/rev_b/i2c.h
@@ -0,0 +1,17 @@
+#ifndef I2C_H
+#define I2C_H
+
+#include "io.h"
+
+void i2c_init(io_pin_t sda, io_pin_t scl);
+bool i2c_read(io_pin_t sda, io_pin_t scl, uint8_t addr, uint8_t subaddr, uint8_t* value);
+bool i2c_write(io_pin_t sda, io_pin_t scl, uint8_t addr, uint8_t subaddr, uint8_t value);
+
+void i2c_init_ex(io_pin_t sda, io_pin_t scl, bool pull_up);
+bool i2c_read_ex(io_pin_t sda, io_pin_t scl, uint8_t addr, uint8_t subaddr, uint8_t* value, bool pull_up);
+bool i2c_read2_ex(io_pin_t sda, io_pin_t scl, uint8_t addr, uint8_t subaddr, uint8_t* value, bool pull_up);
+bool i2c_write_ex(io_pin_t sda, io_pin_t scl, uint8_t addr, uint8_t subaddr, uint8_t value, bool pull_up);
+
+extern volatile bool _i2c_disable_ack_check;
+
+#endif // I2C_H