I2C peripheral name got changed for ESP32C3

This commit is contained in:
bjoernQ 2022-03-02 10:18:58 +01:00
parent e34319b763
commit a6dc853a82
2 changed files with 1 additions and 18 deletions

View File

@ -5,9 +5,6 @@ use core::convert::TryInto;
use embedded_hal::blocking::i2c::*;
#[cfg(feature = "esp32c3")]
use crate::pac::i2c::{RegisterBlock, COMD};
#[cfg(not(feature = "esp32c3"))]
use crate::pac::i2c0::{RegisterBlock, COMD};
use crate::{
gpio::{InputPin, OutputPin},
@ -915,20 +912,6 @@ fn write_fifo(register_block: &RegisterBlock, data: u8) {
}
}
#[cfg(feature = "esp32c3")]
impl Instance for crate::pac::I2C {
#[inline(always)]
fn register_block(&self) -> &RegisterBlock {
self
}
#[inline(always)]
fn i2c_number(&self) -> usize {
0
}
}
#[cfg(not(feature = "esp32c3"))]
impl Instance for crate::pac::I2C0 {
#[inline(always)]
fn register_block(&self) -> &RegisterBlock {

View File

@ -44,7 +44,7 @@ fn main() -> ! {
// Create a new peripheral object with the described wiring
// and standard I2C clock speed
let i2c = I2C::new(
peripherals.I2C,
peripherals.I2C0,
io.pins.gpio1,
io.pins.gpio2,
100_000,