From edb679b83dd999b149409b433a2080cbffaf55b1 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 23 May 2019 09:17:50 -0400 Subject: [PATCH] atsam: Enable pullup on i2c SDA line The internal pullup helps ensure i2c errors are detected properly. Signed-off-by: Kevin O'Connor --- src/atsam/i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/atsam/i2c.c b/src/atsam/i2c.c index 4b5cb430..672eacef 100644 --- a/src/atsam/i2c.c +++ b/src/atsam/i2c.c @@ -34,11 +34,11 @@ i2c_init(Twi *p_twi, uint32_t rate) { enable_pclock(p_twi == TWI0 ? ID_TWI0 : ID_TWI1); if (p_twi == TWI0) { - gpio_peripheral(TWI0_SCL_GPIO, 'A', 0); - gpio_peripheral(TWI0_SDA_GPIO, 'A', 0); + gpio_peripheral(TWI0_SCL_GPIO, 'A', 1); + gpio_peripheral(TWI0_SDA_GPIO, 'A', 1); } else { - gpio_peripheral(TWI1_SCL_GPIO, 'A', 0); - gpio_peripheral(TWI1_SDA_GPIO, 'A', 0); + gpio_peripheral(TWI1_SCL_GPIO, 'A', 1); + gpio_peripheral(TWI1_SDA_GPIO, 'A', 1); } p_twi->TWI_IDR = 0xFFFFFFFF; (void)p_twi->TWI_SR;