aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7/src/bin
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-07-23 14:00:19 +0200
committerDario Nieuwenhuis <[email protected]>2022-07-23 14:00:19 +0200
commit4901c34d9c4cd326ab9bca02dd099a663da2567f (patch)
tree8225afebb595fb10c1d67148c0d19b7b732853da /examples/stm32h7/src/bin
parent8a9d2f59af004902d3978a2922843833b98bcce0 (diff)
Rename Unborrowed -> PeripheralRef, Unborrow -> Peripheral
Diffstat (limited to 'examples/stm32h7/src/bin')
-rw-r--r--examples/stm32h7/src/bin/low_level_timer_api.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/stm32h7/src/bin/low_level_timer_api.rs b/examples/stm32h7/src/bin/low_level_timer_api.rs
index e54f1bb67..d7c6da5bd 100644
--- a/examples/stm32h7/src/bin/low_level_timer_api.rs
+++ b/examples/stm32h7/src/bin/low_level_timer_api.rs
@@ -9,7 +9,7 @@ use embassy_stm32::gpio::low_level::AFType;
9use embassy_stm32::gpio::Speed; 9use embassy_stm32::gpio::Speed;
10use embassy_stm32::pwm::*; 10use embassy_stm32::pwm::*;
11use embassy_stm32::time::{khz, mhz, Hertz}; 11use embassy_stm32::time::{khz, mhz, Hertz};
12use embassy_stm32::{unborrow, Config, Peripherals, Unborrow, Unborrowed}; 12use embassy_stm32::{into_ref, Config, Peripheral, PeripheralRef, Peripherals};
13use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
14 14
15pub fn config() -> Config { 15pub fn config() -> Config {
@@ -47,19 +47,19 @@ async fn main(_spawner: Spawner, p: Peripherals) {
47 } 47 }
48} 48}
49pub struct SimplePwm32<'d, T: CaptureCompare32bitInstance> { 49pub struct SimplePwm32<'d, T: CaptureCompare32bitInstance> {
50 inner: Unborrowed<'d, T>, 50 inner: PeripheralRef<'d, T>,
51} 51}
52 52
53impl<'d, T: CaptureCompare32bitInstance> SimplePwm32<'d, T> { 53impl<'d, T: CaptureCompare32bitInstance> SimplePwm32<'d, T> {
54 pub fn new( 54 pub fn new(
55 tim: impl Unborrow<Target = T> + 'd, 55 tim: impl Peripheral<P = T> + 'd,
56 ch1: impl Unborrow<Target = impl Channel1Pin<T>> + 'd, 56 ch1: impl Peripheral<P = impl Channel1Pin<T>> + 'd,
57 ch2: impl Unborrow<Target = impl Channel2Pin<T>> + 'd, 57 ch2: impl Peripheral<P = impl Channel2Pin<T>> + 'd,
58 ch3: impl Unborrow<Target = impl Channel3Pin<T>> + 'd, 58 ch3: impl Peripheral<P = impl Channel3Pin<T>> + 'd,
59 ch4: impl Unborrow<Target = impl Channel4Pin<T>> + 'd, 59 ch4: impl Peripheral<P = impl Channel4Pin<T>> + 'd,
60 freq: Hertz, 60 freq: Hertz,
61 ) -> Self { 61 ) -> Self {
62 unborrow!(tim, ch1, ch2, ch3, ch4); 62 into_ref!(tim, ch1, ch2, ch3, ch4);
63 63
64 T::enable(); 64 T::enable();
65 <T as embassy_stm32::rcc::low_level::RccPeripheral>::reset(); 65 <T as embassy_stm32::rcc::low_level::RccPeripheral>::reset();