diff options
| author | James Munns <[email protected]> | 2025-08-21 15:51:54 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-21 15:51:54 +0000 |
| commit | d65a5078f26f860881b2f4a0db84e0d8f3160624 (patch) | |
| tree | 7aa88c22c096da5d4826027efeba983a1eab1fa9 | |
| parent | 63ade389303ab4f6fe9d34211629b02c16e9bb11 (diff) | |
| parent | 9c72c684d1446d36598c9ce628df41996420fb32 (diff) | |
Merge pull request #4569 from robjwells/rp-i2c-pull-example
rp: fix blocking I2C example regarding pull-up resistors
| -rw-r--r-- | examples/rp/src/bin/i2c_blocking.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/rp/src/bin/i2c_blocking.rs b/examples/rp/src/bin/i2c_blocking.rs index 6a57ded20..317921374 100644 --- a/examples/rp/src/bin/i2c_blocking.rs +++ b/examples/rp/src/bin/i2c_blocking.rs | |||
| @@ -49,10 +49,8 @@ async fn main(_spawner: Spawner) { | |||
| 49 | let scl = p.PIN_15; | 49 | let scl = p.PIN_15; |
| 50 | 50 | ||
| 51 | info!("set up i2c "); | 51 | info!("set up i2c "); |
| 52 | let mut config = Config::default(); | 52 | // Default I2C config enables internal pull-up resistors. |
| 53 | // by default internal pullup resitors are disabled | 53 | let config = Config::default(); |
| 54 | config.sda_pullup = true; | ||
| 55 | config.scl_pullup = true; | ||
| 56 | let mut i2c = i2c::I2c::new_blocking(p.I2C1, scl, sda, config); | 54 | let mut i2c = i2c::I2c::new_blocking(p.I2C1, scl, sda, config); |
| 57 | 55 | ||
| 58 | use mcp23017::*; | 56 | use mcp23017::*; |
