use alloc::boxed::Box;
use core::future::Future;
use core::pin::Pin;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum NfcError {
BusError,
InvalidAddress,
NoDevice,
}
pub trait Nfc: Send {
fn read<'a>(
&'a mut self,
address: u16,
data: &'a mut [u8],
) -> Pin<Box<dyn Future<Output = Result<(), NfcError>> + 'a>>;
fn write<'a>(
&'a mut self,
address: u16,
data: &'a [u8],
) -> Pin<Box<dyn Future<Output = Result<(), NfcError>> + 'a>>;
fn detect_field<'a>(
&'a mut self,
) -> Pin<Box<dyn Future<Output = Result<bool, NfcError>> + 'a>>;
}