use crate::{ReadableRegister, WritableRegister};
pub struct NoCodec {}
#[maybe_async_cfg::maybe(
idents(hal(sync = "embedded_hal", async = "embedded_hal_async"), Codec),
sync(feature = "sync"),
async(feature = "async"),
keep_self
)]
impl crate::spi::Codec for NoCodec {
#[inline]
async fn read_register<R, I>(_interface: &mut I) -> Result<R, I::Error>
where
R: ReadableRegister,
I: hal::spi::r#SpiDevice,
{
panic!("spi::codecs::NoCodec cannot be used at runtime! Please specify a real codec to access this register.");
}
#[inline]
async fn write_register<R, I>(_interface: &mut I, _register: impl AsRef<R>) -> Result<(), I::Error>
where
R: WritableRegister,
I: hal::spi::r#SpiDevice,
{
panic!("spi::codecs::NoCodec cannot be used at runtime! Please specify a real codec to access this register.");
}
}