feat(api): add plug_in_detection
This commit is contained in:
parent
ba319eecff
commit
c4686aafc4
|
@ -93,7 +93,10 @@ impl<const L: usize> UsbDevice<L> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline(always)]
|
||||||
|
pub fn plug_in_detect(&self, cs: CriticalSection<'_>) -> bool {
|
||||||
|
self.usb.borrow(cs).usbsta.read().vbus().bit_is_set()
|
||||||
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub(crate) fn allocated_endpoints(&self) -> impl Iterator<Item = (usize, &USBEndpoint)> {
|
pub(crate) fn allocated_endpoints(&self) -> impl Iterator<Item = (usize, &USBEndpoint)> {
|
||||||
|
|
Loading…
Reference in New Issue