aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/i2c/mod.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2025-03-26 16:01:37 +0100
committerDario Nieuwenhuis <[email protected]>2025-03-27 15:18:06 +0100
commitd41eeeae79388f219bf6a84e2f7bde9f6b532516 (patch)
tree678b6fc732216e529dc38e6f65b72a309917ac32 /embassy-stm32/src/i2c/mod.rs
parent9edf5b7f049f95742b60b041e4443967d8a6b708 (diff)
Remove Peripheral trait, rename PeripheralRef->Peri.
Diffstat (limited to 'embassy-stm32/src/i2c/mod.rs')
-rw-r--r--embassy-stm32/src/i2c/mod.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs
index 3a9954663..1689fdb84 100644
--- a/embassy-stm32/src/i2c/mod.rs
+++ b/embassy-stm32/src/i2c/mod.rs
@@ -9,7 +9,7 @@ use core::future::Future;
9use core::iter; 9use core::iter;
10use core::marker::PhantomData; 10use core::marker::PhantomData;
11 11
12use embassy_hal_internal::{Peripheral, PeripheralRef}; 12use embassy_hal_internal::Peri;
13use embassy_sync::waitqueue::AtomicWaker; 13use embassy_sync::waitqueue::AtomicWaker;
14#[cfg(feature = "time")] 14#[cfg(feature = "time")]
15use embassy_time::{Duration, Instant}; 15use embassy_time::{Duration, Instant};
@@ -131,8 +131,8 @@ pub struct I2c<'d, M: Mode> {
131 info: &'static Info, 131 info: &'static Info,
132 state: &'static State, 132 state: &'static State,
133 kernel_clock: Hertz, 133 kernel_clock: Hertz,
134 scl: Option<PeripheralRef<'d, AnyPin>>, 134 scl: Option<Peri<'d, AnyPin>>,
135 sda: Option<PeripheralRef<'d, AnyPin>>, 135 sda: Option<Peri<'d, AnyPin>>,
136 tx_dma: Option<ChannelAndRequest<'d>>, 136 tx_dma: Option<ChannelAndRequest<'d>>,
137 rx_dma: Option<ChannelAndRequest<'d>>, 137 rx_dma: Option<ChannelAndRequest<'d>>,
138 #[cfg(feature = "time")] 138 #[cfg(feature = "time")]
@@ -143,14 +143,14 @@ pub struct I2c<'d, M: Mode> {
143impl<'d> I2c<'d, Async> { 143impl<'d> I2c<'d, Async> {
144 /// Create a new I2C driver. 144 /// Create a new I2C driver.
145 pub fn new<T: Instance>( 145 pub fn new<T: Instance>(
146 peri: impl Peripheral<P = T> + 'd, 146 peri: Peri<'d, T>,
147 scl: impl Peripheral<P = impl SclPin<T>> + 'd, 147 scl: Peri<'d, impl SclPin<T>>,
148 sda: impl Peripheral<P = impl SdaPin<T>> + 'd, 148 sda: Peri<'d, impl SdaPin<T>>,
149 _irq: impl interrupt::typelevel::Binding<T::EventInterrupt, EventInterruptHandler<T>> 149 _irq: impl interrupt::typelevel::Binding<T::EventInterrupt, EventInterruptHandler<T>>
150 + interrupt::typelevel::Binding<T::ErrorInterrupt, ErrorInterruptHandler<T>> 150 + interrupt::typelevel::Binding<T::ErrorInterrupt, ErrorInterruptHandler<T>>
151 + 'd, 151 + 'd,
152 tx_dma: impl Peripheral<P = impl TxDma<T>> + 'd, 152 tx_dma: Peri<'d, impl TxDma<T>>,
153 rx_dma: impl Peripheral<P = impl RxDma<T>> + 'd, 153 rx_dma: Peri<'d, impl RxDma<T>>,
154 freq: Hertz, 154 freq: Hertz,
155 config: Config, 155 config: Config,
156 ) -> Self { 156 ) -> Self {
@@ -169,9 +169,9 @@ impl<'d> I2c<'d, Async> {
169impl<'d> I2c<'d, Blocking> { 169impl<'d> I2c<'d, Blocking> {
170 /// Create a new blocking I2C driver. 170 /// Create a new blocking I2C driver.
171 pub fn new_blocking<T: Instance>( 171 pub fn new_blocking<T: Instance>(
172 peri: impl Peripheral<P = T> + 'd, 172 peri: Peri<'d, T>,
173 scl: impl Peripheral<P = impl SclPin<T>> + 'd, 173 scl: Peri<'d, impl SclPin<T>>,
174 sda: impl Peripheral<P = impl SdaPin<T>> + 'd, 174 sda: Peri<'d, impl SdaPin<T>>,
175 freq: Hertz, 175 freq: Hertz,
176 config: Config, 176 config: Config,
177 ) -> Self { 177 ) -> Self {
@@ -190,9 +190,9 @@ impl<'d> I2c<'d, Blocking> {
190impl<'d, M: Mode> I2c<'d, M> { 190impl<'d, M: Mode> I2c<'d, M> {
191 /// Create a new I2C driver. 191 /// Create a new I2C driver.
192 fn new_inner<T: Instance>( 192 fn new_inner<T: Instance>(
193 _peri: impl Peripheral<P = T> + 'd, 193 _peri: Peri<'d, T>,
194 scl: Option<PeripheralRef<'d, AnyPin>>, 194 scl: Option<Peri<'d, AnyPin>>,
195 sda: Option<PeripheralRef<'d, AnyPin>>, 195 sda: Option<Peri<'d, AnyPin>>,
196 tx_dma: Option<ChannelAndRequest<'d>>, 196 tx_dma: Option<ChannelAndRequest<'d>>,
197 rx_dma: Option<ChannelAndRequest<'d>>, 197 rx_dma: Option<ChannelAndRequest<'d>>,
198 freq: Hertz, 198 freq: Hertz,