Compare commits
No commits in common. "c4686aafc41d0627609ed42536a2f9b5922c4a1f" and "a1e180b45116631284b9ad125c8cb9bc7fda2c8d" have entirely different histories.
c4686aafc4
...
a1e180b451
|
@ -82,6 +82,13 @@ pub(crate) const ENDPOINTS_ALLOC_LAYOUT: [u16; MAX_ENDPOINTS] = [64, 256, 64, 64
|
||||||
pub(crate) const ONE_MS_16_MGHZ: u32 = 16000;
|
pub(crate) const ONE_MS_16_MGHZ: u32 = 16000;
|
||||||
|
|
||||||
impl<const L: usize> UsbDevice<L> {
|
impl<const L: usize> UsbDevice<L> {
|
||||||
|
#[inline]
|
||||||
|
pub(crate) fn get_size(&self, cs: CriticalSection<'_>) -> usize {
|
||||||
|
let usb = self.usb.borrow(cs);
|
||||||
|
|
||||||
|
(((usb.uebchx.read().bits() as u16) << 8) | (usb.uebclx.read().bits() as u16)).into()
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(pll: PLL, usb: USB_DEVICE) -> UsbBusAllocator<Self> {
|
pub fn new(pll: PLL, usb: USB_DEVICE) -> UsbBusAllocator<Self> {
|
||||||
UsbBusAllocator::new(Self {
|
UsbBusAllocator::new(Self {
|
||||||
|
@ -93,12 +100,7 @@ impl<const L: usize> UsbDevice<L> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline]
|
||||||
pub fn plug_in_detect(&self, cs: CriticalSection<'_>) -> bool {
|
|
||||||
self.usb.borrow(cs).usbsta.read().vbus().bit_is_set()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(always)]
|
|
||||||
pub(crate) fn allocated_endpoints(&self) -> impl Iterator<Item = (usize, &USBEndpoint)> {
|
pub(crate) fn allocated_endpoints(&self) -> impl Iterator<Item = (usize, &USBEndpoint)> {
|
||||||
self.ep_table
|
self.ep_table
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -176,11 +178,4 @@ impl<const L: usize> UsbDevice<L> {
|
||||||
Err(exception) => Err(exception),
|
Err(exception) => Err(exception),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
|
||||||
pub(crate) fn get_size(&self, cs: CriticalSection<'_>) -> usize {
|
|
||||||
let usb = self.usb.borrow(cs);
|
|
||||||
|
|
||||||
(((usb.uebchx.read().bits() as u16) << 8) | (usb.uebclx.read().bits() as u16)).into()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue