pub trait RegisterIO {
type Error;
// Required methods
unsafe fn try_read_register<R: Register>(
&self,
ptr: *const R::Regwidth,
) -> Result<R, Self::Error>
where R::Access: Read;
unsafe fn try_write_register<R: Register>(
&self,
ptr: *mut R::Regwidth,
value: R,
) -> Result<(), Self::Error>
where R::Access: Write;
}Expand description
Register I/O
Register accesses are performed through implementers of this trait. This trait’s methods handle details like endianness, multi-word writes, etc.
Most user I/O interfaces should simply implement the RawRegisterIO trait, since a
blanket implementation exists for all implementers of RawRegisterIO.
Required Associated Types§
Required Methods§
Sourceunsafe fn try_read_register<R: Register>(
&self,
ptr: *const R::Regwidth,
) -> Result<R, Self::Error>
unsafe fn try_read_register<R: Register>( &self, ptr: *const R::Regwidth, ) -> Result<R, Self::Error>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.