use core::fmt::Debug;
use core::hash::Hash;
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct ReadOnly {}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct WriteOnly {}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct ReadWrite {}
pub trait Access:
Debug + Default + Copy + Eq + Ord + Hash + Sized + Send + Sync + 'static + private::Sealed
{
}
#[diagnostic::on_unimplemented(
message = "cannot read from a write-only register",
label = "method cannot be called on write-only registers",
note = "the register is write only because it was annotated with the attribute
`#[reg(WO)]` in the register-map definition"
)]
pub trait Readable: Access {}
#[diagnostic::on_unimplemented(
message = "cannot write to a read-only register",
label = "method cannot be called on read-only registers",
note = "the register is read only because it was annotated with the attribute
`#[reg(RO)]` in the register-map definition"
)]
pub trait Writable: Access {}
impl Access for ReadOnly {}
impl Access for WriteOnly {}
impl Access for ReadWrite {}
impl Readable for ReadOnly {}
impl Readable for ReadWrite {}
impl Writable for WriteOnly {}
impl Writable for ReadWrite {}
mod private {
pub trait Sealed {}
impl Sealed for super::ReadOnly {}
impl Sealed for super::WriteOnly {}
impl Sealed for super::ReadWrite {}
}