embedded_registers/spi/codecs/
no_codec.rs1use crate::{ReadableRegister, WritableRegister};
2
3pub struct NoCodec {}
15
16#[maybe_async_cfg::maybe(
17 idents(hal(sync = "embedded_hal", async = "embedded_hal_async"), Codec),
18 sync(feature = "sync"),
19 async(feature = "async"),
20 keep_self
21)]
22impl crate::spi::Codec for NoCodec {
23 #[inline]
24 async fn read_register<R, I>(_interface: &mut I) -> Result<R, I::Error>
25 where
26 R: ReadableRegister,
27 I: hal::spi::r#SpiDevice,
28 {
29 panic!("spi::codecs::NoCodec cannot be used at runtime! Please specify a real codec to access this register.");
30 }
31
32 #[inline]
33 async fn write_register<R, I>(_interface: &mut I, _register: impl AsRef<R>) -> Result<(), I::Error>
34 where
35 R: WritableRegister,
36 I: hal::spi::r#SpiDevice,
37 {
38 panic!("spi::codecs::NoCodec cannot be used at runtime! Please specify a real codec to access this register.");
39 }
40}