summaryrefslogtreecommitdiff
path: root/src/arch/msp430fr5969lp
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-10-24 10:20:19 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-10-24 10:20:19 +0200
commitf6c24bc802f2cb5ec959a768b60dadc957f113cb (patch)
tree7052d5ad788702893e6002b3107dcd1883eeab0b /src/arch/msp430fr5969lp
parent7dac0cccc846d4452293b47b40d43f6b50ebcc33 (diff)
I2C: Add support for manual / always-on gpio pullups
Diffstat (limited to 'src/arch/msp430fr5969lp')
-rw-r--r--src/arch/msp430fr5969lp/driver/i2c.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/arch/msp430fr5969lp/driver/i2c.cc b/src/arch/msp430fr5969lp/driver/i2c.cc
index 5a47770..cb6fa79 100644
--- a/src/arch/msp430fr5969lp/driver/i2c.cc
+++ b/src/arch/msp430fr5969lp/driver/i2c.cc
@@ -10,6 +10,10 @@ volatile unsigned short old_ifg = 0;
signed char I2C::setup()
{
+#ifdef I2C_PULLUP_FIXED_GPIO
+ P1DIR |= BIT4 | BIT5;
+ P1OUT |= BIT4 | BIT5;
+#endif
UCB0CTL1 = UCSWRST;
UCB0CTLW0 = UCMODE_3 | UCMST | UCSYNC | UCSSEL_2 | UCSWRST | UCCLTO_1;
UCB0BRW = (F_CPU / F_I2C) - 1;