nrf-usbd
This commit is contained in:
@ -59,6 +59,8 @@ rand_core = "0.6.3"
|
||||
fixed = "1.10.0"
|
||||
embedded-storage = "0.2.0"
|
||||
cfg-if = "1.0.0"
|
||||
nrf-usbd = "0.1.0"
|
||||
usb-device = "0.2.8"
|
||||
|
||||
nrf52805-pac = { version = "0.10.1", optional = true, features = [ "rt" ] }
|
||||
nrf52810-pac = { version = "0.10.1", optional = true, features = [ "rt" ] }
|
||||
|
@ -73,6 +73,22 @@ pub(crate) use chip::pac;
|
||||
|
||||
pub use chip::{peripherals, Peripherals};
|
||||
|
||||
use nrf_usbd::{UsbPeripheral, Usbd};
|
||||
use usb_device::bus::UsbBusAllocator;
|
||||
|
||||
pub struct UsbBus;
|
||||
unsafe impl UsbPeripheral for UsbBus {
|
||||
const REGISTERS: *const () = pac::USBD::ptr() as *const ();
|
||||
}
|
||||
|
||||
impl UsbBus {
|
||||
pub fn new() -> UsbBusAllocator<Usbd<UsbBus>> {
|
||||
Usbd::new(UsbBus)
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl embassy_hal_common::usb::USBInterrupt for interrupt::USBD {}
|
||||
|
||||
pub mod interrupt {
|
||||
pub use crate::chip::irqs::*;
|
||||
pub use cortex_m::interrupt::{CriticalSection, Mutex};
|
||||
|
Reference in New Issue
Block a user