use crate::{gpio::Pin, peripherals::IO_MUX};
pub trait UsbFsDp: crate::private::Sealed {
#[doc(hidden)]
fn configure(&self);
}
pub trait UsbFsDm: crate::private::Sealed {
#[doc(hidden)]
fn configure(&self);
}
fn set_high_drive(pin: &impl Pin) {
IO_MUX::regs()
.gpio(pin.number() as usize)
.modify(|_, w| unsafe { w.fun_drv().bits(3) });
}
for_each_analog_function! {
(USB_FS_DM, $gpio:ident) => {
impl UsbFsDm for crate::peripherals::$gpio<'_> {
fn configure(&self) {
set_high_drive(self);
}
}
};
(USB_FS_DP, $gpio:ident) => {
impl UsbFsDp for crate::peripherals::$gpio<'_> {
fn configure(&self) {
set_high_drive(self);
}
}
};
}