From a6627709f7348dcfdcb7cd87a24ba7a80730487b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 12 Oct 2018 10:47:37 +0200 Subject: MSP430 I2C: Configurable I2C frequency --- src/arch/msp430fr5969lp/driver/i2c.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/msp430fr5969lp/driver/i2c.cc b/src/arch/msp430fr5969lp/driver/i2c.cc index 55f8591..be41a50 100644 --- a/src/arch/msp430fr5969lp/driver/i2c.cc +++ b/src/arch/msp430fr5969lp/driver/i2c.cc @@ -8,7 +8,7 @@ signed char I2C::setup() { UCB0CTL1 = UCSWRST; UCB0CTLW0 = UCMODE_3 | UCMST | UCSYNC | UCSSEL_2 | UCSWRST | UCCLTO_1; - UCB0BRW = 0xf00; + UCB0BRW = (F_CPU / F_I2C) - 1; P1DIR &= ~(BIT6 | BIT7); P1SEL0 &= ~(BIT6 | BIT7); P1SEL1 |= BIT6 | BIT7; -- cgit v1.2.3