diff --git a/embassy-rp/src/i2c/i2c_device.rs b/embassy-rp/src/i2c/i2c_slave.rs similarity index 98% rename from embassy-rp/src/i2c/i2c_device.rs rename to embassy-rp/src/i2c/i2c_slave.rs index 5c78a86e3..154a0f32c 100644 --- a/embassy-rp/src/i2c/i2c_device.rs +++ b/embassy-rp/src/i2c/i2c_slave.rs @@ -35,32 +35,32 @@ pub enum ReadStatus { LeftoverBytes(u16), } -/// Device Configuration +/// Slave Configuration #[non_exhaustive] #[derive(Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub struct DeviceConfig { +pub struct SlaveConfig { /// Target Address pub addr: u16, } -impl Default for DeviceConfig { +impl Default for SlaveConfig { fn default() -> Self { Self { addr: 0x55 } } } -pub struct I2cDevice<'d, T: Instance> { +pub struct I2cSlave<'d, T: Instance> { phantom: PhantomData<&'d mut T>, } -impl<'d, T: Instance> I2cDevice<'d, T> { +impl<'d, T: Instance> I2cSlave<'d, T> { pub fn new( _peri: impl Peripheral

+ 'd, scl: impl Peripheral

> + 'd, sda: impl Peripheral

> + 'd, _irq: impl Binding>, - config: DeviceConfig, + config: SlaveConfig, ) -> Self { into_ref!(_peri, scl, sda); diff --git a/embassy-rp/src/i2c/mod.rs b/embassy-rp/src/i2c/mod.rs index 2b3523d69..05662fa6a 100644 --- a/embassy-rp/src/i2c/mod.rs +++ b/embassy-rp/src/i2c/mod.rs @@ -1,11 +1,11 @@ mod i2c; -mod i2c_device; +mod i2c_slave; use core::marker::PhantomData; use embassy_sync::waitqueue::AtomicWaker; pub use i2c::{Config, I2c}; -pub use i2c_device::{Command, DeviceConfig, I2cDevice, ReadStatus}; +pub use i2c_slave::{Command, I2cSlave, ReadStatus, SlaveConfig}; use crate::{interrupt, pac, peripherals};