summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-10-25 16:56:15 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-10-25 16:56:15 +0200
commit6c5fc03b3e00d93d87511ad50396808913ef17f9 (patch)
tree96df27f367d29fab3550e5b088eb80ef9b4c4d6c /src
parent6da18337a9e4c8c68829df09befddf4582584135 (diff)
softi2c: Also support pullup with timer=1
derrrrrrrp.
Diffstat (limited to 'src')
-rw-r--r--src/driver/soft_i2c.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/driver/soft_i2c.cc b/src/driver/soft_i2c.cc
index de634b1..3679514 100644
--- a/src/driver/soft_i2c.cc
+++ b/src/driver/soft_i2c.cc
@@ -198,6 +198,18 @@ inline void await_timer()
signed char SoftI2C::setup()
{
+#ifdef SOFTI2C_PULLUP_EXTERNAL
+ gpio.output(sda_pull);
+ gpio.output(scl_pull);
+#endif
+#ifdef SOFTI2C_PULLUP_FIXED_GPIO
+#if MULTIPASS_ARCH_msp430fr5969lp
+ gpio.output(GPIO::p1_4, 1);
+ gpio.output(GPIO::p1_5, 1);
+#else
+#error "softi2c_pullup=gpio not supported on this architecture"
+#endif /* MULTIPASS_ARCH_* */
+#endif /* SOFTI2C_PULLUP_FIXED_GPIO */
SDA_HIGH;
SCL_HIGH;
/*