aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/lib.rs
diff options
context:
space:
mode:
authorJacob Rosenthal <[email protected]>2021-12-13 17:50:08 -0700
committerJacob Rosenthal <[email protected]>2021-12-13 18:04:54 -0700
commit83a1237ea3f8b164749cb895b7bdb7a5696107f6 (patch)
tree93b4a873ebcaf88eadc35fd33e39c3b4f1817845 /embassy-nrf/src/lib.rs
parente5dc63e8e99d1d818ed7ab3b13ffff3ee2c40a3d (diff)
stub out the embassy registers for usbd
Diffstat (limited to 'embassy-nrf/src/lib.rs')
-rw-r--r--embassy-nrf/src/lib.rs23
1 files changed, 3 insertions, 20 deletions
diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs
index 13e7803a8..7434905e6 100644
--- a/embassy-nrf/src/lib.rs
+++ b/embassy-nrf/src/lib.rs
@@ -48,6 +48,9 @@ pub mod temp;
48pub mod timer; 48pub mod timer;
49pub mod twim; 49pub mod twim;
50pub mod uarte; 50pub mod uarte;
51//todo add nrf52833 nrf52840
52#[cfg(feature = "nrf52840")]
53pub mod usb;
51#[cfg(not(feature = "_nrf5340"))] 54#[cfg(not(feature = "_nrf5340"))]
52pub mod wdt; 55pub mod wdt;
53 56
@@ -73,26 +76,6 @@ pub(crate) use chip::pac;
73 76
74pub use chip::{peripherals, Peripherals}; 77pub use chip::{peripherals, Peripherals};
75 78
76#[cfg(any(feature = "nrf52820", feature = "nrf52833", feature = "nrf52840"))]
77pub mod usb {
78
79 use nrf_usbd::{UsbPeripheral, Usbd};
80 use usb_device::bus::UsbBusAllocator;
81
82 pub struct UsbBus;
83 unsafe impl UsbPeripheral for UsbBus {
84 const REGISTERS: *const () = crate::pac::USBD::ptr() as *const ();
85 }
86
87 impl UsbBus {
88 pub fn new() -> UsbBusAllocator<Usbd<UsbBus>> {
89 Usbd::new(UsbBus)
90 }
91 }
92
93 unsafe impl embassy_hal_common::usb::USBInterrupt for crate::interrupt::USBD {}
94}
95
96pub mod interrupt { 79pub mod interrupt {
97 pub use crate::chip::irqs::*; 80 pub use crate::chip::irqs::*;
98 pub use cortex_m::interrupt::{CriticalSection, Mutex}; 81 pub use cortex_m::interrupt::{CriticalSection, Mutex};