Manually change I2C config. to use 400 MHz bus speed

This commit is contained in:
Adam Macdonald 2025-02-28 20:48:05 +00:00
parent 203f128b58
commit 0fe57f5926

View File

@ -24,7 +24,8 @@ async fn main(_spawner: Spawner) {
let sda = peripherals.PIN_4;
let scl = peripherals.PIN_5;
let i2c_config = embassy_rp::i2c::Config::default(); // TODO: Frequency is 100 MHz by default, should be 400 MHz
let mut i2c_config = embassy_rp::i2c::Config::default(); // TODO: Frequency is 100 MHz by default, should be 400 MHz
i2c_config.frequency = 400_000u32;
let i2c_bus = embassy_rp::i2c::I2c::new_blocking(peripherals.I2C0, scl, sda, i2c_config);
embassy_time::Timer::after_millis(30).await; // SCD41 power-up delay