#![cfg_attr(not(test), no_std)]
#![warn(missing_docs)]
use core::future::Future;
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum DriverRxError {
Discarded,
HardReset,
}
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum DriverTxError {
Discarded,
HardReset,
}
pub trait Driver {
fn wait_for_vbus(&self) -> impl Future<Output = ()>;
fn receive(&mut self, buffer: &mut [u8]) -> impl Future<Output = Result<usize, DriverRxError>>;
fn transmit(&mut self, data: &[u8]) -> impl Future<Output = Result<(), DriverTxError>>;
fn transmit_hard_reset(&mut self) -> impl Future<Output = Result<(), DriverTxError>>;
}