feat(usb_device): add getters

This commit is contained in:
doryan 2025-04-28 20:23:02 +04:00
parent ce10b959e4
commit 4a90b9a6c8

View File

@ -93,6 +93,16 @@ impl<const L: usize> UsbDevice<L> {
}) })
} }
#[inline(always)]
pub fn get_usb_device<'u>(&'u self, cs: CriticalSection<'u>) -> &'u USB_DEVICE {
self.usb.borrow(cs)
}
#[inline(always)]
pub fn get_pll<'u>(&'u self, cs: CriticalSection<'u>) -> &'u PLL {
self.pll.borrow(cs)
}
#[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)> {
self.ep_table self.ep_table