#[cfg(feature = "api-usb-ctap")]
pub mod ctap;
#[cfg(feature = "api-usb-serial")]
pub mod serial;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Debug, PartialEq, Eq)]
pub enum Event {
#[cfg(feature = "api-usb-ctap")]
Ctap(ctap::Event),
#[cfg(feature = "api-usb-serial")]
Serial(serial::Event),
}
impl<B: crate::Api> From<Event> for crate::Event<B> {
fn from(event: Event) -> Self {
crate::Event::Usb(event)
}
}
pub trait Api: Send {
#[cfg(feature = "api-usb-ctap")]
type Ctap: ctap::Api;
#[cfg(feature = "api-usb-serial")]
type Serial: serial::Api;
}
#[cfg(feature = "api-usb-ctap")]
pub type Ctap<B> = <super::Usb<B> as Api>::Ctap;
#[cfg(feature = "api-usb-serial")]
pub type Serial<B> = <super::Usb<B> as Api>::Serial;