diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-05-23 09:17:50 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-05-23 09:32:10 -0400 |
commit | edb679b83dd999b149409b433a2080cbffaf55b1 (patch) | |
tree | 2704da0633609619f6e9df077d765b32313237ba /src/atsam | |
parent | 24b1638c25c7136f64a43f51894b31ba561c23c4 (diff) | |
download | kutter-edb679b83dd999b149409b433a2080cbffaf55b1.tar.gz kutter-edb679b83dd999b149409b433a2080cbffaf55b1.tar.xz kutter-edb679b83dd999b149409b433a2080cbffaf55b1.zip |
atsam: Enable pullup on i2c SDA line
The internal pullup helps ensure i2c errors are detected properly.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/atsam')
-rw-r--r-- | src/atsam/i2c.c | 8 |
1 files 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; |