aboutsummaryrefslogtreecommitdiff
path: root/embassy-rp/src/usb.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-rp/src/usb.rs
parent9edf5b7f049f95742b60b041e4443967d8a6b708 (diff)
Remove Peripheral trait, rename PeripheralRef->Peri.
Diffstat (limited to 'embassy-rp/src/usb.rs')
-rw-r--r--embassy-rp/src/usb.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/embassy-rp/src/usb.rs b/embassy-rp/src/usb.rs
index 26cb90d89..96541ade6 100644
--- a/embassy-rp/src/usb.rs
+++ b/embassy-rp/src/usb.rs
@@ -5,6 +5,7 @@ use core::slice;
5use core::sync::atomic::{compiler_fence, Ordering}; 5use core::sync::atomic::{compiler_fence, Ordering};
6use core::task::Poll; 6use core::task::Poll;
7 7
8use embassy_hal_internal::PeripheralType;
8use embassy_sync::waitqueue::AtomicWaker; 9use embassy_sync::waitqueue::AtomicWaker;
9use embassy_usb_driver as driver; 10use embassy_usb_driver as driver;
10use embassy_usb_driver::{ 11use embassy_usb_driver::{
@@ -12,7 +13,7 @@ use embassy_usb_driver::{
12}; 13};
13 14
14use crate::interrupt::typelevel::{Binding, Interrupt}; 15use crate::interrupt::typelevel::{Binding, Interrupt};
15use crate::{interrupt, pac, peripherals, Peripheral, RegExt}; 16use crate::{interrupt, pac, peripherals, Peri, RegExt};
16 17
17trait SealedInstance { 18trait SealedInstance {
18 fn regs() -> crate::pac::usb::Usb; 19 fn regs() -> crate::pac::usb::Usb;
@@ -21,7 +22,7 @@ trait SealedInstance {
21 22
22/// USB peripheral instance. 23/// USB peripheral instance.
23#[allow(private_bounds)] 24#[allow(private_bounds)]
24pub trait Instance: SealedInstance + 'static { 25pub trait Instance: SealedInstance + PeripheralType + 'static {
25 /// Interrupt for this peripheral. 26 /// Interrupt for this peripheral.
26 type Interrupt: interrupt::typelevel::Interrupt; 27 type Interrupt: interrupt::typelevel::Interrupt;
27} 28}
@@ -107,7 +108,7 @@ pub struct Driver<'d, T: Instance> {
107 108
108impl<'d, T: Instance> Driver<'d, T> { 109impl<'d, T: Instance> Driver<'d, T> {
109 /// Create a new USB driver. 110 /// Create a new USB driver.
110 pub fn new(_usb: impl Peripheral<P = T> + 'd, _irq: impl Binding<T::Interrupt, InterruptHandler<T>>) -> Self { 111 pub fn new(_usb: Peri<'d, T>, _irq: impl Binding<T::Interrupt, InterruptHandler<T>>) -> Self {
111 T::Interrupt::unpend(); 112 T::Interrupt::unpend();
112 unsafe { T::Interrupt::enable() }; 113 unsafe { T::Interrupt::enable() };
113 114