Remove Peripheral trait, rename PeripheralRef->Peri.

This commit is contained in:
Dario Nieuwenhuis
2025-03-26 16:01:37 +01:00
parent 9edf5b7f04
commit d41eeeae79
225 changed files with 2645 additions and 3215 deletions

View File

@@ -7,14 +7,14 @@ use embassy_stm32::gpio::{Level, Output, Pull, Speed};
use embassy_stm32::time::khz;
use embassy_stm32::timer::input_capture::{CapturePin, InputCapture};
use embassy_stm32::timer::{self, Channel};
use embassy_stm32::{bind_interrupts, peripherals};
use embassy_stm32::{bind_interrupts, peripherals, Peri};
use embassy_time::Timer;
use {defmt_rtt as _, panic_probe as _};
/// Connect PA2 and PC13 with a 1k Ohm resistor
#[embassy_executor::task]
async fn blinky(led: peripherals::PC13) {
async fn blinky(led: Peri<'static, peripherals::PC13>) {
let mut led = Output::new(led, Level::High, Speed::Low);
loop {

View File

@@ -6,14 +6,14 @@ use embassy_executor::Spawner;
use embassy_stm32::gpio::{Level, Output, Pull, Speed};
use embassy_stm32::time::khz;
use embassy_stm32::timer::pwm_input::PwmInput;
use embassy_stm32::{bind_interrupts, peripherals, timer};
use embassy_stm32::{bind_interrupts, peripherals, timer, Peri};
use embassy_time::Timer;
use {defmt_rtt as _, panic_probe as _};
/// Connect PA0 and PC13 with a 1k Ohm resistor
#[embassy_executor::task]
async fn blinky(led: peripherals::PC13) {
async fn blinky(led: Peri<'static, peripherals::PC13>) {
let mut led = Output::new(led, Level::High, Speed::Low);
loop {

View File

@@ -47,7 +47,7 @@ async fn main(_spawner: Spawner) {
// Pull the D+ pin down to send a RESET condition to the USB bus.
// This forced reset is needed only for development, without it host
// will not reset your device when you upload new firmware.
let _dp = Output::new(&mut p.PA12, Level::Low, Speed::Low);
let _dp = Output::new(p.PA12.reborrow(), Level::Low, Speed::Low);
Timer::after_millis(10).await;
}